Avoid redefining kotlin2js task in "ant jslib"
This helps to specify custom runtime for the newly built kotlin2js (which is supposed to be different for the two bootstrapping steps). Also now it's not required to launch ant-tools task before jslib to build JS library
This commit is contained in:
@@ -217,24 +217,52 @@
|
|||||||
</if>
|
</if>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile-kotlin-js-stdlib">
|
<macrodef name="new-kotlin2js">
|
||||||
<typedef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin-home}/lib/kotlin-ant.jar"/>
|
<attribute name="output"/>
|
||||||
|
<element name="src"/>
|
||||||
|
|
||||||
|
<sequential>
|
||||||
|
<local name="src.line"/>
|
||||||
|
|
||||||
|
<path id="src.path">
|
||||||
|
<src/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<pathconvert property="src.line" refid="src.path" pathsep=" "/>
|
||||||
|
|
||||||
|
<java classname="org.jetbrains.jet.cli.js.K2JSCompiler" failonerror="true" fork="true">
|
||||||
|
<classpath>
|
||||||
|
<file file="${bootstrap.runtime}"/>
|
||||||
|
<pathelement location="${kotlin-home}/lib/kotlin-compiler.jar"/>
|
||||||
|
</classpath>
|
||||||
|
<assertions>
|
||||||
|
<enable/>
|
||||||
|
</assertions>
|
||||||
|
<arg line="${src.line}"/>
|
||||||
|
<arg value="-output"/>
|
||||||
|
<arg value="@{output}"/>
|
||||||
|
<arg value="-no-stdlib"/>
|
||||||
|
<arg line="-main noCall"/>
|
||||||
|
</java>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
<target name="compile-kotlin-js-stdlib">
|
||||||
<property name="compiled.builtins.js" value="builtins.js"/>
|
<property name="compiled.builtins.js" value="builtins.js"/>
|
||||||
<property name="compiled.stdlib.js" value="stdlib.js"/>
|
<property name="compiled.stdlib.js" value="stdlib.js"/>
|
||||||
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
|
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
|
||||||
|
|
||||||
<kotlin2js output="${output}/${compiled.builtins.js}" noStdlib="true" main="noCall">
|
<new-kotlin2js output="${output}/${compiled.builtins.js}">
|
||||||
<src>
|
<src>
|
||||||
<fileset refid="kotlin.builtin.files"/>
|
<fileset refid="kotlin.builtin.files"/>
|
||||||
</src>
|
</src>
|
||||||
</kotlin2js>
|
</new-kotlin2js>
|
||||||
|
|
||||||
<kotlin2js output="${output}/${compiled.stdlib.js}" noStdlib="true" main="noCall">
|
<new-kotlin2js output="${output}/${compiled.stdlib.js}">
|
||||||
<src>
|
<src>
|
||||||
<resources refid="js.lib.files"/>
|
<resources refid="js.lib.files"/>
|
||||||
</src>
|
</src>
|
||||||
</kotlin2js>
|
</new-kotlin2js>
|
||||||
|
|
||||||
<taskdef name="closure-compiler"
|
<taskdef name="closure-compiler"
|
||||||
classname="com.google.javascript.jscomp.ant.CompileTask"
|
classname="com.google.javascript.jscomp.ant.CompileTask"
|
||||||
|
|||||||
Reference in New Issue
Block a user