aboutsummaryrefslogtreecommitdiffstats
path: root/make/jogamp-env.xml
blob: c3946b017388a413dbe537383d711afacefb3c3c (plain)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<?xml version="1.0" encoding="UTF-8"?>

<!-- Current runtime requirements are:
        - Java 1.8 (Level 8.0)
        - Android SDK API level 24 (Version 7.0 Nougat, released August 2016)

     Official production builds are performed _for_ Java 1.8.
        - Java 1.8 (Level 8.0)
        - Android SDK API level 24 (Version 7.0 Nougat, released August 2016)

     Official production builds are performed _on_ OpenJDK 11 or 17
     and a Java JDK 11 or greater is required!

     Target Java 8 baseline is chosen today, June 2019, 
     since OpenJDK 1.8 is well supported on desktop, 
     mobile support is given w/ OpenJDK 9 and 
     Android also support these language features for almost 3 years.

     +++
     
     Android 7.0 Nougat, API level 24 supports Java 1.8, 
     see <https://developer.android.com/studio/write/java8-support>.

     However, we need to set the APK's manifest SDK min version to 21 (Android 5)
     and target version to 28 (Android 9), as required as of 2019-08-01
     <https://support.google.com/googleplay/android-developer/answer/113469#targetsdk>

         <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>

     Due to certain libc compatibility issues of Android API > 22,
     we compile certain native libraries @ API 22,
     see <https://github.com/android/ndk/issues/964>.
     One example is OpenAL-Soft.

     It is strongly recommended to test with the x86 emulator
     using the latest API level. 
     On 2019-12-25 we have tested using Android 10, API 29 on the x86 emulator.

     Further testing should be performed from Android 5, API 21, to Android 9, API 28,
     as well as on aarch64 and armv7a devices.

     +++

     For crosscompilation the following shall be set:
     - TARGET_PLATFORM_SYSROOT Crosscompiler and system specified 'sysroot' (as in gcc \-\-print-sysroot)
     - TARGET_PLATFORM_USRROOT Additional optional user headers and libraries for target
     - TARGET_PLATFORM_USRLIBS Actual location of target user libraries within TARGET_PLATFORM_USRROOT
     - TARGET_JAVA_LIBS Actual location of the Java libraries within TARGET_PLATFORM_USRROOT
  -->

