Hi Carl,
Thanks for your extensive response - see my comments inline.
Could you describe the lifecycle of .modulesOrder.conf
What does it do ?
What generates it ? play deps ?
Is the developer supposed to update that file ?
Can a play 1.3 application work without it ?
Let me explain how it works (and why it is currently this way).
in play 1.2.x when play starts, it reads the modules to loaded from the files in the 'modules' directory.
as described in issue
#781 this can result in issues, especially when you have multiple modules that provide templates.
the fix accepted for it, did is introduce a nasty side-effect: "play run" would actually resolve the dependencies again
(while it should only look up the order), as described here
#1664. To mitigate this, the quick-fix was introduced to
write the order to a file, so that could be used to look up the order. The author of this fix already stated that this is not the
best solution, but is does fix the problem.
So here we are: the module ordering issue is fixed; but the order file is stored in way that confuses some other systems
Here's my reasoning.
If the file is necessary for the application to work and is not
a by product of compilation, it shouldn't be hidden (ie its name
shouldn't start with .)
It is confusing for the developer and may be so for other tools
and/or version control systems. This was the issue with the
GAE module : hidden files are not deployed.
So, my advice would be to to rename (A) it to modulesOrder.conf and
find a location for it that :
- makes sense
- doesn't have any side effect for existing tooling and modules
If (A) is accepted, then the gae module proved that application/modules/ is not a good place
as files in that folder are expected to be shortcuts and not description for module order.
I don't know if there are other module that uses the shortcut mechanism
but it seems likely.
If the modulesOrder.conf is supposed to be edited by the developer (which I doubt somehow), then
the conf/ seems appropriate (B).
no, it is not - it should only be touched by 'play deps'
If the modulesOrder.conf is not supposed to be edited or a conf file why not treating it like the
message file or other templates/resources (C): they are certainly packaged by all the
modules.
the messages file sits in conf, templates inside app/views - not sure where this option would place modulesOrder.conf
If the modulesOrder.conf is not generated in the compilation process then
I reckon that application/classes (D) is not suitable. And putting the file
along with .java files so it will copied to application/classes feels not right.
So according to me, the questions are :
- does (A) make sense for you ?
yes. apparently the modules/ location is not a good place
- do you confirm that (D) is bad ?
yes. as stated: a 'play clean' should removed compiled classes, not dependency info
- is there any other scenario other than (B) and (C) ?
I'm not sure what scenario (C) would mean for the location. I don't see any other obvious
locations for it though...
And then makes the final choice, do some testing (and maybe release a beta
for 1.3).
yes. as stated future releases will have proper RC's
By the way, I think that this discussion should have its own thread.
I changed the subject - not sure if that makes it a new thread though.
To continue we can do one of these:
1) revert all dependency management changes and reopen issue #781
2) rename .modulesOrder.conf to modulesOrder.conf and move it to /conf/
we could add some comment-lines stating that is a generated file that should not be edited
3) take a deep dive into the dependency management and try to create a 'proper' fix
I have a strong preference for option 2 - let me know what you think.
regards,
Robert