forked from LWJGL/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-dependencies.xml
83 lines (68 loc) · 3.04 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
82
83
<!--
Copyright LWJGL. All rights reserved.
License terms: http://lwjgl.org/license.php
Downloads LWJGL's library dependencies.
-->
<project name="LWJGL" basedir="." default="update-dependencies">
<property name="config" location="config" relative="true"/>
<import file="${config}/build-definitions.xml" id="defs"/>
<!-- *********************************** -->
<property name="testng" value="6.8.21"/>
<property name="jcommander" value="1.48"/>
<property name="kotlinc-build" value="0.13.599"/>
<!-- *********************************** -->
<target name="-dependencies-uptodate">
<!-- 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"/>
<condition property="dependencies-uptodate">
<and>
<isset property="kotlinc-uptodate"/>
<isset property="lib-uptodate"/>
</and>
</condition>
</target>
<target name="check-dependencies"
description="Updates LWJGL dependencies, if required"
depends="-dependencies-uptodate"
unless="dependencies-uptodate"
>
<antcall target="update-dependencies"/>
</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-build}.zip"/>
<!-- Download new build -->
<get taskname="kotlinc" src="https://teamcity.jetbrains.com/guestAuth/repository/download/bt345/${kotlinc-build}/${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-build}" 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="JCommander" file="${lib}/jcommander.jar"/>
<delete taskname="TestNG" file="${lib}/testng.jar"/>
</target>
</project>