Ant task - "kotlin.classpath" can be defined with ${kotlin-home} and Ivy (local TeamCity setup used).
This commit is contained in:
+38
-14
@@ -1,11 +1,13 @@
|
|||||||
<project name="build-tools" default="buildToolsJar">
|
<project name="build-tools" default="buildToolsJar" xmlns:ivy="antlib:org.apache.ivy.ant">
|
||||||
|
|
||||||
<property name="tests-dir" location="${output}/ant-test/build-tools-test"/>
|
<property name="tests-dir" location="${output}/ant-test/build-tools-test"/>
|
||||||
<property name="kotlin-home" location="${output}/ant-test/kotlin-home"/>
|
<property name="kotlin-home" location="${output}/ant-test/kotlin-home"/>
|
||||||
<property name="tests-jar" location="${tests-dir}/out.jar"/>
|
<property name="tests-jar" location="${tests-dir}/out.jar"/>
|
||||||
<property name="bootstrap-dir" location="${basedir}/bootstrap.compiler"/>
|
<property name="bootstrap-dir" location="${basedir}/bootstrap.compiler"/>
|
||||||
<property name="junit-jar" location="${basedir}/testlib/lib/junit-4.9.jar"/>
|
<property name="junit-jar" location="${basedir}/testlib/lib/junit-4.9.jar"/>
|
||||||
<property name="failonerror" value="true"/> <!-- Whether invoking compiled classes should file on error -->
|
<property name="failonerror" value="true"/> <!-- Whether invoking compiled classes should file on error -->
|
||||||
|
<property name="use-ivy" value="false"/> <!-- Whether Ivy should be used to define "kotlin.classpath" and <kotlinc> task -->
|
||||||
|
<!-- Override with "-Duse-ivy=true" -->
|
||||||
|
|
||||||
|
|
||||||
<!-- http://ant-contrib.sourceforge.net/tasks/tasks/index.html -->
|
<!-- http://ant-contrib.sourceforge.net/tasks/tasks/index.html -->
|
||||||
@@ -21,17 +23,15 @@
|
|||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
|
||||||
<!-- Creates ${kotlin-home} and defines <kotlin> task -->
|
<!-- Defines "kotlin.classpath" using ${kotlin-home} -->
|
||||||
<macrodef name="define-kotlinc">
|
<macrodef name="kotlin-home-setup">
|
||||||
<sequential>
|
<sequential>
|
||||||
|
|
||||||
<if>
|
<if>
|
||||||
<not>
|
<not>
|
||||||
<available file="${kotlin-home}/lib" type="dir"/>
|
<available file="${kotlin-home}/lib" type="dir"/>
|
||||||
</not>
|
</not>
|
||||||
<then>
|
<then>
|
||||||
<mkdir dir = "${kotlin-home}"/>
|
<mkdir dir = "${kotlin-home}"/>
|
||||||
|
|
||||||
<if>
|
<if>
|
||||||
<available file="${bootstrap-dir}/kotlinc" type="dir"/>
|
<available file="${bootstrap-dir}/kotlinc" type="dir"/>
|
||||||
<then>
|
<then>
|
||||||
@@ -54,21 +54,45 @@
|
|||||||
<mkdir dir="${bootstrap-dir}"/>
|
<mkdir dir="${bootstrap-dir}"/>
|
||||||
<copy file="${output}/${output.name}.zip" todir="${bootstrap-dir}"/>
|
<copy file="${output}/${output.name}.zip" todir="${bootstrap-dir}"/>
|
||||||
<ant antfile="${basedir}/bootstrap.xml"/>
|
<ant antfile="${basedir}/bootstrap.xml"/>
|
||||||
<define-kotlinc/> <!-- Recursive invocation, will use bootstrapped compiler this time -->
|
<kotlin-home-setup/> <!-- Recursive invocation, will use ${bootstrap-dir} this time -->
|
||||||
</else>
|
</else>
|
||||||
</if>
|
</if>
|
||||||
</then>
|
</then>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<taskdef resource = "org/jetbrains/jet/buildtools/ant/antlib.xml">
|
<path id="kotlin.classpath">
|
||||||
|
<fileset dir = "${kotlin-home}/lib" includes = "*.jar"/>
|
||||||
|
</path>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Defines "kotlin.classpath" and <kotlinc> task -->
|
||||||
|
<macrodef name="define-kotlinc">
|
||||||
|
<sequential>
|
||||||
|
<if>
|
||||||
|
<istrue value="${use-ivy}"/>
|
||||||
|
<then>
|
||||||
|
<!-- Defining "kotlin.classpath" with Ivy -->
|
||||||
|
<taskdef uri="antlib:org.apache.ivy.ant" resource="org/apache/ivy/ant/antlib.xml"/>
|
||||||
|
<ivy:configure file="${basedir}/build-tools/ivyconf.xml"/>
|
||||||
|
<ivy:resolve file="${basedir}/build-tools/ivy.xml"/>
|
||||||
|
<ivy:cachepath pathid="kotlin.classpath" organisation="org" revision="latest.lastSuccessful"/>
|
||||||
|
</then>
|
||||||
|
<else>
|
||||||
|
<!-- Defining "kotlin.classpath" with ${kotlin-home} -->
|
||||||
|
<kotlin-home-setup/>
|
||||||
|
</else>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<taskdef resource = "org/jetbrains/jet/buildtools/ant/antlib.xml">
|
||||||
<classpath>
|
<classpath>
|
||||||
<fileset dir = "${kotlin-home}/lib" includes = "*.jar"/>
|
<path refid="kotlin.classpath"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</taskdef>
|
</taskdef>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
|
||||||
<!-- Deletes all previously compiled files -->
|
<!-- Deletes all previously compiled files -->
|
||||||
<macrodef name="cleanup">
|
<macrodef name="cleanup">
|
||||||
<sequential>
|
<sequential>
|
||||||
@@ -154,13 +178,13 @@
|
|||||||
</java>
|
</java>
|
||||||
</then>
|
</then>
|
||||||
<else>
|
<else>
|
||||||
<echo>Running [@{classname}], classpath = "${tests-dir};${kotlin-home}/lib/kotlin-runtime.jar"</echo>
|
<echo>Running [@{classname}], classpath = "${tests-dir}"</echo>
|
||||||
<java outputproperty = "java-out"
|
<java outputproperty = "java-out"
|
||||||
classname = "@{classname}"
|
classname = "@{classname}"
|
||||||
failonerror = "${failonerror}">
|
failonerror = "${failonerror}">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement path = "${tests-dir}"/>
|
<pathelement path = "${tests-dir}"/>
|
||||||
<fileset file = "${kotlin-home}/lib/kotlin-runtime.jar"/>
|
<path refid = "kotlin.classpath"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
<arg line = "@{args}"/>
|
<arg line = "@{args}"/>
|
||||||
</java>
|
</java>
|
||||||
@@ -266,8 +290,8 @@
|
|||||||
|
|
||||||
<path id="junit-classpath">
|
<path id="junit-classpath">
|
||||||
<path refid="junit-jar"/>
|
<path refid="junit-jar"/>
|
||||||
|
<path refid="kotlin.classpath"/>
|
||||||
<pathelement location="@{classpath}"/>
|
<pathelement location="@{classpath}"/>
|
||||||
<pathelement location="${kotlin-home}/lib/kotlin-runtime.jar"/>
|
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<if>
|
<if>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||||
|
<!-- Configuring Ant to work with TeamCity Ivy repo: http://goo.gl/foaTg -->
|
||||||
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||||
|
|
||||||
|
<ivy-module version="1.3">
|
||||||
|
<info organisation="com.jetbrains" module="kotlin"/>
|
||||||
|
<dependencies>
|
||||||
|
<dependency org="org" name="bt2" rev="latest.lastSuccessful">
|
||||||
|
<!-- http://localhost:8111/guestAuth/repository/download/bt2/latest.lastSuccessful/teamcity-ivy.xml -->
|
||||||
|
<include ext="jar" matcher="exactOrRegexp"/>
|
||||||
|
</dependency>
|
||||||
|
<dependency org="org" name="bt343" rev="latest.lastSuccessful">
|
||||||
|
<!-- http://teamcity.jetbrains.com/guestAuth/repository/download/bt343/latest.lastSuccessful/teamcity-ivy.xml -->
|
||||||
|
<include name="core/.*" ext="jar" matcher="exactOrRegexp"/>
|
||||||
|
</dependency>
|
||||||
|
<dependency org="asm" name="asm-util" rev="3.3.1"/>
|
||||||
|
</dependencies>
|
||||||
|
</ivy-module>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||||
|
<!-- Configuring Ant to work with TeamCity Ivy repo: http://goo.gl/foaTg -->
|
||||||
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||||
|
|
||||||
|
<ivysettings>
|
||||||
|
<property name='ivy.checksums' value=''/>
|
||||||
|
<caches defaultCache="${user.home}/.ivy/cache"/>
|
||||||
|
<settings defaultResolver="sonatype-repo"/>
|
||||||
|
<statuses>
|
||||||
|
<status name='integration' integration='true'/>
|
||||||
|
</statuses>
|
||||||
|
<resolvers>
|
||||||
|
<url name="sonatype-repo" m2compatible="true">
|
||||||
|
<artifact pattern="https://oss.sonatype.org/content/repositories/central/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
|
||||||
|
</url>
|
||||||
|
<url name='kotlin-repo' alwaysCheckExactRevision='yes' checkmodified='true'>
|
||||||
|
<ivy pattern='http://localhost:8111/guestAuth/repository/download/[module]/[revision]/teamcity-ivy.xml'/>
|
||||||
|
<artifact pattern='http://localhost:8111/guestAuth/repository/download/[module]/[revision]/[artifact](.[ext])'/>
|
||||||
|
</url>
|
||||||
|
<url name='idea-repo' alwaysCheckExactRevision='yes' checkmodified='true'>
|
||||||
|
<ivy pattern='http://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/teamcity-ivy.xml'/>
|
||||||
|
<artifact pattern='http://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/[artifact](.[ext])'/>
|
||||||
|
</url>
|
||||||
|
</resolvers>
|
||||||
|
<modules>
|
||||||
|
<module organisation='org' name='bt2' matcher='regexp' resolver='kotlin-repo'/>
|
||||||
|
<module organisation='org' name='bt343' matcher='regexp' resolver='idea-repo'/>
|
||||||
|
</modules>
|
||||||
|
</ivysettings>
|
||||||
Reference in New Issue
Block a user