[kpm] Create new :kotlin-gradle-plugin-proto module
This commit is contained in:
committed by
Space
parent
58e2f6d5d7
commit
252c297112
Generated
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProtobufLanguageSettings">
|
||||
<option name="autoConfigEnabled" value="false" />
|
||||
<option name="importPathEntries">
|
||||
<list>
|
||||
<ImportPathEntry>
|
||||
<option name="location" value="file://$PROJECT_DIR$/libraries/tools/kotlin-gradle-plugin-idea-proto/src/main/proto" />
|
||||
</ImportPathEntry>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -366,6 +366,7 @@ val gradlePluginProjects = listOf(
|
||||
":kotlin-gradle-plugin",
|
||||
":kotlin-gradle-plugin-api",
|
||||
":kotlin-gradle-plugin-idea",
|
||||
":kotlin-gradle-plugin-idea-proto",
|
||||
":kotlin-gradle-plugin-kpm-android",
|
||||
":kotlin-allopen",
|
||||
":kotlin-annotation-processing-gradle",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-gradle-plugin-api"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-gradle-plugin-model"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-gradle-plugin-idea"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-gradle-plugin-idea-proto"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-klib-commonizer-api"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-klib-commonizer-embeddable"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-tooling-metadata"/>
|
||||
@@ -1990,6 +1991,12 @@
|
||||
<sha256 value="97d5b2758408690c0dc276238707492a0b6a4d71206311b6c442cdc26c5973ff" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.protobuf" name="protobuf-java" version="3.19.4">
|
||||
<artifact name="protobuf-java-3.19.4.jar">
|
||||
<md5 value="1697b144988cbe6529fd3c4ad56fe882" origin="Generated by Gradle"/>
|
||||
<sha256 value="e8f524c2ad5965aae31b0527bf9d4e3bc19b0dfba8c05aef114fccc7f057c94d" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.protobuf" name="protobuf-java" version="3.4.0">
|
||||
<artifact name="protobuf-java-3.4.0.jar">
|
||||
<md5 value="33a9a7b17ab5daf83705d83348a66ec7" origin="Generated by Gradle"/>
|
||||
@@ -2012,6 +2019,12 @@
|
||||
<sha256 value="4189e0be5ab15cf2330f70b24fbdc75ca37514f188388fce8580ce16a9a68052" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.protobuf" name="protobuf-kotlin" version="3.19.4">
|
||||
<artifact name="protobuf-kotlin-3.19.4.jar">
|
||||
<md5 value="2aa4e1039c44cd3c129aa00ef8a18642" origin="Generated by Gradle"/>
|
||||
<sha256 value="fab3949e39a8ccc9e3284293242679304cd801be263573585e3deab2d798d782" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.protobuf" name="protobuf-parent" version="3.0.0">
|
||||
<artifact name="protobuf-parent-3.0.0.pom">
|
||||
<md5 value="8cda9d62d98036018911591d72426f49" origin="Generated by Gradle"/>
|
||||
|
||||
@@ -15,6 +15,7 @@ if (isSnapshotTest) {
|
||||
repositories {
|
||||
clear()
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +30,8 @@ val incomingClasspath by configurations.creating {
|
||||
|
||||
dependencies {
|
||||
incomingClasspath(kotlin("gradle-plugin-idea", resolvedTestedVersion))
|
||||
incomingClasspath(testFixtures(kotlin("gradle-plugin-idea", resolvedTestedVersion)))
|
||||
incomingClasspath(kotlin("gradle-plugin-idea-proto", resolvedTestedVersion))
|
||||
}
|
||||
|
||||
val syncClasspath by tasks.register<Sync>("syncClasspath") {
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets.all {
|
||||
languageSettings.optIn("org.jetbrains.kotlin.gradle.kpm.idea.InternalKotlinGradlePluginApi")
|
||||
}
|
||||
}
|
||||
|
||||
publish()
|
||||
javadocJar()
|
||||
sourcesJar()
|
||||
|
||||
dependencies {
|
||||
api(project(":kotlin-gradle-plugin-idea"))
|
||||
implementation("com.google.protobuf:protobuf-java:3.19.4")
|
||||
implementation("com.google.protobuf:protobuf-kotlin:3.19.4")
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(testFixtures(project(":kotlin-gradle-plugin-idea")))
|
||||
}
|
||||
|
||||
configureKotlinCompileTasksGradleCompatibility()
|
||||
|
||||
sourceSets.main.configure {
|
||||
java.srcDir("src/generated/java")
|
||||
java.srcDir("src/generated/kotlin")
|
||||
}
|
||||
|
||||
tasks.register<Exec>("protoc") {
|
||||
val protoSources = file("src/main/proto")
|
||||
val javaOutput = file("src/generated/java/")
|
||||
val kotlinOutput = file("src/generated/kotlin/")
|
||||
|
||||
inputs.dir(protoSources)
|
||||
outputs.dir(javaOutput)
|
||||
outputs.dir(kotlinOutput)
|
||||
|
||||
doFirst {
|
||||
javaOutput.deleteRecursively()
|
||||
kotlinOutput.deleteRecursively()
|
||||
javaOutput.mkdirs()
|
||||
kotlinOutput.mkdirs()
|
||||
}
|
||||
|
||||
workingDir(project.projectDir)
|
||||
|
||||
commandLine(
|
||||
*arrayOf(
|
||||
"protoc",
|
||||
"-I=$protoSources",
|
||||
"--java_out=${javaOutput.absolutePath}",
|
||||
"--kotlin_out=${kotlinOutput.absolutePath}"
|
||||
) + protoSources.listFiles().orEmpty()
|
||||
.filter { it.extension == "proto" }
|
||||
.map { it.path },
|
||||
)
|
||||
|
||||
doLast {
|
||||
kotlinOutput.walkTopDown()
|
||||
.filter { it.extension == "kt" }
|
||||
.forEach { file -> file.writeText(file.readText().replace("public", "internal")) }
|
||||
|
||||
javaOutput.walkTopDown()
|
||||
.filter { it.extension == "java" }
|
||||
.forEach { file ->
|
||||
file.writeText(
|
||||
file.readText()
|
||||
.replace("public final class", "final class")
|
||||
.replace("public interface", "interface")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
testImplementation(gradleApi())
|
||||
testImplementation(gradleKotlinDsl())
|
||||
testImplementation(project(":kotlin-gradle-plugin"))
|
||||
testImplementation(project(":kotlin-gradle-statistics"))
|
||||
testImplementation(project(":kotlin-gradle-plugin-idea-proto"))
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
|
||||
testImplementation("org.reflections:reflections:0.10.2") {
|
||||
@@ -28,6 +28,7 @@ dependencies {
|
||||
testFixturesImplementation(gradleApi())
|
||||
testFixturesImplementation(gradleKotlinDsl())
|
||||
testFixturesImplementation(project(":kotlin-tooling-core"))
|
||||
testFixturesImplementation(project(":kotlin-gradle-plugin-idea-proto"))
|
||||
testFixturesImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,7 @@ include ":kotlin-sam-with-receiver-compiler-plugin",
|
||||
":kotlin-project-model",
|
||||
":kotlin-gradle-plugin-api",
|
||||
":kotlin-gradle-plugin-idea",
|
||||
":kotlin-gradle-plugin-idea-proto",
|
||||
":kotlin-gradle-plugin-idea-for-compatibility-tests",
|
||||
":kotlin-gradle-plugin-dsl-codegen",
|
||||
":kotlin-gradle-plugin-npm-versions-codegen",
|
||||
@@ -724,6 +725,7 @@ project(':tools:kotlinp').projectDir = "$rootDir/libraries/tools/kotlinp" as Fil
|
||||
project(':kotlin-project-model').projectDir = "$rootDir/libraries/tools/kotlin-project-model" as File
|
||||
project(':kotlin-gradle-plugin-api').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-api" as File
|
||||
project(':kotlin-gradle-plugin-idea').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-idea" as File
|
||||
project(':kotlin-gradle-plugin-idea-proto').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-idea-proto" as File
|
||||
project(':kotlin-gradle-plugin-idea-for-compatibility-tests').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-idea-for-compatibility-tests" as File
|
||||
project(':kotlin-gradle-plugin-dsl-codegen').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-dsl-codegen" as File
|
||||
project(':kotlin-gradle-plugin-npm-versions-codegen').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-npm-versions-codegen" as File
|
||||
|
||||
Reference in New Issue
Block a user