You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where the Kotlin plugin is applied but there are no main Kotlin sources (only test Kotlin sources). However, applying this module plugin causes the destination directory of compileJava to be changed to that of compileKotlin which breaks my build.
So that during the compilation of module-info.java, the Java compiler sees the packages exported by Kotlin (otherwise, javac complains on the first exports clause, claiming there's no such package).
However, in #99 and #101, we've established that we won't be changing the destination dir of compileJava (or any other task) at all. Instead, we'll add the destination dirs to modulepath (for compilation), or produce a special "merged" dir with outputs (for run/test).
I have a project where the Kotlin plugin is applied but there are no main Kotlin sources (only test Kotlin sources). However, applying this module plugin causes the destination directory of
compileJava
to be changed to that ofcompileKotlin
which breaks my build.The culprit in this plugin resides here:
gradle-modules-plugin/src/main/java/org/javamodularity/moduleplugin/tasks/CompileJavaTaskMutator.java
Lines 44 to 46 in 4014f02
And this is how I worked around this problem in my project:
https://github.com/tlinkowski/tlinkowski-superpom/blob/4a692ac44ba0a78dd838aacdb7055e50112f6dbf/subprojects/my-superpom-gradle-plugin/src/main/kotlin/pl/tlinkowski/gradle/my/superpom/internal/plugin/EagerDestinationDirModificationFixPlugin.kt#L51-L67
To sum up, it seems to me that it'd be safest if this plugin changed the destination dir of
compileJava
only if:compileKotlin
is present (like now), andsrc/main/kotlin
, andmodule-info.java
insrc/main/java
The text was updated successfully, but these errors were encountered: