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>
|
||||
</target>
|
||||
|
||||
<target name="compile-kotlin-js-stdlib">
|
||||
<typedef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin-home}/lib/kotlin-ant.jar"/>
|
||||
<macrodef name="new-kotlin2js">
|
||||
<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.stdlib.js" value="stdlib.js"/>
|
||||
<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>
|
||||
<fileset refid="kotlin.builtin.files"/>
|
||||
</src>
|
||||
</kotlin2js>
|
||||
</new-kotlin2js>
|
||||
|
||||
<kotlin2js output="${output}/${compiled.stdlib.js}" noStdlib="true" main="noCall">
|
||||
<new-kotlin2js output="${output}/${compiled.stdlib.js}">
|
||||
<src>
|
||||
<resources refid="js.lib.files"/>
|
||||
</src>
|
||||
</kotlin2js>
|
||||
</new-kotlin2js>
|
||||
|
||||
<taskdef name="closure-compiler"
|
||||
classname="com.google.javascript.jscomp.ant.CompileTask"
|
||||
|
||||
Reference in New Issue
Block a user