forked from LWJGL/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-dependencies.xml
81 lines (65 loc) · 3.46 KB
/
update-dependencies.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--
~ Copyright LWJGL. All rights reserved.
~ License terms: https://www.lwjgl.org/license
-->
<!-- Downloads LWJGL's library dependencies. -->
<project name="LWJGL" basedir="." default="update-dependencies" xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="config" location="config" relative="true"/>
<import file="${config}/build-definitions.xml" id="defs"/>
<!-- *********************************** -->
<property name="testng" value="6.11"/>
<property name="jcommander" value="1.72"/>
<property name="kotlinc-version" value="1.1.4"/>
<property name="kotlinc-build" value="1.1.4"/>
<!-- *********************************** -->
<target name="check-dependencies" description="Updates LWJGL dependencies, if required" unless="${build.offline}">
<!-- Checks if the Kotlin compiler must be updated -->
<local name="kotlinc-build-current"/>
<loadfile property="kotlinc-build-current" srcfile="${kotlinc}/build.txt" quiet="true" taskname="kotlinc"/>
<condition property="kotlinc-uptodate">
<and>
<isset property="kotlinc-build-current"/>
<equals arg1="${kotlinc-build-current}" arg2="${kotlinc-build}"/>
</and>
</condition>
<uptodate property="lib-uptodate" srcfile="update-dependencies.xml" targetfile="${lib}/touch.txt"/>
<local name="dependencies-uptodate"/>
<condition property="dependencies-uptodate">
<and>
<isset property="kotlinc-uptodate"/>
<isset property="lib-uptodate"/>
</and>
</condition>
<antcall target="update-dependencies" unless:set="dependencies-uptodate"/>
</target>
<target name="update-dependencies" description="Updates LWJGL dependencies" unless="${build.offline}">
<mkdir dir="${lib}"/>
<antcall target="-lib-download"/>
<antcall target="-kotlinc-download"/>
</target>
<!-- Downloads and extracts the Kotlin compiler. -->
<target name="-kotlinc-download" unless="kotlinc-uptodate">
<local name="kotlinc-archive"/>
<property name="kotlinc-archive" value="kotlin-compiler-${kotlinc-version}.zip"/>
<!-- Download new build -->
<get taskname="kotlinc" src="https://github.com/JetBrains/kotlin/releases/download/v${kotlinc-version}/${kotlinc-archive}" dest="${lib}" verbose="true"/>
<!-- Delete current build -->
<delete dir="${kotlinc}" taskname="kotlinc"/>
<!-- Extract build -->
<unzip src="${lib}/${kotlinc-archive}" dest="${lib}" taskname="kotlinc"/>
<!-- Delete build archive -->
<delete file="${lib}/${kotlinc-archive}" taskname="kotlinc"/>
<echo message="The Kotlin compiler was updated to build: ${kotlinc-version}" taskname="kotlinc"/>
</target>
<!-- Downloads the Java dependencies. -->
<target name="-lib-download" unless="lib-uptodate">
<update-mvn name="JCommander" group="com/beust" artifact="jcommander" version="${jcommander}" dest="${lib}"/>
<update-mvn name="TestNG" group="org/testng" artifact="testng" version="${testng}" dest="${lib}"/>
<touch file="${lib}/touch.txt" verbose="false"/>
</target>
<target name="clean" description="Deletes LWJGL dependencies">
<delete taskname="kotlinc" dir="${lib}/kotlinc"/>
<delete taskname="JCommander" file="${lib}/jcommander.jar"/>
<delete taskname="TestNG" file="${lib}/testng.jar"/>
</target>
</project>