How to configure haxe build file (HXML) to build from src directory?

1.3k views Asked by At

I'm trying to build a pre-existing HaxePunk project in sublime (switching away from FlashDevelop).

problem: Error: Could not process argument

Here's my .hxml file:

-neko
-cp "c:/path/to/project/src"
-main Main

I've read somewhere that you shouldn't use the /src convention for your src files. That's annoying, since I want assets and binaries in their own directories separate from src files. How do I properly configure this?

1

There are 1 answers

2
Franco Ponticelli On BEST ANSWER

You really should use the the src convention and not stuff everything within the same directory. You also don't want to make the build specific to your machine, so in you example above you don't want an absolute path but a relative one. So try the following:

#content of c:/path/to/project/build.hxml
-neko bin/output.n
-cp src
-main Main

Note that for -cp you use the relative path. The path is relative to where haxe is executed. That usually coincides with where your build.hxml file is, but it is not mandatory.

Also, you didn't specify an output file for neko. Note that you will have to create the directory bin by hand because the compiler will not do that for you and will complain if it doesn't exist.

These information are general and in no way tied with Sublime. Sublime should play just nice with these settings.