moving embeddable compiler jar creation to libraries/maven, using maven-shade-plugin instead of jarjar; configuring more relocations of 3-party libs
(cherry picked from commit c905770)
This commit is contained in:
@@ -534,16 +534,6 @@
|
||||
<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">
|
||||
|
||||
@@ -21,6 +21,29 @@
|
||||
|
||||
<description>the Kotlin compiler embeddable</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-compiler</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-runtime</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-reflect</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -67,25 +90,75 @@
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<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>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<createDependencyReducedPom>true</createDependencyReducedPom>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:kotlin-runtlime</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/**</exclude>
|
||||
</excludes>
|
||||
<artifact>*:kotlin-reflect</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/**</exclude>
|
||||
</excludes>
|
||||
<artifact>*:kotlin-stdlib</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/**</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.google</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.com.google</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.sampullara</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.com.sampullara</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.apache</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.org.apache</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.jdom</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.org.jdom</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.fusesource</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.org.fusesource</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.picocontainer</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.org.picocontainer</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>jline</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.jline</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>gnu</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.gnu</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>javax.inject</pattern>
|
||||
<shadedPattern>org.jetbrains.kotlin.relocated.javax.inject</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user