<project name="jogamp-env" basedir=".">

  <target name="jogamp.env.validation">
    <echo message="ant.version                ${ant.version}"/>
    <echo message="ant.java.version           ${ant.java.version}"/>
    <echo message="java.version               ${java.version}"/>
    <echo message="java.home                  ${java.home}"/>

    <property name="jvmJava.exe" value="${java.home}/bin/java" /> <!-- the java jvm executable for unit tests -->
    <echo message="jvmJava.exe                ${jvmJava.exe}"/>

    <condition property="jvmJava8.exe" value="${env.JAVA8_EXE}">
        <not>
         <equals arg1="${env.JAVA8_EXE}" arg2="$${env.JAVA8_EXE}" casesensitive="true" />
        </not>
    </condition>
    <echo message="jvmJava8.exe               ${jvmJava8.exe}"/> <!-- optional extra Java8 JVM for unit tests -->

    <fail message="Please build using Ant 1.8.0 or higher.">
      <condition>
          <not>
              <antversion atleast="1.8.0"/>
          </not>
      </condition>
    </fail>

    <condition property="minJava21" value="true">
        <or>
            <equals arg1="${ant.java.version}" arg2="21"/>
            <equals arg1="${ant.java.version}" arg2="22"/>
            <equals arg1="${ant.java.version}" arg2="23"/>
            <equals arg1="${ant.java.version}" arg2="24"/>
            <equals arg1="${ant.java.version}" arg2="25"/>
            <equals arg1="${ant.java.version}" arg2="26"/>
            <equals arg1="${ant.java.version}" arg2="27"/>
            <equals arg1="${ant.java.version}" arg2="28"/>
        </or>
    </condition>
    <echo message="minJava21                  ${minJava21}"/> 

    <condition property="minJava17" value="true">
        <or>
            <equals arg1="${ant.java.version}" arg2="17"/>
            <equals arg1="${ant.java.version}" arg2="18"/>
            <equals arg1="${ant.java.version}" arg2="19"/>
            <equals arg1="${ant.java.version}" arg2="20"/>
            <istrue value="${minJava21}"/>
        </or>
    </condition>
    <echo message="minJava17                  ${minJava17}"/> 

    <condition property="minJava11" value="true">
        <or>
            <equals arg1="${ant.java.version}" arg2="11"/>
            <equals arg1="${ant.java.version}" arg2="12"/>
            <equals arg1="${ant.java.version}" arg2="13"/>
            <equals arg1="${ant.java.version}" arg2="14"/>
            <equals arg1="${ant.java.version}" arg2="15"/>
            <equals arg1="${ant.java.version}" arg2="16"/>
            <istrue value="${minJava17}"/>
        </or>
    </condition>
    <echo message="minJava11                  ${minJava11}"/> 

    <condition property="minJava9" value="true">
        <or>
            <equals arg1="${ant.java.version}" arg2="9"/>
            <istrue value="${minJava11}"/>
        </or>
    </condition>
    <echo message="minJava9                   ${minJava9}"/> 

    <condition property="minJava8" value="true">
        <or>
            <equals arg1="${ant.java.version}" arg2="1.8"/>
            <istrue value="${minJava9}"/>
        </or>
    </condition>
    <echo message="minJava8                   ${minJava8}"/> 

    <!-- Only for junit runtime tests Java [8-10] is allowed, for building Java 11 is required. -->
    <fail message="Unsupported Java version: ${ant.java.version}. Make sure that the version of Java is 1.8 or greater.">
        <condition>
            <not>
                <istrue value="${minJava8}"/>
            </not>
        </condition>
    </fail>

  </target>

  <target name="jogamp.env.init" depends="jogamp.env.validation">
    <property environment="env" />

    <tstamp>
        <format property="version.timestamp" pattern="yyyyMMdd"/>
    </tstamp>

    <condition property="javadoc.xarg1" value="-Xdoclint:none" else="-J-Ddummy=val">
        <istrue value="${minJava8}"/>
    </condition>
    <echo message="javadoc.xarg1              ${javadoc.xarg1}"/>

    <condition property="jogamp.jar.codebase" value="${env.JOGAMP_JAR_CODEBASE}">
        <not>
         <equals arg1="${env.JOGAMP_JAR_CODEBASE}" arg2="$${env.JOGAMP_JAR_CODEBASE}" casesensitive="true" />
        </not>
    </condition>
    <property name="jogamp.jar.codebase"      value=""/> <!-- A jogamp build uses value "Codebase: *.jogamp.org" -->
    <echo message="jogamp.jar.codebase        ${jogamp.jar.codebase}"/>

    <property name="jogamp.version.major" value="2"/>
    <property name="jogamp.version.minor" value="4"/>
    <property name="jogamp.version.submi" value="0"/>
    <property name="jogamp.version.devel" value="-rc-${version.timestamp}"/> <!-- Devel RC Tag -->
    <!-- property name="jogamp.version.devel" value=""/ --> <!-- Release tag -->
    <property name="jogamp.version.base"  value="${jogamp.version.major}.${jogamp.version.minor}"/>
    <property name="jogamp.version"       value="${jogamp.version.base}.${jogamp.version.submi}${jogamp.version.devel}" />
    <echo message="jogamp.version             ${jogamp.version}"/>

    <!-- This is the Android version: xxyyzzz, xx=API yy screen-from-to zzz app-version-->
    <property name="jogamp.version.int"   value="2414020"/>
    <echo message="jogamp.version.int         ${jogamp.version.int}"/>

    <!-- only set 'junit.is.disabled' if set in environment as 'true' to disable JUNIT tests -->
    <condition property="junit.is.disabled" value="${env.JUNIT_DISABLED}">
        <istrue value="${env.JUNIT_DISABLED}"/>
    </condition>
    <echo message="junit.is.disabled          ${junit.is.disabled}"/>

    <condition property="junit.run.arg0" value="${env.JUNIT_RUN_ARG0}">
        <not>
         <equals arg1="${env.JUNIT_RUN_ARG0}" arg2="$${env.JUNIT_RUN_ARG0}" casesensitive="true" />
        </not>
    </condition>
    <property name="junit.run.arg0"       value="-Djunit.run.arg0=dummy" />      <!-- default dummy values -->
    <condition property="junit.run.arg1" value="${env.JUNIT_RUN_ARG1}">
        <not>
         <equals arg1="${env.JUNIT_RUN_ARG1}" arg2="$${env.JUNIT_RUN_ARG1}" casesensitive="true" />
        </not>
    </condition>
    <property name="junit.run.arg1"       value="-Djunit.run.arg1=dummy" />      <!-- default dummy values -->

    <!-- only set 'build.archiveon' if set in environment as 'true' to trigger archive creation -->
    <condition property="build.archiveon" value="${env.BUILD_ARCHIVE}">
        <istrue value="${env.BUILD_ARCHIVE}"/>
    </condition>

    <condition property="build.node.name" value="${env.NODE_NAME}" else="local">
        <not>
         <equals arg1="${env.NODE_NAME}" arg2="$${env.NODE_NAME}" casesensitive="true" />
        </not>
    </condition>

    <condition property="android.api.level" value="${env.ANDROID_API_LEVEL}" else="24">
        <not>
         <equals arg1="${env.ANDROID_API_LEVEL}" arg2="$${env.ANDROID_API_LEVEL}" casesensitive="true" />
        </not>
    </condition>

    <condition property="target.sourcelevel" value="${env.SOURCE_LEVEL}">
        <not>
         <equals arg1="${env.SOURCE_LEVEL}" arg2="$${env.SOURCE_LEVEL}" casesensitive="true" />
        </not>
    </condition>

    <condition property="target.targetlevel" value="${env.TARGET_LEVEL}">
        <not>
         <equals arg1="${env.TARGET_LEVEL}" arg2="$${env.TARGET_LEVEL}" casesensitive="true" />
        </not>
    </condition>

    <condition property="target.releaselevel" value="${env.RELEASE_LEVEL}">
        <not>
         <equals arg1="${env.RELEASE_LEVEL}" arg2="$${env.RELEASE_LEVEL}" casesensitive="true" />
        </not>
    </condition>

    <condition property="target.rt.jar" value="${env.TARGET_RT_JAR}">
        <not>
         <equals arg1="${env.TARGET_RT_JAR}" arg2="$${env.TARGET_RT_JAR}" casesensitive="true" />
        </not>
    </condition>

    <condition property="target.user.set" value="true">
          <and>
              <isset property="target.sourcelevel"/>
              <isset property="target.targetlevel"/>
              <!-- isset property="target.releaselevel"/ -->
              <isset property="target.rt.jar"/>
          </and>
    </condition>
    <echo message="target.user.set            ${target.user.set}"/>
    <echo message="target.sourcelevel         ${target.sourcelevel}"/>
    <echo message="target.targetlevel         ${target.targetlevel}"/>
    <echo message="target.releaselevel        ${target.releaselevel}"/>
    <echo message="target.rt.jar              ${target.rt.jar}"/>

    <fail message="You need to specify all properties 'target.sourcelevel', 'target.targetlevel' and 'target.rt.jar'.">
      <condition>
        <not>
          <istrue value="${target.user.set}"/> 
        </not>
      </condition>
    </fail>

    <fail message="Unsupported Target Java sourcelevel: ${target.sourcelevel}. Make sure that the sourcelevel is set to 1.8 (8.0).">
        <condition>
            <not>
                <or>
                    <contains string="${target.sourcelevel}" substring="1.8" casesensitive="false" />
                    <contains string="${target.sourcelevel}" substring="8" casesensitive="false" />
                </or>
            </not>
        </condition>
    </fail>
    <fail message="Unsupported Target Java targetlevel: ${target.targetlevel}. Make sure that the targetlevel is set to 1.8 (8.0).">
        <condition>
            <not>
                <or>
                    <contains string="${target.targetlevel}" substring="1.8" casesensitive="false" />
                    <contains string="${target.targetlevel}" substring="8" casesensitive="false" />
                </or>
            </not>
        </condition>
    </fail>
    <!-- fail message="Unsupported Target Java releaselevel: ${target.releaselevel}. Make sure that the releaselevel is set to 8.">
        <condition>
            <not>
                <or>
                    <contains string="${target.releaselevel}" substring="8" casesensitive="false" />
                </or>
            </not>
        </condition>
    </fail -->

    <property name="javacdebug"       value="true" /> 
    <property name="javacdebuglevel"  value="source,lines" /> 
    <!--property name="javacdebuglevel"  value="source,lines,vars" /--> 
    <!-- property name="javac.memorymax"  value="128m" /-->  <!-- I ran out of memory with these .. linux x86_64 6u14 -->
    <property name="javac.memorymax"  value="1024m" /> 

    <echo message="javacdebug                 ${javacdebug}"/>
    <echo message="javacdebuglevel            ${javacdebuglevel}"/>
    <echo message="javac.memorymax            ${javac.memorymax}"/>

    <echo message="build.archiveon            ${build.archiveon}"/>
    <echo message="build.node.name            ${build.node.name}"/>

    <echo message="android.api.level          ${android.api.level}"/>

    <echo message="junit.run.arg0             ${junit.run.arg0}"/>
    <echo message="junit.run.arg1             ${junit.run.arg1}"/>

    <condition property="macosx.sdkroot" value="${env.SDKROOT}">
        <not>
         <equals arg1="${env.SDKROOT}" arg2="$${env.SDKROOT}" casesensitive="true" />
        </not>
    </condition>
    <echo message="macosx.sdkroot             ${macosx.sdkroot}"/>

    <condition property="TARGET_PLATFORM_SYSROOT" value="${env.TARGET_PLATFORM_SYSROOT}">
        <not>
         <equals arg1="${env.TARGET_PLATFORM_SYSROOT}" arg2="$${env.TARGET_PLATFORM_SYSROOT}" casesensitive="true" />
        </not>
    </condition>
    <condition property="TARGET_PLATFORM_USRROOT" value="${env.TARGET_PLATFORM_USRROOT}">
        <not>
         <equals arg1="${env.TARGET_PLATFORM_USRROOT}" arg2="$${env.TARGET_PLATFORM_USRROOT}" casesensitive="true" />
        </not>
    </condition>
    <condition property="TARGET_PLATFORM_USRLIBS" value="${env.TARGET_PLATFORM_USRLIBS}">
        <not>
         <equals arg1="${env.TARGET_PLATFORM_USRLIBS}" arg2="$${env.TARGET_PLATFORM_USRLIBS}" casesensitive="true" />
        </not>
    </condition>
    <condition property="TARGET_JAVA_LIBS" value="${env.TARGET_JAVA_LIBS}">
        <not>
         <equals arg1="${env.TARGET_JAVA_LIBS}" arg2="$${env.TARGET_JAVA_LIBS}" casesensitive="true" />
        </not>
    </condition>
    <echo message='TARGET_PLATFORM_SYSROOT ${TARGET_PLATFORM_SYSROOT}'/>
    <echo message='TARGET_PLATFORM_USRROOT ${TARGET_PLATFORM_USRROOT}'/>
    <echo message='TARGET_PLATFORM_USRLIBS ${TARGET_PLATFORM_USRLIBS}'/>
    <echo message='TARGET_JAVA_LIBS ${TARGET_JAVA_LIBS}'/>
  </target>

</project>