Update publishing and usage of kotlin-annotation-processing plugin

- removed 'kotlin-annotation-processing-gradle' publication as it
duplicated 'kotlin-annotation-processing-embeddable'
- removed 'kotlin-annotation-processing-maven' as it is embedded into
  'kotlin-maven-plugin'. Instead 'kotlin-maven-plugin' now depends on
  'kotlin-annotation-processing' directly.

^KT-52811 In Progress
This commit is contained in:
Yahor Berdnikau
2023-03-21 17:40:10 +01:00
committed by Space Team
parent a58d6fd13a
commit 1eb27f2aac
17 changed files with 31 additions and 200 deletions
@@ -0,0 +1,9 @@
The presence of this file enables the "tools_jar_profile" profile in kotlin-annotation-processing,
which adds "tools.jar" to the compile dependencies.
When Gradle loads this artifact, the "tools_jar_profile" profile should not be activated
(cause it adds an extra dependency from the path based on the environment variable).
It wouldn't in fact because:
1. This file is normally absent when Gradle build with kapt is launched;
2. Gradle poorly supports Maven profiles.
@@ -154,5 +154,27 @@
</property>
</activation>
</profile>
<profile>
<id>tools_jar_profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>kotlin-annotation-processing-maven-build.txt</exists>
</file>
</activation>
<properties>
<toolsjar>${jdk_1_8}/lib/tools.jar</toolsjar>
</properties>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8.0</version>
<scope>system</scope>
<systemPath>${toolsjar}</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
@@ -63,7 +63,7 @@ public class AnnotationProcessingManager {
static {
KAPT_DEPENDENCY.setGroupId("org.jetbrains.kotlin");
KAPT_DEPENDENCY.setArtifactId("kotlin-annotation-processing-maven");
KAPT_DEPENDENCY.setArtifactId("kotlin-annotation-processing");
try {
KAPT_DEPENDENCY.setVersion(getMavenPluginVersion());
}