e46c54f514
Don't store binary data in the repository anymore. From now on any test on the compiler requires that 'ant dist' was executed at least once since the last update of the built-ins
628 lines
27 KiB
XML
628 lines
27 KiB
XML
<project name="Kotlin" default="dist">
|
|
|
|
<property file="resources/manifest.properties" />
|
|
|
|
<!-- Set to false to disable proguard run on kotlin-compiler.jar. Speeds up the build -->
|
|
<property name="shrink" value="true"/>
|
|
<!-- Set to false to disable compiler's @NotNull assertions. Speeds up the build -->
|
|
<property name="generate.assertions" value="true"/>
|
|
<!-- Set to false to disable compiler's javadoc generation. Speeds up the build -->
|
|
<property name="generate.javadoc" value="true"/>
|
|
|
|
<property name="bootstrap.home" value="dependencies/bootstrap-compiler"/>
|
|
<property name="bootstrap.compiler.home" value="${bootstrap.home}/Kotlin/kotlinc"/>
|
|
<property name="bootstrap.runtime" value="${bootstrap.compiler.home}/lib/kotlin-runtime.jar"/>
|
|
|
|
<property name="output.relative" value="dist"/>
|
|
<property name="output" value="${basedir}/${output.relative}"/>
|
|
<property name="kotlin-home" value="${output}/kotlinc"/>
|
|
<property name="build.number" value="snapshot"/>
|
|
<property name="output.name" value="kotlin-compiler-${build.number}"/>
|
|
<property name="idea.sdk" value="${basedir}/ideaSDK"/>
|
|
|
|
<property name="java.target" value="1.6"/>
|
|
|
|
<property name="external.annotations.path" value="${basedir}/annotations"/>
|
|
|
|
<property name="dependencies.dir" value="${basedir}/dependencies" />
|
|
|
|
<path id="classpath">
|
|
<file file="${bootstrap.runtime}"/>
|
|
<fileset dir="${idea.sdk}" includes="core/*.jar"/>
|
|
<fileset dir="${idea.sdk}" includes="lib/protobuf-2.5.0.jar"/>
|
|
|
|
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
|
|
<fileset dir="${dependencies.dir}" includes="jline.jar"/>
|
|
<fileset dir="${dependencies.dir}" includes="jansi.jar"/>
|
|
<fileset dir="${dependencies.dir}" includes="cli-parser-1.1.1.jar"/>
|
|
<fileset dir="${basedir}/ideaSDK/jps" includes="jps-model.jar"/>
|
|
</path>
|
|
|
|
<typedef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${bootstrap.compiler.home}/lib/kotlin-ant.jar"/>
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${dependencies.dir}/ant-contrib.jar"/>
|
|
|
|
<taskdef name="javac2" classname="org.apache.tools.ant.taskdefs.Javac"/>
|
|
<if>
|
|
<istrue value="${generate.assertions}"/>
|
|
<then>
|
|
<path id="javac2.classpath">
|
|
<pathelement location="${idea.sdk}/lib/javac2.jar"/>
|
|
<pathelement location="${idea.sdk}/lib/jetbrains-asm-debug-all-4.0.jar"/>
|
|
</path>
|
|
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
|
|
<echo message="Use javac2 from Idea lib"/>
|
|
</then>
|
|
<else>
|
|
<echo message="Use default javac compiler"/>
|
|
</else>
|
|
</if>
|
|
|
|
<dirset id="compilerSources.dirset" dir="${basedir}/">
|
|
<include name="compiler/frontend/src"/>
|
|
<include name="core/descriptors/src"/>
|
|
<include name="compiler/frontend/serialization/src"/>
|
|
<include name="core/descriptor.loader.java/src"/>
|
|
<include name="compiler/frontend.java/src"/>
|
|
<include name="core/serialization.java/src"/>
|
|
<include name="compiler/backend-common/src"/>
|
|
<include name="compiler/backend/src"/>
|
|
<include name="compiler/cli/src"/>
|
|
<include name="compiler/cli/cli-common/src"/>
|
|
<include name="compiler/util/src"/>
|
|
<include name="core/util.runtime/src"/>
|
|
<!--<include name="j2k/src"/>-->
|
|
<include name="compiler/jet.as.java.psi/src"/>
|
|
<include name="compiler/builtins-serializer"/>
|
|
|
|
<include name="js/js.dart-ast/src"/>
|
|
<include name="js/js.translator/src"/>
|
|
</dirset>
|
|
|
|
<property name="idea.out" value="${basedir}/out/production"/>
|
|
<patternset id="compilerClassesFromIDEA.fileset">
|
|
<include name="frontend/**"/>
|
|
<include name="descriptors/**"/>
|
|
<include name="serialization/**"/>
|
|
<include name="descriptor.loader.java/**"/>
|
|
<include name="frontend.java/**"/>
|
|
<include name="serialization.java/**"/>
|
|
<include name="backend/**"/>
|
|
<include name="backend-common/**"/>
|
|
<include name="cli/**"/>
|
|
<include name="cli-common/**"/>
|
|
<include name="util/**"/>
|
|
<include name="util.runtime/**"/>
|
|
<include name="jet.as.java.psi/**"/>
|
|
<include name="builtins-serializer/**"/>
|
|
|
|
<include name="js.dart-ast/**"/>
|
|
<include name="js.translator/**"/>
|
|
</patternset>
|
|
|
|
<path id="compilerSources.path">
|
|
<dirset refid="compilerSources.dirset"/>
|
|
</path>
|
|
|
|
<path id="preloaderSources.path">
|
|
<dirset dir="compiler/preloader/src"/>
|
|
</path>
|
|
|
|
<macrodef name="cleandir">
|
|
<attribute name="dir"/>
|
|
|
|
<sequential>
|
|
<echo message="Cleaning @{dir}"/>
|
|
<delete dir="@{dir}" failonerror="false"/>
|
|
<mkdir dir="@{dir}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="clean">
|
|
<delete dir="${output}"/>
|
|
</target>
|
|
|
|
<target name="init">
|
|
<mkdir dir="${kotlin-home}"/>
|
|
<mkdir dir="${kotlin-home}/lib"/>
|
|
<mkdir dir="${kotlin-home}/lib/tools"/>
|
|
</target>
|
|
|
|
<target name="prepareDist">
|
|
<copy todir="${kotlin-home}/bin">
|
|
<fileset dir="${basedir}/compiler/cli/bin"/>
|
|
</copy>
|
|
<fixcrlf srcdir="${kotlin-home}/bin" excludes="**/*.bat" eol="unix"/>
|
|
|
|
<copy todir="${kotlin-home}/license">
|
|
<fileset dir="${basedir}/license"/>
|
|
</copy>
|
|
|
|
<echo file="${kotlin-home}/build.txt" message="${build.number}"/>
|
|
|
|
<chmod dir="${kotlin-home}/bin" includes="*" perm="755"/>
|
|
</target>
|
|
|
|
<target name="compilerSources">
|
|
<jar jarfile="${output}/kotlin-compiler-sources.jar">
|
|
<!-- TODO How to convert it from pathset or dirset ? -->
|
|
<fileset dir="compiler/frontend/src"/>
|
|
<fileset dir="core/descriptors/src"/>
|
|
<fileset dir="core/descriptor.loader.java/src"/>
|
|
<fileset dir="compiler/frontend.java/src"/>
|
|
<fileset dir="compiler/backend-common/src"/>
|
|
<fileset dir="compiler/backend/src"/>
|
|
<fileset dir="compiler/cli/src"/>
|
|
<fileset dir="j2k/src"/>
|
|
<fileset dir="compiler/util/src"/>
|
|
<fileset dir="core/util.runtime/src"/>
|
|
<fileset dir="compiler/jet.as.java.psi/src"/>
|
|
<fileset dir="compiler/builtins-serializer"/>
|
|
<fileset dir="js/js.dart-ast/src"/>
|
|
<fileset dir="js/js.translator/src"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.sources}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
|
|
<if>
|
|
<istrue value="${generate.javadoc}"/>
|
|
|
|
<then>
|
|
<delete dir="${output}/kotlin-compiler-javadoc" failonerror="false"/>
|
|
<javadoc destdir="${output}/kotlin-compiler-javadoc"
|
|
sourcepathref="compilerSources.path"
|
|
classpathref="classpath"
|
|
linksource="yes"
|
|
windowtitle="${manifest.impl.title.kotlin.compiler}"/>
|
|
<jar jarfile="${output}/kotlin-compiler-javadoc.jar">
|
|
<fileset dir="${output}/kotlin-compiler-javadoc"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.javadoc}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
</then>
|
|
|
|
<else>
|
|
<jar jarfile="${output}/kotlin-compiler-javadoc.jar">
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.javadoc}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
</else>
|
|
</if>
|
|
</target>
|
|
|
|
<target name="jslib">
|
|
<jar jarfile="${kotlin-home}/lib/kotlin-jslib.jar">
|
|
<fileset dir="${basedir}/js/js.libraries/src">
|
|
<include name="core/**"/>
|
|
<include name="jquery/**"/>
|
|
<include name="dom/**"/>
|
|
<include name="html5/**"/>
|
|
<include name="stdlib/TuplesCode.kt"/>
|
|
</fileset>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.javascript.stdlib}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
|
|
<taskdef name="closure-compiler"
|
|
classname="com.google.javascript.jscomp.ant.CompileTask"
|
|
classpath="${dependencies.dir}/closure-compiler.jar" />
|
|
|
|
<closure-compiler
|
|
compilationLevel="simple"
|
|
prettyprint="true"
|
|
languagein="ECMASCRIPT5_STRICT"
|
|
warning="verbose"
|
|
debug="false"
|
|
output="${kotlin-home}/lib/kotlin.js" >
|
|
|
|
<sources dir="${basedir}/js/js.translator/testFiles">
|
|
<file name="kotlin_lib_ecma5.js"/>
|
|
<file name="kotlin_lib.js"/>
|
|
<file name="maps.js"/>
|
|
</sources>
|
|
|
|
</closure-compiler>
|
|
</target>
|
|
|
|
<target name="preloader">
|
|
<cleandir dir="${output}/classes/preloader"/>
|
|
<javac2 destdir="${output}/classes/preloader" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false" source="${java.target}" target="${java.target}">
|
|
<src refid="preloaderSources.path"/>
|
|
</javac2>
|
|
|
|
<jar jarfile="${kotlin-home}/lib/kotlin-preloader.jar">
|
|
<fileset dir="${output}/classes/preloader"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.preloader}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
|
|
<attribute name="Main-Class" value="org.jetbrains.jet.preloading.Preloader"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="builtins">
|
|
<cleandir dir="${output}/builtins"/>
|
|
<java classname="org.jetbrains.jet.utils.builtinsSerializer.BuiltinsSerializerPackage">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<pathelement location="${bootstrap.compiler.home}/lib/kotlin-compiler.jar"/>
|
|
</classpath>
|
|
<arg value="${output}/builtins"/>
|
|
<arg value="core/builtins/native"/>
|
|
<arg value="core/builtins/src"/>
|
|
</java>
|
|
</target>
|
|
|
|
<macrodef name="pack_compiler">
|
|
<attribute name="jarfile"/>
|
|
<attribute name="compress" default="true"/>
|
|
|
|
<sequential>
|
|
<jar jarfile="@{jarfile}" compress="@{compress}">
|
|
<fileset dir="${output}/classes/compiler"/>
|
|
<fileset dir="${output}/builtins" includes="jet/**"/>
|
|
<fileset dir="${basedir}/compiler/frontend.java/src" includes="META-INF/services/**"/>
|
|
|
|
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
|
|
<zipgroupfileset dir="${basedir}/ideaSDK/core" includes="*.jar" excludes="util.jar"/>
|
|
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="jna-utils.jar"/>
|
|
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="oromatcher.jar"/>
|
|
<zipgroupfileset dir="${basedir}/ideaSDK/lib" includes="protobuf-2.5.0.jar"/>
|
|
<zipgroupfileset dir="${basedir}/ideaSDK/jps" includes="jps-model.jar"/>
|
|
<zipgroupfileset dir="${dependencies.dir}" includes="jline.jar"/>
|
|
<zipgroupfileset dir="${dependencies.dir}" includes="cli-parser-1.1.1.jar"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
|
|
<attribute name="Class-Path" value="kotlin-runtime.jar"/>
|
|
<attribute name="Main-Class" value="org.jetbrains.jet.cli.jvm.K2JVMCompiler"/>
|
|
</manifest>
|
|
</jar>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="compiler_quick">
|
|
<delete dir="${output}/classes/compiler"/>
|
|
<copy todir="${output}/classes/compiler">
|
|
<fileset dir="${idea.out}/">
|
|
<patternset refid="compilerClassesFromIDEA.fileset"/>
|
|
</fileset>
|
|
<!-- out/production contains classes under module directories, here we are merging them all into one root-->
|
|
<cutdirsmapper dirs="1"/>
|
|
</copy>
|
|
<delete file="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
|
<pack_compiler jarfile="${kotlin-home}/lib/kotlin-compiler.jar" compress="false"/>
|
|
</target>
|
|
|
|
<target name="compiler">
|
|
<taskdef resource="proguard/ant/task.properties" classpath="${dependencies.dir}/proguard.jar"/>
|
|
|
|
<cleandir dir="${output}/classes/compiler"/>
|
|
|
|
<javac2 destdir="${output}/classes/compiler" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false" source="${java.target}" target="${java.target}">
|
|
<withKotlin externalannotations="${external.annotations.path}"/>
|
|
<src refid="compilerSources.path"/>
|
|
<classpath refid="classpath"/>
|
|
</javac2>
|
|
|
|
<pack_compiler jarfile="${output}/kotlin-compiler-before-shrink.jar"/>
|
|
|
|
<delete file="${kotlin-home}/lib/kotlin-compiler.jar" failonerror="false"/>
|
|
|
|
<if>
|
|
<isfalse value="${shrink}"/>
|
|
|
|
<then>
|
|
<copy file="${output}/kotlin-compiler-before-shrink.jar"
|
|
tofile="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
|
</then>
|
|
|
|
<else>
|
|
<available property="rtjar" value="${java.home}/lib/rt.jar" file="${java.home}/lib/rt.jar"/>
|
|
<available property="rtjar" value="${java.home}/../Classes/classes.jar" file="${java.home}/../Classes/classes.jar"/>
|
|
|
|
<proguard><![CDATA[
|
|
-injars '${output}/kotlin-compiler-before-shrink.jar'(
|
|
!com/thoughtworks/xstream/converters/extended/ISO8601**,
|
|
!com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter**,
|
|
!com/thoughtworks/xstream/io/xml/Dom4J**,
|
|
!com/thoughtworks/xstream/io/xml/Xom**,
|
|
!com/thoughtworks/xstream/io/xml/Wstx**,
|
|
!com/thoughtworks/xstream/io/xml/KXml2**,
|
|
!com/thoughtworks/xstream/io/xml/BEAStax**,
|
|
!com/thoughtworks/xstream/io/json/Jettison**,
|
|
!com/thoughtworks/xstream/mapper/CGLIBMapper**,
|
|
!org/apache/log4j/jmx/Agent*,
|
|
!org/apache/log4j/net/JMS*,
|
|
!org/apache/log4j/net/SMTP*,
|
|
!org/apache/log4j/or/jms/MessageRenderer*,
|
|
!org/jdom/xpath/Jaxen*,
|
|
!org/mozilla/javascript/xml/impl/xmlbeans/**,
|
|
!META-INF/maven**,
|
|
**.class,**.properties,**.kt,**.kotlin_*,
|
|
META-INF/services/**,META-INF/native/**,META-INF/MANIFEST.MF,
|
|
messages/**)
|
|
|
|
-outjars '${kotlin-home}/lib/kotlin-compiler.jar'
|
|
|
|
-dontnote **
|
|
-dontwarn com.intellij.util.ui.IsRetina*
|
|
-dontwarn com.intellij.util.RetinaImage*
|
|
-dontwarn apple.awt.*
|
|
-dontwarn dk.brics.automaton.*
|
|
-dontwarn org.fusesource.**
|
|
-dontwarn org.xerial.snappy.SnappyBundleActivator
|
|
-dontwarn com.intellij.util.CompressionUtil
|
|
-dontwarn com.intellij.util.SnappyInitializer
|
|
-dontwarn net.sf.cglib.**
|
|
-dontwarn org.objectweb.asm.** # this is ASM3, the old version that we do not use
|
|
|
|
-libraryjars '${rtjar}'
|
|
-libraryjars '${bootstrap.runtime}'
|
|
|
|
-target 1.6
|
|
-dontoptimize
|
|
-dontobfuscate
|
|
|
|
-keep class org.fusesource.** { *; }
|
|
-keep class org.jdom.input.JAXPParserFactory { *; }
|
|
|
|
-keep class org.jetbrains.annotations.** {
|
|
public protected *;
|
|
}
|
|
|
|
-keep class org.jetbrains.k2js.** {
|
|
public protected *;
|
|
}
|
|
|
|
-keep class org.jetbrains.jet.** {
|
|
public protected *;
|
|
}
|
|
|
|
-keep class jet.** {
|
|
public protected *;
|
|
}
|
|
|
|
-keep class com.intellij.psi.** {
|
|
public protected *;
|
|
}
|
|
|
|
# for kdoc
|
|
-keep class com.intellij.openapi.util.TextRange { *; }
|
|
|
|
-keepclassmembers enum * {
|
|
public static **[] values();
|
|
public static ** valueOf(java.lang.String);
|
|
}
|
|
|
|
-keepclassmembers class * {
|
|
** toString();
|
|
** hashCode();
|
|
void start();
|
|
void stop();
|
|
void dispose();
|
|
}
|
|
]]></proguard>
|
|
</else>
|
|
</if>
|
|
|
|
<jar jarfile="${output}/kotlin-compiler-for-maven.jar">
|
|
<zipfileset src="${kotlin-home}/lib/kotlin-compiler.jar" includes="**"/>
|
|
<zipfileset src="${bootstrap.runtime}" includes="**" excludes="META-INF/**"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
|
|
<attribute name="Main-Class" value="org.jetbrains.jet.cli.jvm.K2JVMCompiler"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="antTools">
|
|
<cleandir dir="${output}/classes/buildTools"/>
|
|
<javac2 destdir="${output}/classes/buildTools" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false" source="${java.target}" target="${java.target}">
|
|
<withKotlin externalannotations="${external.annotations.path}"/>
|
|
<src>
|
|
<dirset dir="${basedir}/build-tools">
|
|
<include name="core/src"/>
|
|
<include name="ant/src"/>
|
|
</dirset>
|
|
</src>
|
|
<compilerarg value="-Xlint:all"/>
|
|
<classpath>
|
|
<fileset dir="${kotlin-home}/lib" includes="kotlin-compiler.jar"/>
|
|
<file file="${bootstrap.runtime}"/>
|
|
<fileset dir="${dependencies.dir}/ant-1.7/lib" includes="ant.jar"/>
|
|
</classpath>
|
|
</javac2>
|
|
|
|
<jar destfile="${kotlin-home}/lib/kotlin-ant.jar">
|
|
<fileset dir="${output}/classes/buildTools"/>
|
|
<fileset dir="${basedir}/build-tools/ant/src" includes="**/*.xml"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.ant.task}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
|
|
<attribute name="Class-Path" value="kotlin-compiler.jar"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="jdkAnnotations">
|
|
<pack_annotations jarfile="kotlin-jdk-annotations.jar"
|
|
annotationsdir="${basedir}/jdk-annotations"
|
|
title="${manifest.impl.title.kotlin.compiler.annotations.jdk}"/>
|
|
</target>
|
|
|
|
<target name="androidSdkAnnotations">
|
|
<pack_annotations jarfile="kotlin-android-sdk-annotations.jar"
|
|
annotationsdir="${basedir}/android-sdk-annotations"
|
|
title="${manifest.impl.title.kotlin.compiler.annotations.android.sdk}"/>
|
|
</target>
|
|
|
|
<macrodef name="pack_annotations">
|
|
<attribute name="annotationsdir"/>
|
|
<attribute name="jarfile"/>
|
|
<attribute name="title"/>
|
|
|
|
<sequential>
|
|
<jar destfile="${kotlin-home}/lib/@{jarfile}">
|
|
<fileset dir="@{annotationsdir}"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="@{title}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="runtime">
|
|
<cleandir dir="${output}/classes/runtime"/>
|
|
<javac2 destdir="${output}/classes/runtime" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false" source="${java.target}" target="${java.target}">
|
|
<withKotlin/>
|
|
<src path="${basedir}/core/builtins/src"/>
|
|
<src path="${basedir}/core/runtime.jvm/src"/>
|
|
</javac2>
|
|
|
|
<cleandir dir="${output}/classes/stdlib"/>
|
|
<java classname="org.jetbrains.jet.cli.jvm.K2JVMCompiler" failonerror="true" fork="true">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<pathelement location="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
|
</classpath>
|
|
<arg value="-src"/>
|
|
<arg value="${basedir}/libraries/stdlib/src"/>
|
|
<arg value="-output"/>
|
|
<arg value="${output}/classes/stdlib"/>
|
|
<arg value="-noStdlib"/>
|
|
<arg value="-classpath"/>
|
|
<arg value="${output}/classes/runtime"/>
|
|
</java>
|
|
|
|
<jar destfile="${kotlin-home}/lib/kotlin-runtime.jar">
|
|
<fileset dir="${output}/classes/runtime"/>
|
|
<fileset dir="${output}/classes/stdlib"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.jvm.runtime.and.stdlib}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="runtime_sources">
|
|
<jar destfile="${kotlin-home}/lib/kotlin-runtime-sources.jar">
|
|
<fileset dir="${basedir}/core/builtins/native" includes="**/*"/>
|
|
<fileset dir="${basedir}/core/builtins/src" includes="**/*"/>
|
|
<fileset dir="${basedir}/core/runtime.jvm/src" includes="**/*"/>
|
|
<fileset dir="${basedir}/libraries/stdlib/src" includes="**/*"/>
|
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.runtime.and.stdlib.sources}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="j2kConverter">
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${dependencies.dir}/ant-contrib.jar"/>
|
|
|
|
<cleandir dir="${output}/classes/j2k"/>
|
|
|
|
<kotlinc output="${output}/classes/j2k">
|
|
<src path="${basedir}/j2k/src"/>
|
|
<classpath path="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
|
</kotlinc>
|
|
|
|
<jar jarfile="${kotlin-home}/lib/tools/j2k.jar">
|
|
<fileset dir="${output}/classes/j2k" includes="org/jetbrains/jet/j2k/**"/>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
<attribute name="Implementation-Title" value="${manifest.impl.title.java2kotlin.converter}"/>
|
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
|
|
<attribute name="Main-Class" value="org.jetbrains.jet.j2k.JavaToKotlinTranslator"/>
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<!-- builds redistributables from sources -->
|
|
<target name="dist"
|
|
depends="clean,init,prepareDist,preloader,builtins,compiler,compilerSources,antTools,jdkAnnotations,androidSdkAnnotations,runtime,runtime_sources,jslib,j2kConverter"/>
|
|
|
|
<!-- builds everything, but classes are reused from project out dir, doesn't run proguard and javadoc -->
|
|
<target name="dist_quick"
|
|
depends="clean,init,prepareDist,preloader,builtins,compiler_quick,antTools,jdkAnnotations,androidSdkAnnotations,runtime,runtime_sources,jslib,j2kConverter"/>
|
|
|
|
<!-- builds compiler jar from project out dir -->
|
|
<target name="dist_quick_compiler_only"
|
|
depends="init,prepareDist,preloader,builtins,compiler_quick"/>
|
|
|
|
<target name="zip" depends="dist">
|
|
<zip destfile="${output}/${output.name}.zip">
|
|
<zipfileset prefix="kotlinc" dir="${kotlin-home}"/>
|
|
</zip>
|
|
<echo message="##teamcity[publishArtifacts '${output.relative}/${output.name}.zip']"/>
|
|
</target>
|
|
</project>
|