I have a classpath folder structure that looks like this:
src
├── client
├── server
└── shared
And I’m trying to create a client.hxml, which only compiles classes in the client and shared folders.
# This I'm assuming is necessary so that packages can be located
# with their full package names
-cp src
--macro include("", true, ["server*"], ["src"])
However building this, it would appear as if the ignore parameter of include() has no effect.
I tested it by making a class in client use a class from the server package, and the whole thing compiled without errors with the server class ending up in the output file. I do not want this to be possible.
The signature of include is include (pack:String, rec:Bool = true, ?ignore:Array<String>, ?classPaths:Array<String>, strict:Bool = false):Void (see haxe.macro.Compiler - Haxe 4.2.1 API)
So if you want to include all from the client and shared packages you can do:
Thank you for the suggestion. I tested it out and unfortunately it didn’t work.
As you can see in the following screenshot, both of the other packages ended up in the compiled output file, despite not being included in the hxml…
Ye the point of it was that I or the editor extension would be prevented from accidentally importing them and giving them as suggestions or putting them in the output.