d301938d23
also: proxying previous tasks from TeamCityBuild.xml to gradle, cleaning update_dependencies.xml from ant dependencies
160 lines
6.1 KiB
XML
160 lines
6.1 KiB
XML
<project name="Kotlin CI Steps" default="none">
|
|
<import file="common.xml" optional="false"/>
|
|
<property name="kotlin-home" value="${output}/kotlinc"/>
|
|
|
|
<property name="build.number" value="snapshot"/>
|
|
<property name="fail.on.plugin.verifier.error" value="true"/>
|
|
|
|
<property name="version_substitute_dir" value="${basedir}/versions_temp/"/>
|
|
|
|
<property name="artifact.output.path" value="${basedir}/dist/artifacts/ideaPlugin"/>
|
|
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
|
|
<property name="plugin.xml.bk" value="${version_substitute_dir}/plugin.xml.bk"/>
|
|
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned"/>
|
|
<property name="plugin.xml.version.number" value="${build.number}"/>
|
|
|
|
<property name="compiler.version.java" value="core/util.runtime/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java"/>
|
|
<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"/>
|
|
<property name="pluginArtifactDir" value="Kotlin" />
|
|
|
|
<macrodef name="echoprop">
|
|
<attribute name="prop"/>
|
|
<sequential>
|
|
<echo>@{prop}=${@{prop}}</echo>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<echoprop prop="os.name"/>
|
|
<echoprop prop="os.version"/>
|
|
<echoprop prop="os.arch"/>
|
|
<echoprop prop="java.home"/>
|
|
<echoprop prop="java.vendor"/>
|
|
<echoprop prop="java.version"/>
|
|
<echoprop prop="user.name"/>
|
|
<echoprop prop="user.home"/>
|
|
<echoprop prop="user.dir"/>
|
|
|
|
<macrodef name="run-gradle">
|
|
<attribute name="tasks" />
|
|
<sequential>
|
|
<java classname="org.gradle.wrapper.GradleWrapperMain"
|
|
fork="true"
|
|
dir="${basedir}"
|
|
failonerror="true"
|
|
timeout="4000000"
|
|
maxmemory="400m"
|
|
taskname="gradle">
|
|
<classpath>
|
|
<pathelement location="${basedir}/gradle/wrapper/gradle-wrapper.jar"/>
|
|
</classpath>
|
|
<arg line="--no-daemon" />
|
|
<arg line="@{tasks}" />
|
|
</java>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="cleanupArtifacts">
|
|
<run-gradle tasks="cleanupArtifacts" />
|
|
</target>
|
|
|
|
<target name="zip-compiler">
|
|
<run-gradle tasks="zip-compiler" />
|
|
</target>
|
|
|
|
<target name="zip-test-data">
|
|
<run-gradle tasks="zip-test-data" />
|
|
</target>
|
|
|
|
<target name="writeCompilerVersionToTemplateFile">
|
|
<!-- empty, version is written in gradle build -->
|
|
</target>
|
|
|
|
<target name="writePluginVersionToTemplateFile">
|
|
<run-gradle tasks="writePluginVersionToTemplateFile" />
|
|
</target>
|
|
|
|
<target name="revertTemplateFiles">
|
|
<run-gradle tasks="revertTemplateFiles" />
|
|
</target>
|
|
|
|
<target name="pre_build" depends="writeCompilerVersionToTemplateFile, writePluginVersionToTemplateFile, cleanupArtifacts"/>
|
|
|
|
<target name="zipArtifacts">
|
|
<run-gradle tasks="zipArtifacts" />
|
|
</target>
|
|
|
|
<macrodef name="print-statistic">
|
|
<attribute name="key"/>
|
|
<attribute name="value"/>
|
|
|
|
<sequential>
|
|
<echo message="##teamcity[buildStatisticValue key='@{key}' value='@{value}']"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="print-file-size-statistic">
|
|
<attribute name="path"/>
|
|
<attribute name="file-name"/>
|
|
|
|
<sequential>
|
|
<local name="file.size"/>
|
|
<length file="@{path}/@{file-name}" property="file.size"/>
|
|
<print-statistic key="@{file-name} size" value="${file.size}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="printStatistics">
|
|
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib.jar"/>
|
|
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-reflect.jar"/>
|
|
|
|
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-stdlib-js.jar"/>
|
|
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin.js"/>
|
|
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin-test.js"/>
|
|
<print-file-size-statistic path="${basedir}/libraries/stdlib/js/build/classes/main" file-name="kotlin.meta.js"/>
|
|
</target>
|
|
|
|
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>
|
|
|
|
<target name="none">
|
|
<fail message="Either specify pre_build or post_build"/>
|
|
</target>
|
|
|
|
<property name="teamcity.build.branch" value=""/>
|
|
|
|
<condition property="need.remove.artifacts" value="true">
|
|
<and>
|
|
<matches pattern="rri?/.*" string="${teamcity.build.branch}"/>
|
|
<not>
|
|
<matches pattern="rri?/internal/.*" string="${teamcity.build.branch}"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
|
|
<target name="remove_internal_artifacts"
|
|
description="Remove internal artifacts for rri?/* branches, but store them for rri?/internal/*"
|
|
if="need.remove.artifacts">
|
|
<echo message="Remove internal artifacts" />
|
|
|
|
<delete failonerror="false" verbose="true">
|
|
<fileset dir="dist">
|
|
<include name="kotlin-compiler-before-shrink.jar"/>
|
|
<include name="kotlin-for-upsource.jar"/>
|
|
<include name="kotlin-for-upsource-sources.jar"/>
|
|
<include name="kotlin-test-data.zip"/>
|
|
</fileset>
|
|
<fileset dir="out/artifacts/internal">
|
|
<include name="kotlin-ide-common.jar"/>
|
|
</fileset>
|
|
</delete>
|
|
</target>
|
|
|
|
<target name="dont_remove_internal_artifacts" unless="need.remove.artifacts">
|
|
<echo message="Internal artifacts left untouched"/>
|
|
</target>
|
|
</project>
|