Skip to content

Commit 957148d

Browse files
committed
grpc: Remove JVM Generator related code
Signed-off-by: Johannes Zottele <[email protected]>
1 parent 51862c2 commit 957148d

File tree

39 files changed

+59
-1986
lines changed

39 files changed

+59
-1986
lines changed

gradle-plugin/src/main/kotlin/kotlinx/rpc/buf/BufExtensions.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
package kotlinx.rpc.buf
66

77
import kotlinx.rpc.buf.tasks.BufExecTask
8+
import kotlinx.rpc.proto.ProtocPlugin
89
import org.gradle.api.Action
910
import org.gradle.api.Project
10-
import org.gradle.api.provider.Property
11-
import org.gradle.kotlin.dsl.property
12-
import java.io.File
13-
import javax.inject.Inject
14-
import kotlin.time.Duration
15-
import kotlinx.rpc.proto.ProtocPlugin
1611
import org.gradle.api.model.ObjectFactory
1712
import org.gradle.api.provider.ListProperty
13+
import org.gradle.api.provider.Property
1814
import org.gradle.api.provider.Provider
1915
import org.gradle.kotlin.dsl.listProperty
16+
import org.gradle.kotlin.dsl.property
17+
import java.io.File
18+
import javax.inject.Inject
2019
import kotlin.reflect.KClass
20+
import kotlin.time.Duration
2121

2222
/**
2323
* Options for the Buf tasks.
@@ -100,14 +100,14 @@ public open class BufExtension @Inject constructor(objects: ObjectFactory) {
100100
* Allows registering custom Buf tasks that can operate on the generated workspace.
101101
*/
102102
public open class BufTasksExtension @Inject constructor(internal val project: Project) {
103-
// TODO change to commonMain/commonTest in docs when it's supported KRPC-180
103+
104104
/**
105105
* Registers a custom Buf task that operates on the generated workspace.
106106
*
107107
* Name conventions:
108108
* `lint` input for [name] will result in tasks
109109
* named 'bufLintMain' and 'bufLintTest' for Kotlin/JVM projects
110-
* and 'bufLintJvmMain' and 'bufLintJvmTest' for Kotlin/Multiplatform projects.
110+
* and 'bufLintCommonMain' and 'bufLintCommonTest' for Kotlin/Multiplatform projects.
111111
*
112112
* Note the by default 'test' task doesn't depend on 'main' task.
113113
*/
@@ -127,14 +127,14 @@ public open class BufTasksExtension @Inject constructor(internal val project: Pr
127127
return provider
128128
}
129129

130-
// TODO change to commonMain/commonTest in docs when it's supported KRPC-180
130+
131131
/**
132132
* Registers a custom Buf task that operates on the generated workspace.
133133
*
134134
* Name conventions:
135135
* `lint` input for [name] will result in tasks
136136
* named 'bufLintMain' and 'bufLintTest' for Kotlin/JVM projects
137-
* and 'bufLintJvmMain' and 'bufLintJvmTest' for Kotlin/Multiplatform projects.
137+
* and 'bufLintCommonMain' and 'bufLintCommonTest' for Kotlin/Multiplatform projects.
138138
*
139139
* Note the by default 'test' task doesn't depend on 'main' task.
140140
*/

gradle-plugin/src/main/kotlin/kotlinx/rpc/proto/DefaultProtoSourceSet.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,11 @@ internal fun Project.createProtoExtensions() {
9696
}
9797

9898
project.withKotlinKmpExtension {
99-
findOrCreateAndConfigure("jvmMain", null)
100-
findOrCreateAndConfigure("jvmTest", null)
10199
findOrCreateAndConfigure("commonMain", null)
102100
findOrCreateAndConfigure("commonTest", null)
103101

104102
sourceSets.configureEach {
105-
if (name == "jvmMain" || name == "jvmTest" || name == "commonMain" || name == "commonTest") {
103+
if (name == "commonMain" || name == "commonTest") {
106104
findOrCreateAndConfigure(name, this)
107105
}
108106
}

gradle-plugin/src/test/kotlin/kotlinx/rpc/base/GrpcBaseTest.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,7 @@ import org.gradle.testkit.runner.TaskOutcome
99
import org.intellij.lang.annotations.Language
1010
import org.junit.jupiter.api.TestInstance
1111
import java.nio.file.Path
12-
import kotlin.io.path.ExperimentalPathApi
13-
import kotlin.io.path.absolutePathString
14-
import kotlin.io.path.deleteRecursively
15-
import kotlin.io.path.exists
16-
import kotlin.io.path.extension
17-
import kotlin.io.path.isRegularFile
18-
import kotlin.io.path.pathString
19-
import kotlin.io.path.readLines
20-
import kotlin.io.path.relativeTo
21-
import kotlin.io.path.walk
22-
import kotlin.lazy
12+
import kotlin.io.path.*
2313
import kotlin.test.assertEquals
2414
import kotlin.test.fail
2515

@@ -229,7 +219,7 @@ abstract class GrpcBaseTest : BaseTest() {
229219
}
230220

231221
companion object {
232-
private const val KMP_SOURCE_SET = "jvm"
222+
private const val KMP_SOURCE_SET = "common"
233223
private val KMP_SOURCE_SET_CAPITAL = KMP_SOURCE_SET.replaceFirstChar(Char::uppercaseChar)
234224
private const val KOTLIN_MULTIPLATFORM_DIR = "kotlin-multiplatform"
235225
const val RPC_INTERNAL = "_rpc_internal"

gradle-plugin/src/test/resources/projects/GrpcKmpProjectTest/no_grpc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ plugins {
1111

1212
// should nonetheless be available
1313
protoSourceSets {
14-
jvmMain {}
15-
jvmTest {}
14+
commonMain {}
15+
commonTest {}
1616
}

gradle-plugin/src/test/resources/projects/GrpcKmpProjectTest/no_jvm_targets/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ kotlin {
1616

1717
// should nonetheless be available
1818
protoSourceSets {
19-
jvmMain {}
20-
jvmTest {}
19+
commonMain {}
20+
commonTest {}
2121
}

gradle-plugin/src/test/resources/projects/GrpcKmpProjectTest/with_other_targets/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ kotlin {
1616
}
1717

1818
protoSourceSets {
19-
jvmMain {}
20-
jvmTest {}
19+
commonMain {}
20+
commonTest {}
2121
}
2222

2323
rpc {

0 commit comments

Comments
 (0)