Isn't there a conditional compiliation even now, all 6 years later?
Here's the half-baked, basic solution that I use for some of my apps. It isn't updated for VS Code tho.
EDIT…
I don't think it'll work for your use case since it operates before exclusions are processed by the compiler.
No, it *applies* the exclusions, and generates optimized source after applying them. And yes, that means it can end up generating several copies of your source code when you want to export it; worst case, one per device, but it tries to be smart about which devices can share source.
And this is pretty much exactly what it can help with...
Annoyingly close! It still leaves that variable allocation there
So I saw you reported this as an issue, but as I said there, I can't repro your exact problem.
When I run your code through the optimizer, I'm not left with a "message" variable if I pass a literal string to log. If I pass a more complex expression, then yes, it assigns that expression to message.
Version 2.0.26 (just released) has an unused variable cleanup pass that will fix this and many similar issues (whether or not they arose from inlining).
No, it *applies* the exclusions, and generates optimized source after applying them. And yes, that means it can end up generating several copies of your source code when you want to export it; worst case, one per device, but it tries to be smart about which devices can share source.
And this is pretty much exactly what it can help with...
Sorry my bad! That's pretty awesome.
I kind of had the same problem, even though I only got 3 different source directories. But actually it's not that bad, you have the generated release.jungle and from there you can see the source directory being used for each device
But if you just use jungles for different source for different devices, it's clear. Here how do you tell what source is used for a specific device if it's outputting multiple source files to the same place? (overwriting the last one?)
But if you just use jungles for different source for different devices
Thats exactly what it does. It generates a single jungle file that references the correct source files for each device. If you really want to know which files a device references, it's easy to find out. But the whole point is that it doesn't (shouldn't) change the behavior. So the only code you need to look at is the original...
How would you personally handle reproducible builds with this system?
For example, suppose that today you tag a version of an app that you built with your prettier and released to the store, and 3 months later, you need to build that exact version (with identical generated source and output). Presumably the prettier extension would've been updated in the meantime, and the generated source would not be identical to what it used to be.
Would you source control the generated source and skip the prettier process? Or would you rollback to the specific version of the prettier extension that you used to build the app at release time (same idea as using the same version of the SDK that you built with)?