Skip to content

Commit 3526c0a

Browse files
committed
Fix jpms for grpc KRPC-164
1 parent e593385 commit 3526c0a

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

grpc/grpc-core/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ kotlin {
1919

2020
jvmMain {
2121
dependencies {
22-
api(libs.grpc.util)
23-
api(libs.grpc.stub)
24-
api(libs.grpc.protobuf)
25-
api(libs.grpc.kotlin.stub)
26-
api(libs.protobuf.java.util)
27-
api(libs.protobuf.kotlin)
22+
implementation(libs.grpc.util)
23+
implementation(libs.grpc.stub)
24+
implementation(libs.grpc.protobuf)
25+
implementation(libs.grpc.kotlin.stub)
26+
implementation(libs.protobuf.java.util)
27+
implementation(libs.protobuf.kotlin)
2828
}
2929
}
3030
}

jpms-check/build.gradle.kts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import util.targets.hasJavaModule
@@ -11,9 +11,13 @@ plugins {
1111

1212
description = "Internal module for checking JPMS compliance"
1313

14-
tasks.register("generateModuleInfo") {
14+
val excludedProjects = listOf(
15+
"protobuf-plugin",
16+
)
17+
18+
val generateModuleInfo = tasks.register("generateModuleInfo") {
1519
val modules = project.rootProject.subprojects
16-
.filter { it.hasJavaModule }
20+
.filter { it.applicableForCheck() }
1721
.map { it.javaModuleName() }
1822

1923
val moduleInfoPath = project.projectDir.absolutePath + "/src/main/java/module-info.java"
@@ -33,7 +37,7 @@ tasks.register("generateModuleInfo") {
3337
}
3438

3539
tasks.getByName<JavaCompile>("compileJava") {
36-
dependsOn("generateModuleInfo")
40+
dependsOn(generateModuleInfo)
3741

3842
val projectFiles = project.files()
3943
doFirst {
@@ -58,9 +62,13 @@ dependencies {
5862
.joinToString(":", prefix = ":") { segment -> segment.name }
5963

6064
it.plugins.withId("maven-publish") {
61-
if (it.hasJavaModule) {
65+
if (it.applicableForCheck()) {
6266
api(project(dep))
6367
}
6468
}
6569
}
6670
}
71+
72+
private fun Project.applicableForCheck(): Boolean {
73+
return hasJavaModule && name !in excludedProjects
74+
}

0 commit comments

Comments
 (0)