Overriding NME .hx files inside any project
Closed this issue · 2 comments
In older NME versions I was able to override NME hx files by simply creating "nme" folder inside my project. This feature seems to be broken since NME moved .hx files to new "src" folder. Before this "nme" folder was in the root of NME library.
Maybe I am using older NME tools or because old haxe 3.4.7 can't pickup library files. Hard to say, is it bug or I am doing something wrong. As soon as I move "nme" folder back to root and remove "../src" everywhere in nme tools everything works again.
This it probably due to the order of the -cp <dir name>
commands passed to haxe, which in turn is dependent on the order they are processed by the nme tool and stored in project.classPaths. The "include.nmml" file in haxe adds the "src" to the class path. This must becoming before (or after - the classPath ordering in haxe is odd) the user defines. You can see the order they are added in the verbose logging. The user entries should take preference over the library ones - maybe it is a matter of reversing the project.classPath when building the command line, or somehow demoting the library includes.
One thing you could try is to move your "classPath" command to below the "haxelib nme" command in the nmml. Or, explicitly add "./" to the class path if you are not adding an explicit class path.
One thing you could try is to move your "classPath" command to below the "haxelib nme" command in the nmm
This helped. In my project nmml file I declare classPath after nme library inclusion:
<!--first-->
<ndll name="nme" haxelib="nme"/>
<!--second-->
<classpath name="src" />
Thanks!