Skip to content

Commit 927887d

Browse files
committed
change build to include range of platforms, use new sub dirs for natives
1 parent fca463d commit 927887d

File tree

2 files changed

+49
-57
lines changed

2 files changed

+49
-57
lines changed

build.xml

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ ${line.separator}with the path to where you have the code for Processing 4 check
1616
<subant buildpath="${processing.dir}/core" />
1717

1818
<property name="core.dir" value="${processing.dir}/core/library" />
19+
<property name="core.jar.path" location="${core.dir}/core.jar" />
1920

2021
<condition property="processing.built">
21-
<available file="${core.dir}/core.jar" />
22+
<available file="${core.jar.path}" />
2223
</condition>
2324

2425
<fail unless="processing.built"
2526
message="Please first build Processing (or at least core/build.xml) so that we have a usable core.jar to bundle with the app." />
2627

27-
<property name="core.path" location="${processing.dir}/core/library/core.jar" />
2828
</target>
2929

3030
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -34,31 +34,12 @@ ${line.separator}with the path to where you have the code for Processing 4 check
3434

3535
<target name="clean" description="Clean the build directories">
3636
<delete dir="bin" />
37-
<!-- Remove everything, which includes javafx.jar and files extracted from
38-
GluonHQ downloads, but those can be reproduced from the downloaded zips. -->
37+
38+
<!-- Remove everything, which includes javafx.jar and files extracted
39+
from the GluonHQ downloads, but those can be reproduced from the downloaded zips (which are not removed). -->
3940
<delete dir="${library.path}" />
4041
</target>
4142

42-
<condition property="fx.unavailable" value="true">
43-
<or>
44-
<equals arg1="${os.arch}" arg2="arm" />
45-
<equals arg1="${os.arch}" arg2="aarch64" />
46-
</or>
47-
</condition>
48-
49-
<condition property="jfx.available" value="true">
50-
<and>
51-
<not><equals arg1="${os.arch}" arg2="arm" /></not>
52-
</and>
53-
</condition>
54-
55-
<available file="${gluon.base}.zip" property="javafx.present" />
56-
57-
<!-- ok to ignore failed downloads if we at least have a version that's local -->
58-
<condition property="javafx.ignorable" value="false" else="true">
59-
<isset property="javafx.present" />
60-
</condition>
61-
6243
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
6344

6445
<!--
@@ -86,8 +67,8 @@ ${line.separator}with the path to where you have the code for Processing 4 check
8667
https://download2.gluonhq.com/openjfx/17.0.2/openjfx-17.0.2_linux-aarch64_bin-sdk.zip
8768
-->
8869
<target name="retrieve-gluon">
89-
<get src="https://download2.gluonhq.com/openjfx/${gluon.version}/openjfx-${gluon.version}_${platform.name}-x64_bin-sdk.zip"
90-
dest="${gluon.base}.zip"
70+
<get src="https://download2.gluonhq.com/openjfx/${gluon.version}/openjfx-${gluon.version}_${platform.name}-${platform.arch}_bin-sdk.zip"
71+
dest="${platform.zip}"
9172
ignoreerrors="${javafx.ignorable}"
9273
usetimestamp="true" />
9374

@@ -97,15 +78,12 @@ ${line.separator}with the path to where you have the code for Processing 4 check
9778

9879
<target name="unzip-gluon-jars">
9980
<property name="modules.path" value="${platform.path}/modules" />
100-
<echo message="Extracting jars from ${gluon.base}.zip to ${modules.path}" />
81+
<echo message="Extracting jars from ${platform.zip} to ${modules.path}" />
10182
<!-- should javafx.properties be copied? is it used for anything? [fry 210620] -->
10283

