"kotlin-home-setup" - more explicit verification of existing files.
This commit is contained in:
+21
-21
@@ -27,20 +27,13 @@
|
|||||||
<attribute name="type" default="dir"/>
|
<attribute name="type" default="dir"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<if>
|
<if>
|
||||||
<not>
|
<available file="@{file}" type="@{type}"/>
|
||||||
<available file="@{file}" type="@{type}"/>
|
|
||||||
</not>
|
|
||||||
<then>
|
<then>
|
||||||
<if>
|
<echo>[@{file}] of type [@{type}] exists</echo>
|
||||||
<equals arg1="@{type}" arg2="dir"/>
|
|
||||||
<then>
|
|
||||||
<fail message="Directory [@{file}] is not found!"/>
|
|
||||||
</then>
|
|
||||||
<else>
|
|
||||||
<fail message="File [@{file}] is not found!"/>
|
|
||||||
</else>
|
|
||||||
</if>
|
|
||||||
</then>
|
</then>
|
||||||
|
<else>
|
||||||
|
<fail message="[@{file}] of type [@{type}] is not found!"/>
|
||||||
|
</else>
|
||||||
</if>
|
</if>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
@@ -50,29 +43,36 @@
|
|||||||
<macrodef name="kotlin-home-setup">
|
<macrodef name="kotlin-home-setup">
|
||||||
<sequential>
|
<sequential>
|
||||||
<if>
|
<if>
|
||||||
<not>
|
<and>
|
||||||
<available file="${kotlin-home}/lib" type="dir"/>
|
<available file="${kotlin-home}/lib/kotlin-build-tools.jar" type="file"/>
|
||||||
</not>
|
<available file="${kotlin-home}/lib/kotlin-compiler.jar" type="file"/>
|
||||||
|
<available file="${kotlin-home}/lib/kotlin-runtime.jar" type="file"/>
|
||||||
|
</and>
|
||||||
<then>
|
<then>
|
||||||
|
<echo>[${kotlin-home}/lib] jars found, defining "kotlin.classpath"</echo>
|
||||||
|
<path id="kotlin.classpath">
|
||||||
|
<fileset dir = "${kotlin-home}/lib" includes = "*.jar"/>
|
||||||
|
</path>
|
||||||
|
</then>
|
||||||
|
<else>
|
||||||
<!-- Creating and unpacking the distribution archive to make sure it's Ok -->
|
<!-- Creating and unpacking the distribution archive to make sure it's Ok -->
|
||||||
|
<echo>[${kotlin-home}/lib] jars *not* found, creating distribution zip</echo>
|
||||||
|
|
||||||
<antcall target = "zip"/>
|
<antcall target = "zip"/>
|
||||||
<verify-exists file="${output}/${output.name}.zip" type="file"/>
|
<verify-exists file="${output}/${output.name}.zip" type="file"/>
|
||||||
|
|
||||||
<delete dir = "${kotlin-home}" failonerror="true"/>
|
<delete dir = "${kotlin-home}" failonerror="true"/>
|
||||||
<mkdir dir = "${kotlin-home}"/>
|
<mkdir dir = "${kotlin-home}"/>
|
||||||
|
|
||||||
<unzip src = "${output}/${output.name}.zip" dest="${output}"/>
|
<unzip src = "${output}/${output.name}.zip" dest="${output}"/>
|
||||||
|
|
||||||
<verify-exists file="${kotlin-home}/lib"/>
|
<verify-exists file="${kotlin-home}/lib"/>
|
||||||
<verify-exists file="${kotlin-home}/lib/kotlin-build-tools.jar" type="file"/>
|
<verify-exists file="${kotlin-home}/lib/kotlin-build-tools.jar" type="file"/>
|
||||||
|
<verify-exists file="${kotlin-home}/lib/kotlin-compiler.jar" type="file"/>
|
||||||
|
<verify-exists file="${kotlin-home}/lib/kotlin-runtime.jar" type="file"/>
|
||||||
|
|
||||||
<kotlin-home-setup/>
|
<kotlin-home-setup/>
|
||||||
</then>
|
</else>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<path id="kotlin.classpath">
|
|
||||||
<fileset dir = "${kotlin-home}/lib" includes = "*.jar"/>
|
|
||||||
</path>
|
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user