Kapt: Gradle plugin for the new kapt
(cherry picked from commit f4fc8f1)
This commit is contained in:
committed by
Yan Zhulanow
parent
399059729d
commit
407af3a0e5
Regular → Executable
+87
-2
@@ -6,6 +6,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
<maven.version>3.0.4</maven.version>
|
||||
<old-kapt.src>${basedir}/src/main/kotlin</old-kapt.src>
|
||||
<annotation-processing.src>${basedir}/../../../plugins/annotation-processing/src</annotation-processing.src>
|
||||
<java-model-wrappers.src>${basedir}/../../../plugins/java-model-wrappers/src</java-model-wrappers.src>
|
||||
<annotation-processing.target-src>${basedir}/target/src/main/kotlin</annotation-processing.target-src>
|
||||
<annotation-processing.target-src-test>${basedir}/target/src/test/kotlin</annotation-processing.target-src-test>
|
||||
<annotation-processing.target-resource>${basedir}/target/resource</annotation-processing.target-resource>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
@@ -33,6 +39,12 @@
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-compiler-embeddable</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>gradle-api</artifactId>
|
||||
@@ -48,15 +60,79 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
<sourceDirectory>${annotation-processing.target-src}</sourceDirectory>
|
||||
<testSourceDirectory>${annotation-processing.target-src-test}</testSourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${annotation-processing.target-resource}</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-sources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${annotation-processing.target-src}</outputDirectory>
|
||||
<resources>
|
||||
<resource><directory>${annotation-processing.src}</directory></resource>
|
||||
<resource><directory>${java-model-wrappers.src}</directory></resource>
|
||||
<resource><directory>${old-kapt.src}</directory></resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${annotation-processing.target-resource}/META-INF</outputDirectory>
|
||||
<resources>
|
||||
<resource><directory>${annotation-processing.src}/META-INF</directory></resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
||||
<artifactId>replacer</artifactId>
|
||||
<version>1.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>replace</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>${annotation-processing.target-src}/**</include>
|
||||
</includes>
|
||||
<replacements>
|
||||
<replacement>
|
||||
<token>com\.intellij</token>
|
||||
<value>org.jetbrains.kotlin.com.intellij</value>
|
||||
</replacement>
|
||||
</replacements>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<jdkHome>${env.JDK_18}</jdkHome>
|
||||
<annotationPaths>
|
||||
<annotationPath>${basedir}/kotlinAnnotation</annotationPath>
|
||||
</annotationPaths>
|
||||
@@ -67,6 +143,11 @@
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals> <goal>compile</goal> </goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${annotation-processing.target-src}</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
@@ -76,6 +157,10 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
|
||||
Reference in New Issue
Block a user