Open skerit opened 2 days ago
The Java compiler will inline constants from static final
fields, even across modules. This means that the Blast.main
is compiled to if(true)
by javac
, before TeaVM even sees the classes.
Ah yes, that makes sense. And then TeaVM converts the bytecode to JavaScript.
Is there a more robust alternative to the mapPackageHierarchy
solution? Some kind of gradle plugin?
@skerit what do you mean by "more robust"? What's current solution missing in your opinion?
I've structured a project like this:
server/SpecificBlast.java
:common/Blast.java
:browser/TeaSpecificBlast.java
:And I configured my
teavm.properties
file like this:But whenever I run the generated JavaScript code, it always puts out On server in the console.
When I switch from using static booleans to a static method, like so:
it does work as expected.