forked from LWJGL/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
187 lines (159 loc) · 7.2 KB
/
build.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<project name="LWJGL" basedir="." default="all">
<property name="build.sysclasspath" value="ignore"/>
<import file="config/build-definitions.xml"/>
<!--<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlinc}/kotlin-ant.jar"/>-->
<taskdef resource="testngtasks" classpath="libs/testng.jar"/>
<!-- Initialize build -->
<target name="-initialize" description="Initializes the directories required by the build process.">
<mkdir dir="${lwjgl.bin.core}" taskname="Core"/>
<mkdir dir="${lwjgl.bin.util}" taskname="Utilities"/>
<mkdir dir="${lwjgl.bin.templates}" taskname="Templates"/>
<mkdir dir="${lwjgl.bin.tests}" taskname="Tests"/>
<mkdir dir="${lwjgl.bin.native}" taskname="bin"/>
</target>
<!-- Cleans up any files created during the execution of this script -->
<target name="clean" description="Cleans all directories controlled by this ant script" depends="clean-java, clean-native, clean-generated">
<delete dir="${lwjgl.bin}"/>
</target>
<target name="clean-generated" description="Cleans source files generated by this ant script" depends="clean-generated-java,clean-generated-native">
<!-- We track the generated directory in a separate repo, so don't delete. -->
<!--<delete dir="${lwjgl.generated}"/>-->
</target>
<!-- Cleans up any non-native files created during the execution of this script -->
<target name="clean-java" description="Cleans non-native files generated by this ant script" depends="clean-generated-java">
<!-- Delete java classes only to avoid unnecessary native recompilation -->
<delete dir="${lwjgl.bin.core}"/>
<delete dir="${lwjgl.bin.util}"/>
<delete dir="${lwjgl.bin.templates}"/>
<delete dir="${lwjgl.bin.tests}"/>
</target>
<target name="clean-generated-java" description="Cleans Java source files generated by this ant script">
<delete dir="${lwjgl.generated}/java"/>
</target>
<!-- Useful when we need to force native recompilation -->
<target name="clean-native" description="Cleans native binary files generated by this ant script">
<delete dir="${lwjgl.bin.native}"/>
</target>
<target name="clean-generated-native" description="Cleans native source files generated by this ant script">
<delete dir="${lwjgl.generated}/native"/>
</target>
<target name="all">
<antcall target="compile-templates"/>
<antcall target="tests"/>
</target>
<target name="compile-templates" description="Compiles the Templates module" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}/Templates" encoding="utf8" source="1.6" target="1.6" bootclasspathref="java6.boot.classpath" taskname="Java dependencies compilation">
<src path="${lwjgl.src.templates}"/>
<include name="org/lwjgl/**"/>
</javac>
<java
classname="org.jetbrains.jet.cli.jvm.K2JVMCompiler"
fork="true"
failonerror="true"
taskname="Compiling Templates module"
>
<classpath>
<pathelement path="${kotlinc}/kotlin-compiler.jar"/>
</classpath>
<jvmarg value="-server"/>
<arg value="-module"/>
<arg value="config/Templates.kts"/>
<arg value="-output"/>
<arg value="${lwjgl.bin.templates}"/>
<!--<arg value="-tags"/>-->
<!--<arg value="-noStdlib"/>-->
<!--<arg value="-noJdkAnnotations"/>-->
<!--<arg value="-noJdk"/>-->
</java>
<!--<kotlinc module="config/Templates.kts" jar="${lwjgl.lib}/templates.jar" />-->
</target>
<target name="formatter" description="Runs the template formatter tool" depends="-initialize"> <!-- Removed "compile-templates" until Kotlin adds support for incremental compilation -->
<javac debug="yes" destdir="${lwjgl.bin}/Templates" encoding="utf8" source="1.6" target="1.6" bootclasspathref="java6.boot.classpath" taskname="Java dependencies compilation">
<src path="${lwjgl.src.templates}"/>
<include name="org/lwjgl/**"/>
</javac>
<java
classname="org.lwjgl.generator.util.TemplateFormatter"
fork="true"
spawn="true"
>
<classpath>
<pathelement path="${lwjgl.bin.templates}"/>
<pathelement path="${lwjgl.res}"/>
</classpath>
</java>
</target>
<target name="generate" description="Runs the code Generator" depends="-initialize"> <!-- Removed "compile-templates" until Kotlin adds support for incremental compilation -->
<java
classname="org.lwjgl.generator.GeneratorPackage"
fork="true"
failonerror="true"
taskname="Generating code"
>
<classpath>
<pathelement path="${lwjgl.bin.templates}"/>
<pathelement path="${kotlinc}/kotlin-runtime.jar"/>
</classpath>
<jvmarg value="-server"/>
</java>
</target>
<target name="compile" description="Compiles the Java source code" depends="generate">
<javac debug="yes" destdir="${lwjgl.bin}/Core" encoding="utf8" source="1.6" target="1.6" bootclasspathref="java6.boot.classpath" taskname="Core java compilation" >
<classpath>
<path location="libs\disruptor.jar"/>
</classpath>
<src path="${lwjgl.src.core}"/>
<src path="${lwjgl.src.util}/"/>
<src path="${lwjgl.generated.java}"/>
<include name="org/lwjgl/**"/>
<compilerarg value="-XDignore.symbol.file=true"/> <!-- Supresses internal API (e.g. Unsafe) usage warnings -->
</javac>
</target>
<target name="compile-native" depends="-initialize, compile" description="Compiles the native source code">
<antcall target="-compile_native_linux"/>
<antcall target="-compile_native_macosx"/>
<antcall target="-compile_native_windows"/>
</target>
<target name="-compile_native_linux" if="lwjgl.platform.linux">
<ant antfile="config/linux/build.xml" inheritAll="false"/>
<copy todir="${lwjgl.lib}/linux">
<fileset dir="${lwjgl.bin.native}" includes="liblwjgl*.so"/>
</copy>
</target>
<target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="config/macosx/build.xml" inheritAll="false"/>
<copy todir="${lwjgl.lib}/macosx">
<fileset dir="${lwjgl.bin.native}" includes="liblwjgl*.jnilib"/>
</copy>
</target>
<target name="-compile_native_windows" if="lwjgl.platform.windows">
<ant antfile="config/windows/build.xml" inheritAll="false"/>
<copy todir="${lwjgl.lib}/windows">
<fileset dir="${lwjgl.bin.native}" includes="lwjgl*.dll"/>
</copy>
</target>
<target name="compile-tests" description="Compiles the LWJGL test suite" depends="compile">
<javac debug="yes" destdir="${lwjgl.bin}/Tests" encoding="utf8" source="1.6" target="1.6" bootclasspathref="java6.boot.classpath" taskname="Tests compilation">
<classpath>
<pathelement path="${lwjgl.bin.core}"/>
<pathelement path="${lwjgl.bin.util}"/>
<pathelement path="${lwjgl.lib}/testng.jar"/>
</classpath>
<src path="${lwjgl.src}/tests/"/>
<include name="org/lwjgl/**"/>
</javac>
</target>
<target name="tests" description="Runs the LWJGL test suite" depends="compile-tests, compile-native">
<testng outputDir="${lwjgl.tests.output}" haltOnFailure="true" verbose="2">
<classpath>
<pathelement path="${lwjgl.lib}/jcommander.jar"/>
<pathelement path="${lwjgl.bin.core}"/>
<pathelement path="${lwjgl.bin.util}"/>
<pathelement path="${lwjgl.res}"/>
<pathelement path="${lwjgl.bin.tests}"/>
</classpath>
<xmlfileset dir="config" includes="tests.xml,tests_${lwjgl.platform}.xml"/>
<jvmarg value="-Djava.library.path=${lwjgl.lib.bin}"/>
</testng>
</target>
</project>