-
-
Notifications
You must be signed in to change notification settings - Fork 644
/
update-dependencies.xml
100 lines (83 loc) · 4.99 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!--
~ 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="jspecify" value="1.0.0"/>
<property name="testng" value="7.5"/>
<property name="jcommander" value="1.78"/>
<property name="jquery" value="3.5.1"/>
<property name="slf4j" value="1.7.36"/>
<property name="joml" value="1.10.8"/>
<property name="kotlinc-version" value="2.1.0"/>
<property name="kotlinc-build" value="2.1.0-release-394"/>
<property name="jmh-core" value="1.37"/>
<property name="jmh-generator-annprocess" value="1.37"/>
<property name="jopt-simple" value="5.0.4"/>
<property name="commons-math3" value="3.6.1"/>
<!-- *********************************** -->
<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}">
<taskdef name="logLevel" classname="org.lwjgl.SetLogLevel" classpath="${bin.ant}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${lib}/java"/>
<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="JSpecify" group="org/jspecify" artifact="jspecify" version="${jspecify}"/>
<update-mvn name="TestNG" group="org/testng" artifact="testng" version="${testng}"/>
<update-mvn name="JCommander" group="com/beust" artifact="jcommander" version="${jcommander}" sources="false"/>
<update-mvn name="WebJars - jquery" group="org/webjars" artifact="jquery" version="${jquery}" sources="false"/>
<update-mvn name="SLF4J API" group="org/slf4j" artifact="slf4j-api" version="${slf4j}" sources="false"/>
<update-mvn name="SLF4J JDK14" group="org/slf4j" artifact="slf4j-jdk14" version="${slf4j}" sources="false"/>
<update-mvn name="JOML" group="org/joml" artifact="joml" version="${joml}"/>
<update-mvn name="JMH Core" group="org/openjdk/jmh" artifact="jmh-core" version="${jmh-core}"/>
<update-mvn name="JMH Generators: Annotation Processing" group="org/openjdk/jmh" artifact="jmh-generator-annprocess" version="${jmh-generator-annprocess}" sources="false"/>
<update-mvn name="JOpt Simple" group="net/sf/jopt-simple" artifact="jopt-simple" version="${jopt-simple}" sources="false"/>
<update-mvn name="Apache Commons Math" group="org/apache/commons" artifact="commons-math3" version="${commons-math3}" sources="false"/>
<touch file="${lib}/touch.txt" verbose="false"/>
</target>
<target name="clean" description="Deletes LWJGL dependencies">
<delete taskname="kotlinc" dir="${lib}/kotlinc"/>
<delete taskname="Java dependencies" dir="${lib}/java"/>
</target>
</project>