Why is the SQLDelight compiler plugin 2.1.0 messin...
# squarelibraries
m
Why is the SQLDelight compiler plugin 2.1.0 messing around with my build.gradle.kts file but is not able to properly read it? When I load my .sq file in IntelliJ with the plugin enabled I get an error message saying:
Copy code
JAVA_PACKAGE_HOME must not be null.
This is due to a line in the script like this:
Copy code
val JAVA_PACKAGE_HOME = System.getenv("JAVA_HOME_24_arm64") ?: System.getenv("JAVA_HOME_24_X64") ?: System.getenv("JAVA_HOME_24") ?: System.getenv("JAVA_HOME")
Obviously it is not properly substituting the environment variables where at least the last two are always define. Otherwise the project would not build at all. So my question is: Why is the plugin reading the script at all and why can’t it properly deal with the environment variables? As a workaround I added
?: ""
to the line which seems to avoid the problem. I reported a similar issue already some time ago but it still seems to exist in the latest version. https://github.com/sqldelight/sqldelight/issues/4179#issuecomment-1652274841