Closed quintesse closed 11 years ago
Investigating this it turns out that there are a few other situations where we are treating javac
's EXIT_CMDERR
(i.e. bad command line options, only in our case they're the options passed from CeylonCompileTool
) as a bug. My reasoning for classifying this as a bug was that CeylonCompileTool
should be formatting the arguments it passes to Main.compile()
correctly in all cases. Most of those cases are easily fixed by putting suitable checking of options in CeylonCompileTool
(we can actually reuse the same code that Main
uses, so the only real downside to doing this is the runtime cost of having some options checked twice, once by CeylonCompileTool
and once by Main
).
How we're handling the module-name-or-source-file argument is currently a miserable kludge. For example:
.java
or .ceylon
!source
(or other --src
) directory. I think it should be the other way around, or we should only ever look for source files contained in --src
directories, and ignore source files in the cwd.or we should only ever look for source files contained in --src directories, and ignore source files in the cwd
Stef will remove your balls with an escargot fork if you do that :)
Source files relative to the cwd take precedence over same named source files in the source (or other --src) directory. I think it should be the other way around, or we should only ever look for source files contained in --src directories, and ignore source files in the cwd.
User-specified source files are ALWAYS relative to cwd, never to source dirs. Otherwise there's no completion possible. As far as I know, ATM we don't resolve files relative to source dirs, we only use those for compilation of specified modules, and for looking up the package names from the specified files.
If there are two source directories each containing a source file with the same name relative to its containing source directory, the first one wins. I think we should either detect + reject this case (e.g. it will lead to confusing stacktraces), or we should compile both source files.
This is actually a feature when the user specifies specific files, because you may want to have multiple versions of the same file in different source folder and only compile the ones you pick.
Now, we could detect this in the case of specifying modules, because then the files are auto-scanned, but this is very cosmetic ATM and can wait in another issue until the more urgent stuff is done.
Fixed
when I type something like "ceylon compile mymodule 3", where "3" is just a number I typed by accident I get:
ceylon compile: invalid flag: 2 Usage: ceylon compile
etc etc