Closed lewislepton closed 8 years ago
Can you share your build file?
sure. here it is. as said, it works perfectly with atom and terminal
cheers
build.hxml
-cp src
-main Main
-lib atomic-haxe
What command do you use in the terminal to build this project?
haxe build.hxml
Without output file? Am I missing something?
the building/output is dealt through this package for interacting with atomic https://github.com/rsredsq/atomic-haxe
if you do put the out
-js out/main.js
it pops up with this message
Error: Multiple targets
[Finished in 0.2s with exit code 1]
[cmd: ['haxe', '--connect', '6001', '--cwd', '/Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/Resources', '-js', 'out/main.js', '-cp', 'src', '-main', 'Main', '-lib', 'atomic-haxe']]
[dir: /Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/Resources]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
@clemos, please look at is_valid function.
Can we remove self.target
checking?:
if self.hxml is None and self.yaml is None and self.nmml is None :
It can fix this issue.
The bundle automatically adds the JS target when no target is found, and generates a .js filename when no output is found. We may try to disable this, but it will likely have quite a lot of side effects, because the bundle needs to know the target.
BTW
https://github.com/clemos/haxe-sublime-bundle/blob/master/HaxeComplete.py#L1437
It seems build.target
should be "-" + build.target
.
This definitely won't solve the issue, though.
This issue is very specific to your framework, because the framework defines the build target in extraParams.xml (which we don't parse, so we can't know), and the output files are written using a macro. I wasn't aware one could do that, and honestly I consider it a rather bad practice, which IMHO should be forbidden by the compiler / haxelib. What I'm trying to say is that I believe the best solution would be to consider for your framework to not do such things, so that the corresponding build.hxml would be valid / useable by the bundle.
Also, I haven't tested them, but it seems some build.hxml examples in your repo explicitely define the target and even the output file : https://github.com/rsredsq/atomic-haxe/blob/master/examples/Butterflies/Resources/build.hxml
Do these examples work ?
I would guess they would also fail with Multiple targets
shouldn't they ?
I think removing the check on target
will have a lot of unfortunate side effects.
yeah there are certain things currently being updated from how they were originally. ill actually pass this thread onto the original dev for the package, just so he himself can see what this discorvery has bought.
many thanks
im working with haxe, that then builds to JS. everything was working fine just a few days ago. but every time i now build it pops up with this message
it works completely fine when using atom, or even terminal to build. but sublime it has been giving me this trouble