Change sam-with-receiver plugin to use published compiler plugin

- also publish 'kotlin-sam-with-receiver-compiler-plugin-embeddable' to
  be used with 'kotlin-compiler-embeddable'
- 'kotlin-maven-sam-with-receiver' now just adds
  'kotlin-sam-with-receiver-compiler-plugin' as normal dependency
  instead of embedding it into itself

^KT-52811 In Progress
This commit is contained in:
Yahor Berdnikau
2023-03-20 18:02:43 +01:00
committed by Space Team
parent a58266050f
commit 78c94b65b9
6 changed files with 32 additions and 23 deletions
+5
View File
@@ -14,6 +14,7 @@
<trust group="gradle" name="gradle" file="gradle-.*-src[.]zip" regex="true"/>
<trust group="org.jetbrains.kotlin" name="builtins" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-android-extensions" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-annotation-processing-embeddable" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-annotation-processing-gradle" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-build-common" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-compiler-embeddable" version="1.9.[0-9](-.+)?" regex="true"/>
@@ -32,6 +33,8 @@
<trust group="org.jetbrains.kotlin" name="kotlin-project-model" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-reflect" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-sam-with-receiver" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-sam-with-receiver-compiler-plugin" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-sam-with-receiver-compiler-plugin-embeddable" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-script-runtime" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-scripting-common" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-scripting-compiler-embeddable" version="1.9.[0-9](-.+)?" regex="true"/>
@@ -39,6 +42,8 @@
<trust group="org.jetbrains.kotlin" name="kotlin-scripting-jvm" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-serialization" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-serialization-unshaded" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlinx-serialization-compiler-plugin" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlinx-serialization-compiler-plugin-embeddable" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-stdlib" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-stdlib-common" version="1.9.[0-9](-.+)?" regex="true"/>
<trust group="org.jetbrains.kotlin" name="kotlin-stdlib-jdk7" version="1.9.[0-9](-.+)?" regex="true"/>
@@ -5,12 +5,6 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<sam.common.src>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.common/src</sam.common.src>
<sam.k1.src>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.k1/src</sam.k1.src>
<sam.k2.src>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.k2/src</sam.k2.src>
<sam.backend.src>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.backend/src</sam.backend.src>
<sam.cli.src>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.cli/src</sam.cli.src>
<sam.resources>${basedir}/../../../plugins/sam-with-receiver/sam-with-receiver.cli/resources</sam.resources>
<sam.maven.plugin.src>${basedir}/src/main/kotlin</sam.maven.plugin.src>
</properties>
@@ -38,6 +32,11 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-sam-with-receiver-compiler-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
@@ -47,10 +46,6 @@
</dependencies>
<build>
<resources>
<resource><directory>${sam.resources}</directory></resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -61,11 +56,6 @@
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>${sam.common.src}</source>
<source>${sam.k1.src}</source>
<source>${sam.k2.src}</source>
<source>${sam.backend.src}</source>
<source>${sam.cli.src}</source>
<source>${sam.maven.plugin.src}</source>
</sources>
</configuration>
@@ -85,11 +75,6 @@
<goals> <goal>compile</goal> </goals>
</execution>
</executions>
<configuration>
<args>
<arg>-opt-in=org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.plexus</groupId>
@@ -16,8 +16,6 @@ dependencies {
commonCompileOnly(project(":compiler"))
commonCompileOnly(project(":kotlin-sam-with-receiver-compiler-plugin"))
embedded(project(":kotlin-sam-with-receiver-compiler-plugin")) { isTransitive = false }
testImplementation(commonDependency("junit"))
}
@@ -34,7 +34,7 @@ class SamWithReceiverGradleSubplugin
}
companion object {
const val SAM_WITH_RECEIVER_ARTIFACT_NAME = "kotlin-sam-with-receiver"
const val SAM_WITH_RECEIVER_ARTIFACT_NAME = "kotlin-sam-with-receiver-compiler-plugin-embeddable"
private const val ANNOTATION_ARG_NAME = "annotation"
private const val PRESET_ARG_NAME = "preset"
@@ -0,0 +1,19 @@
plugins {
id("org.jetbrains.kotlin.jvm")
}
dependencies {
embedded(project(":kotlin-sam-with-receiver-compiler-plugin")) { isTransitive = false }
}
publish {
artifactId = artifactId.replace(".", "-")
}
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
sourcesJarWithSourcesFromEmbedded(
project(":kotlin-sam-with-receiver-compiler-plugin").tasks.named<Jar>("sourcesJar")
)
javadocJarWithJavadocFromEmbedded(
project(":kotlin-sam-with-receiver-compiler-plugin").tasks.named<Jar>("javadocJar")
)
+2
View File
@@ -141,6 +141,7 @@ include ":kotlin-noarg-compiler-plugin",
":kotlin-noarg-compiler-plugin.cli"
include ":kotlin-sam-with-receiver-compiler-plugin",
":kotlin-sam-with-receiver-compiler-plugin.embeddable",
":kotlin-sam-with-receiver-compiler-plugin.common",
":kotlin-sam-with-receiver-compiler-plugin.k1",
":kotlin-sam-with-receiver-compiler-plugin.k2",
@@ -690,6 +691,7 @@ project(':kotlin-noarg-compiler-plugin.backend').projectDir = "$rootDir/plugins/
project(':kotlin-noarg-compiler-plugin.cli').projectDir = "$rootDir/plugins/noarg/noarg.cli" as File
project(':kotlin-sam-with-receiver-compiler-plugin').projectDir = "$rootDir/plugins/sam-with-receiver" as File
project(':kotlin-sam-with-receiver-compiler-plugin.embeddable').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.embeddable" as File
project(':kotlin-sam-with-receiver-compiler-plugin.common').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.common" as File
project(':kotlin-sam-with-receiver-compiler-plugin.k1').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.k1" as File
project(':kotlin-sam-with-receiver-compiler-plugin.k2').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.k2" as File