-
-
Notifications
You must be signed in to change notification settings - Fork 688
Description
It would be nice to have the ability to have a "custom module type" that takes precedence in module resolution.
One concern is the number of lookups. It would be at most 3: .custom.hx, .target.hx and then .hx.
The main use case is building the same app against the same target (or target-agnostic framework such as heaps/openfl/haxeui), but for different devices. The primary concern is UI, so one could for example have SettingsUi.mobile.hx and SettingsUi.desktop.hx.
There are currently two solutions to the above problem:
- Have a
SettingsUiMobile.hxandSettingsUiDesktop.hxand aSettingsUi.hxaliasing one or the other via conditional compilation, which is a bit noisy. - Build mobile with
-cp ./shared -cp ./mobileand desktop with-cp ./shared -cp ./desktop, but that can lead to pretty unpleasant duplication of nested hierarchies.
This is distinct from custom targets in that it's not really compiler target related, but rather gives the user a different layer in the module resolution. It would be used by something like --macro setCustomTargetPlatform("mobile") or more explicitly --macro setCustomModulePostfix("mobile").
It's a bit gimmicky, but it would scratch quite an itch. If anyone sees potential issues or improvements, please come forward ;)