Skip to content

Commit 42bb869

Browse files
committed
Fix multiplatform artifact module-info.java
1 parent 243b2f7 commit 42bb869

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

multiplatform-annotations/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ kotlin {
7979
// from https://github.com/Kotlin/kotlinx-datetime/blob/bc8adee2b9e3659e8e1c38fc09f3a4a1bdf85276/core/build.gradle.kts
8080
tasks {
8181
val compileJavaModuleInfo by registering(JavaCompile::class) {
82-
val moduleName = "org.jetbrains.annotations.multiplatform" // this module's name
82+
val moduleName = "org.jetbrains.annotations" // this module's name
8383
val compileKotlinJvm by getting(KotlinCompile::class)
84+
val compileJava by getting(JavaCompile::class)
8485
val sourceDir = file("src/jvmMain/moduleInfo/")
85-
println("sourceDir: $sourceDir")
8686
val targetDir = compileKotlinJvm.destinationDirectory.map { it.dir("../moduleInfo/") }
87-
println("targetDir: $targetDir")
8887

8988
// Use a Java 11 compiler for the module info.
9089
javaCompiler.set(project.javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(11)) })
9190

92-
// Always compile kotlin classes before the module descriptor.
91+
// Always compile kotlin and java classes before the module descriptor.
9392
dependsOn(compileKotlinJvm)
93+
dependsOn(compileJava)
9494

9595
// Add the module-info source file.
9696
source(sourceDir)
@@ -111,7 +111,7 @@ tasks {
111111
options.compilerArgs.add("-Xlint:-requires-transitive-automatic")
112112

113113
// Patch the compileKotlinJvm output classes into the compilation so exporting packages works correctly.
114-
options.compilerArgs.addAll(listOf("--patch-module", "$moduleName=${compileKotlinJvm.destinationDirectory.get()}"))
114+
options.compilerArgs.addAll(listOf("--patch-module", "$moduleName=${compileJava.destinationDirectory.get()}"))
115115

116116
// Use the classpath of the compileKotlinJvm task.
117117
// Also ensure that the module path is used instead of classpath.

multiplatform-annotations/src/jvmMain/moduleInfo/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
module org.jetbrains.annotations.multiplatform {
16+
module org.jetbrains.annotations {
1717
requires static java.desktop;
1818
exports org.intellij.lang.annotations;
1919
exports org.jetbrains.annotations;

0 commit comments

Comments
 (0)