[BUGFIX] Run Macro Flags when using a local haxelib repository (Move flags to `include.xml`)
Related Issues
Fixes #2004
Description
When compiling a lime project while using a local haxelib repository, the extraParams.hxml in lime is skipped.
This causes AssetsMacro.embedBytes() to never run on haxe.io.Bytes, causing #2004.
To fix this, I have moved those flags over to include.xml.
This is my first PR to here, so let me know if I should do something different in the future!
~~Odd. Looking at the generated hxml files, it generates -cp /path/to/global/Haxelib/lime/8,3,0/src. This implies that, for whatever reason, Lime deliberately bypasses the local repo, and includes the globally-installed copy.~~ Edit: No, that was a quirk of how I tested it. But the below stands.
Normally, haxelib path would include the contents of extraParams.hxml. However, this bypass code evidently does not. I'll see if I can track it down.
Ok, found it. If a path override is defined, it won't call haxelib path. This happens here and here in this case, but can happen for any number of reasons.
https://github.com/openfl/lime/blob/2032404ff659daf5de854a91a51971f1d9f81aaf/src/lime/tools/HXProject.hx#L1240-L1265
Since this can happen to more libraries than just Lime, I think the correct solution is to include extraParams.hxml, not to move the extra params on a case-by-case basis.
Since this can happen to more libraries than just Lime, I think the correct solution is to include extraParams.hxml, not to move the extra params on a case-by-case basis.
Should I edit the PR to do so then? Or should I just close this
Check out #2010 and if that fixes it for you, we can close this one.
Yup that works perfectly, thank you so much!