Launch kotlin runtime gradle build from ant.

Fork ant to build compiler as it requires a lot of memory.
Pass build.number to gradle build.
This commit is contained in:
Ilya Gorbunov
2017-03-29 09:02:15 +03:00
parent 3db1613167
commit df44f3bfe6
3 changed files with 57 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinCompilerVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
<property name="compiler.version.number" value="${build.number}"/>
<property name="compiler.ant.fork.jvmargs" value="-Xmx1024m"/>
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip"/>
+55 -2
View File
@@ -27,11 +27,12 @@
<property name="protobuf.jar" value="${basedir}/dependencies/protobuf-2.6.1.jar"/>
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.6.1-lite.jar"/>
<property name="javax.inject.jar" value="${basedir}/lib/javax.inject.jar"/>
<property name="gradle.logging.level" value=""/>
<property name="java.target" value="1.8"/>
<property name="java.target.1.6" value="1.6"/>
<condition property="bootstrap.or.local.build" value="true">
<condition property="bootstrap.or.local.build" value="true" else="false">
<or>
<istrue value="${bootstrap.build.no.tests}"/>
<not>
@@ -632,6 +633,29 @@
<pack-compiler jarfile="${kotlin-home}/lib/kotlin-compiler.jar" compress="false"/>
</target>
<target name="compiler-fork">
<local name="jvmargs" />
<condition property="jvmargs" value="${compiler.ant.fork.jvmargs}" else="">
<isset property="compiler.ant.fork.jvmargs" />
</condition>
<java classname="org.apache.tools.ant.launch.Launcher"
fork="true"
failonerror="true"
timeout="4000000"
taskname="ant-fork">
<jvmarg line="${jvmargs}" />
<classpath>
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
</classpath>
<arg line="-Dbootstrap.or.local.build=${bootstrap.or.local.build}" />
<arg line="-Dbuild.number=${build.number}" />
<arg line="-f" />
<arg line="build.xml" />
<arg line="compiler" />
</java>
</target>
<target name="compiler">
<cleandir dir="${output}/classes/compiler"/>
@@ -1421,11 +1445,40 @@
</pack-runtime-jar>
</target>
<target name="gradle-runtime">
<local name="deployVersion" />
<condition property="deployVersion" value="" else="-PdeployVersion=${build.number}">
<equals arg1="${build.number}" arg2="snapshot" />
</condition>
<java classname="org.gradle.wrapper.GradleWrapperMain"
fork="true"
dir="${basedir}/libraries"
failonerror="true"
timeout="4000000"
maxmemory="400m"
taskname="gradle-runtime">
<classpath>
<pathelement location="${basedir}/libraries/gradle/wrapper/gradle-wrapper.jar"/>
</classpath>
<arg line="clean" />
<arg line="dist" />
<arg line="publish" />
<arg line="--no-daemon -Dkotlin.daemon.jvm.options=-Xmx700m -Dkotlin.daemon.verbose=true" />
<arg line="${deployVersion}" />
<arg line="${gradle.logging.level}" />
</java>
</target>
<target name="runtime"
depends="builtins,stdlib,kotlin-test,core,reflection,pack-runtime,pack-runtime-sources,script-runtime,mock-runtime-for-test"/>
<target name="dist"
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,allopen-compiler-plugin,noarg-compiler-plugin,sam-with-receiver-compiler-plugin,source-sections-compiler-plugin,annotation-processing-under-jdk8,daemon-client,compiler-client-embeddable,kotlin-build-common-test"
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler-fork,compiler-sources,ant-tools,gradle-runtime,runtime,kotlin-js-stdlib,android-extensions-compiler,allopen-compiler-plugin,noarg-compiler-plugin,sam-with-receiver-compiler-plugin,source-sections-compiler-plugin,annotation-processing-under-jdk8,daemon-client,kotlin-build-common-test"
description="Builds redistributables from sources"/>
<target name="dist-no-fork"
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,ant-tools,gradle-runtime,runtime,kotlin-js-stdlib,android-extensions-compiler,allopen-compiler-plugin,noarg-compiler-plugin,sam-with-receiver-compiler-plugin,source-sections-compiler-plugin,annotation-processing-under-jdk8,daemon-client,compiler-client-embeddable,kotlin-build-common-test"
description="Builds redistributables from sources"/>
<target name="dist-quick"
+1 -1
View File
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = "1.1-SNAPSHOT"
ext.kotlin_version = project.properties["deployVersion"] ?: "1.1-SNAPSHOT"
ext.kotlin_language_version = "1.1"
ext.kotlin_gradle_plugin_version = "1.1.1"