Open T1mL3arn opened 5 years ago
Actually build-test.hxml
is not executed. What happens is dragonbones/git/Main.hx
shadows Main.hx
of your project. I suspect if you move -main Main
above -lib dragonbones
you will get the expected result.
if you move
-main Main
above-lib dragonbones
you will get the expected result.
Didn't work.
Oh. Perhaps it's because of the compiler "plugs in" current directory before the directory of a library.
Try moving Main.hx
to a directory and add that dir via -cp
compiler flag before/after -lib dragonbones
This helped
# build.hxml
-lib dragonbones
-cp src
-main Main
--interp
So, this is not a bug and I should close the issue? In that case would be nice to have some info like "always include your project's source and main directive right after library directives to avoid the problem when library's directory's hxml files affect current project compilation" on this manual page.
This is working as intended with the latest argument taking priority. Should be mentioned on https://haxe.org/manual/compiler-usage.html.
How to reproduce
haxelib git dragonbones https://github.com/openfl/dragonbones.git
(tested for dragonbones, but any other should work, may be non-git libs work too)dragonbones/git
Main.hx
andbuild-test.hxml
files thereclass Main { static function main(){
trace('git library');
} }
Main.hx
andbuild.hxml
in that folderclass Main { static function main() { trace("actual project"); } }
build.hxml
Expected result
Actual result
If
-lib dragonbones
is commented inbuild.hxml
then actual result is equal to expected.Haxe 4.0.0-preview.5+7eb789f54