Add 'make manage' target, update readme.#1085
Conversation
| Add a package to the checkouts: | ||
|
|
||
| ```shell | ||
| make manage ARGS="add-checkout plone.restapi" |
There was a problem hiding this comment.
I had to run make mxenv-clean and then make install for the checkout to work. I think it's worth mentioning.
|
|
||
| Run `make zope-start` to start the Zope instance. | ||
|
|
||
| ### Manage checkouts and versions |
There was a problem hiding this comment.
I think we can be more explicit about the tests. I think we could add something like:
Note: Simply having a package directory under src/ is not enough for make test to pick it up.
You need to explicitly add it as a checkout and reinstall:
make manage ARGS="add-checkout plone.restapi"
make mxenv-clean
make install
Only after this will `make test TEST_PACKAGE=plone.restapi` use the source from src/.
Based on comments from Wesley.
|
@wesleybl I adapted and included your comments. Can you review again please? |
| ``` | ||
|
|
||
| This does not yet checkout the package: it only updates the `checkouts.cfg` and `mxcheckouts.ini` files. | ||
| To *use* the new checkout, you still need to run `make install`. |
There was a problem hiding this comment.
If the package doesn't exist in src and I do:
make manage ARGS="add-checkout plone.restapi"
executing only make install, the clone doesn't occur. The mxdev command is only executed if mx.ini is modified. But make manage modifies mxcheckouts.ini and not mx.ini. See the rule:
Lines 336 to 340 in bd4604c
We must also add the other files that, if modified, should execute mxdev. We must do this in include.mk:
$(SOURCES_TARGET): mxcheckouts.ini mxsources.ini mxtests.iniThere was a problem hiding this comment.
That seems to work, at least for this case, which is good!
But I am not sure. You basically then have this:
SOURCES_TARGET:=$(SENTINEL_FOLDER)/sources.sentinel
$(SOURCES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET)
@echo "Checkout project sources"
@mxdev -f -c $(PROJECT_CONFIG)
@touch $(SOURCES_TARGET)
$(SOURCES_TARGET): mxcheckouts.ini mxsources.ini mxtests.ini
It seems to me that this line overrides the second line, so maybe they need to be combined. Or does this happen automatically? The commands are still executed, so that part works.
@jensens Can you advise here?
Maybe in mxmake we could define it like this (if I spell it correctly):
SOURCES_TARGETS=$(PROJECT_CONFIG) $(MXENV_TARGET)
$(SOURCES_TARGET): $(SOURCES_TARGETS)
...
And then in our include.mk we could add:
SOURCES_TARGETS+=mxcheckouts.ini mxsources.ini mxtests.ini
But I guess that line is included too late, so it would have no effect.
There was a problem hiding this comment.
The commands are still executed, so that part works.
Yes, it works. make merges all prerequisites into a single list. You can leave a comment to clarify this, since it generated some confusion.
But your idea of SOURCES_TARGETS+= is good. It makes things clearer. But it would require a change in mxmake.
So my recommendation is to add the comment and open an issue in mxmake.
|
|
||
| ``` | ||
| make manage ARGS="add-checkout plone.restapi" | ||
| make mxenv-clean |
There was a problem hiding this comment.
make mxenv-clean that's no longer necessary with my previous comment.
| * In `.venv` there is a virtual environment with Plone and all test requirements installed. | ||
| * In `instance` a Zope instance is created. | ||
|
|
||
| Important: you may need to run `make install` twice, especially after you change something. |
There was a problem hiding this comment.
Perhaps it's no longer necessary to run make install twice, after my suggestion.
See #1083