103-
<!-- https://ant.apache.org/manual/Tasks/unzip.html -->
104-
<!-- <unzip dest="${library.path}" src="${gluon.base}.zip" overwrite="true"> -->
10584
<!-- !#($*#! the builds have *slightly* different classes in each release
106-
(WinPlatformFactory not in macOS .jar... FFS it's 1100 bytes of glue code)
107-
So the .jar files go into the native subdirectories as well. -->
108-
<unzip dest="${modules.path}" src="${gluon.base}.zip" overwrite="true">
85+
(WinPlatformFactory not in macOS .jar... FFS it's 1100 bytes of glue code) So the .jar files go into the native subdirectories as well. -->
86+
<unzip dest="${modules.path}" src="${platform.zip}" overwrite="true">
10987
<patternset>
11088
<include name="**/*.jar" />
11189
<!-- These two aren't supported/used -->
@@ -119,18 +97,20 @@ ${line.separator}with the path to where you have the code for Processing 4 check
11997
</target>
12098

12199
<target name="unzip-gluon-natives">
122-
<echo message="Extracting native libs from ${gluon.base}.zip to ${platform.path}" />
100+
<echo message="Extracting native libs from ${platform.zip} to ${platform.path}" />
123101

124-
<unzip dest="${platform.path}" src="${gluon.base}.zip" overwrite="true">
102+
<unzip dest="${platform.path}" src="${platform.zip}" overwrite="true">
125103
<patternset>
126104
<include name="**/*.dll" />
127105
<include name="**/*.dylib" />
128106
<include name="**/*.so" />
129-
<!-- The webkit library isn't included because this library is massive.
107+
108+
<!-- The webkit library might be skipped because it is massive.
130109
Remove libjfxwebkit.dylib, libjfxwebkit.so, jfxwebkit.dll -->
131110
<!-- <exclude name="**/*jfxwebkit.*" /> -->
132111

133-
<!-- Not using this either, but since we're using 'include', no need for it -->
112+
<!-- Not using this either, but since we're using 'include',
113+
no need for an 'exclude' line -->
134114
<!-- <exclude name="**/src.zip" /> -->
135115
</patternset>
136116

@@ -141,51 +121,59 @@ ${line.separator}with the path to where you have the code for Processing 4 check
141121
</target>
142122

143123
<target name="download-javafx">
144-
<property name="gluon.version" value="17.0.1" />
145-
<!-- current Early Access version, includes support for other architectures -->
146-
<!-- <property name="gluon.version" value="17-ea" /> -->
147-
148-
<!-- http://ant.apache.org/manual/Tasks/tempfile.html -->
149-
<!-- <tempfile property="temp.zip" destDir="${java.io.tmpdir}" suffix=".zip" /> -->
124+
<antcall target="retrieve-gluon">
125+
<param name="gluon.base" value="javafx-${gluon.version}-macos" />
126+
<param name="platform.name" value="osx" />
127+
<param name="platform.arch" value="x64" />
128+
<param name="platform.path" value="${library.path}/macos-x86_64" />
129+
</antcall>
150130

151-
<!-- javafx-${gluon.version}-sdk-${gluon.platform} -->
152131
<antcall target="retrieve-gluon">
153132
<param name="gluon.base" value="javafx-${gluon.version}-macos" />
154133
<param name="platform.name" value="osx" />
155-
<param name="platform.path" value="${library.path}/macosx" />
134+
<param name="platform.arch" value="aarch64" />
135+
<param name="platform.path" value="${library.path}/macos-aarch64" />
156136
</antcall>
157137

158138
<antcall target="retrieve-gluon">
159139
<param name="gluon.base" value="javafx-${gluon.version}-windows" />
160140
<param name="platform.name" value="windows" />
161-
<param name="platform.path" value="${library.path}/windows64" />
141+
<param name="platform.arch" value="x64" />
142+
<param name="platform.path" value="${library.path}/windows-amd64" />
162143
</antcall>
163144

164145
<antcall target="retrieve-gluon">
165146
<param name="gluon.base" value="javafx-${gluon.version}-linux" />
166147
<param name="platform.name" value="linux" />
167-
<param name="platform.path" value="${library.path}/linux64" />
148+
<param name="platform.arch" value="x64" />
149+
<param name="platform.path" value="${library.path}/linux-amd64" />
168150
</antcall>
169-
</target>
170151

171-
<target name="compile" depends="download-javafx,core-check" description="Compile sources">
172-
<!--
173-
<condition property="core-built">
174-
<available file="${core.path}" />
175-
</condition>
176-
<fail unless="core-built"
177-
message="Please build the core library first: expecting core.jar at ${core.path}" />
178-
-->
152+
<antcall target="retrieve-gluon">
153+
<param name="gluon.base" value="javafx-${gluon.version}-linux" />
154+
<param name="platform.name" value="linux" />
155+
<param name="platform.arch" value="arm32" />
156+
<param name="platform.path" value="${library.path}/linux-arm" />
157+
</antcall>
158+
159+
<antcall target="retrieve-gluon">
160+
<param name="gluon.base" value="javafx-${gluon.version}-linux" />
161+
<param name="platform.name" value="linux" />
162+
<param name="platform.arch" value="aarch64" />
163+
<param name="platform.path" value="${library.path}/linux-aarch64" />
164+
</antcall>
165+
</target>
179166

167+
<target name="compile" depends="download-javafx,core-check">
180168
<!-- just pick a platform; any should be sufficient for building -->
181-
<property name="javafx.jar.path" value="library/macosx/modules" />
169+
<property name="javafx.jar.path" value="library/macos/modules" />
182170

183171
<mkdir dir="bin" />
184172
<javac source="11" target="11"
185173
srcdir="src" destdir="bin"
186174
encoding="UTF-8"
187175
includeAntRuntime="false"
188-
classpath="${core.path};
176+
classpath="${core.jar.path};
189177
${javafx.jar.path}/javafx.base.jar;
190178
${javafx.jar.path}/javafx.controls.jar;
191179
${javafx.jar.path}/javafx.fxml.jar;

todo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ o https://github.com/processing/processing/pull/6051
44
X contains too many arbitrary changes (deleted lines, fields made public)
55
X uses new image cache object, not clear why
66
X cache mechanism would make memory run out
7+
X add the five (now six) platforms to the javafx build
8+
X need internet connection for the build
9+
X but too complicated to check whether each platform is available
10+
X and not nearly as onerous a requirement now that it's not part of core
711

812
contribs
913
X make offscreen PGraphicsFX2D work (from @GKFX)

0 commit comments

Comments
 (0)