clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
237 stars 86 forks source link

recent update seems to have knocked building #249

Closed lewislepton closed 8 years ago

lewislepton commented 9 years ago

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

Error: Could not process argument js
Class name must start with uppercase character
[Finished in 0.1s with exit code 1]
[cmd: ['haxe', '--connect', '6001', '--cwd', '/Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/Resources/src', '-cp', '/Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/Resources/src', '--no-output', 'js', '/Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/components.char.player.js']]
[dir: /Users/lepton/Developer/Atomic/OS/PARANOID TASK FORCE/Resources/src]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

it works completely fine when using atom, or even terminal to build. but sublime it has been giving me this trouble

ghost commented 9 years ago

Can you share your build file?

lewislepton commented 9 years ago

sure. here it is. as said, it works perfectly with atom and terminal

cheers

build.hxml

-cp src
-main Main
-lib atomic-haxe
ghost commented 9 years ago

What command do you use in the terminal to build this project?

lewislepton commented 9 years ago

haxe build.hxml

ghost commented 9 years ago

Without output file? Am I missing something?

lewislepton commented 9 years ago

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]
ghost commented 9 years ago

@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.

clemos commented 9 years ago

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 ?

clemos commented 9 years ago

I think removing the check on target will have a lot of unfortunate side effects.

lewislepton commented 9 years ago

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