Adding new target - embeddable compiler (after jarjar), using it in the gradle plugin

(cherry picked from commit bf4b26f)
This commit is contained in:
ligee
2015-07-02 15:33:11 +02:00
parent 41f80cde9e
commit d08570b8a8
5 changed files with 104 additions and 2 deletions
+10
View File
@@ -534,6 +534,16 @@
<attribute name="Main-Class" value="org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"/>
</manifest>
</jar>
<delete file="${output}/kotlin-compiler-embeddable.jar" failonerror="false"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="dependencies/jarjar.jar"/>
<jarjar jarfile="${output}/kotlin-compiler-embeddable.jar" filesonly="true" filesetmanifest="merge">
<zipfileset src="${kotlin-home}/lib/kotlin-compiler.jar" includes="**"/>
<zipfileset src="${bootstrap.runtime}" includes="**" excludes="META-INF/**"/>
<zipfileset src="${bootstrap.reflect}" includes="**" excludes="META-INF/**"/>
<rule pattern="com.google.**" result="kotlin.compiler.jvm.internal.impl.com.google.protobuf.@1"/>
<rule pattern="javax.inject.**" result="kotlin.compiler.jvm.internal.impl.javax.inject.@1"/>
</jarjar>
</target>
<target name="android-compiler-plugin">
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-compiler</artifactId>
<artifactId>kotlin-compiler-embeddable</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+1
View File
@@ -72,6 +72,7 @@
<modules>
<module>tools/kotlin-compiler</module>
<module>tools/kotlin-compiler-embeddable</module>
<module>tools/kotlin-jdk-annotations</module>
<module>tools/kotlin-android-sdk-annotations</module>
<module>tools/kotlin-maven-plugin</module>
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<properties>
<maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
<maven.version>3.0.4</maven.version>
</properties>
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>kotlin-compiler-embeddable</artifactId>
<packaging>jar</packaging>
<description>the Kotlin compiler embeddable</description>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>compile</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${kotlin-dist}/kotlin-compiler-sources.jar</file>
<type>jar</type>
<classifier>sources</classifier>
</artifact>
<artifact>
<file>${kotlin-dist}/kotlin-compiler-javadoc.jar</file>
<type>jar</type>
<classifier>javadoc</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
<execution>
<id>attach-empty-javadoc</id>
<phase>prepare-package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<skipAttach>true</skipAttach>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-jar</id>
<phase>compile</phase>
<configuration>
<tasks>
<copy file="${kotlin-dist}/kotlin-compiler-embeddable.jar"
tofile="${basedir}/target/${project.artifactId}-${project.version}.jar"
overwrite="true" verbose="true"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-compiler</artifactId>
<artifactId>kotlin-compiler-embeddable</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>