Add preprocessed JVM stdlib sources as common sources

This commit is contained in:
Ilya Gorbunov
2016-12-15 20:30:23 +03:00
parent 88a14056b7
commit 4f2593fb99
+30 -2
View File
@@ -16,6 +16,7 @@
<properties> <properties>
<kotlin-home>${kotlin-dist}/kotlinc</kotlin-home> <kotlin-home>${kotlin-dist}/kotlinc</kotlin-home>
<pp-profile>JS</pp-profile>
</properties> </properties>
<build> <build>
@@ -28,6 +29,33 @@
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version> <version>1.7</version>
<executions> <executions>
<execution>
<id>common-sources</id>
<phase>process-sources</phase>
<configuration>
<target>
<delete dir="${basedir}/target/common-sources" failonerror="false"/>
<mkdir dir="${basedir}/target/common-sources"/>
<java classname="org.jetbrains.kotlin.preloading.Preloader" failonerror="true" fork="true">
<classpath>
<pathelement location="${kotlin-home}/lib/kotlin-preloader.jar"/>
</classpath>
<assertions>
<enable/>
</assertions>
<arg value="-cp"/>
<arg value="${kotlin-home}/lib/kotlin-compiler.jar"/>
<arg value="org.jetbrains.kotlin.preprocessor.PreprocessorCLI"/>
<arg value="${basedir}/../src/kotlin"/>
<arg value="${basedir}/target/common-sources"/>
<arg value="${pp-profile}"/>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution> <execution>
<id>serialize-declarations</id> <id>serialize-declarations</id>
<phase>compile</phase> <phase>compile</phase>
@@ -41,8 +69,8 @@
<path id="src.path"> <path id="src.path">
<union> <union>
<fileset dir="${basedir}/../src/kotlin"> <fileset dir="${basedir}/target/common-sources">
<include name="internal/Annotations.kt" /> <include name="**/*.kt" />
</fileset> </fileset>
<fileset dir="${basedir}/src"> <fileset dir="${basedir}/src">