Skip to content

Commit a298203

Browse files
committed
Update build.xml for ARM (v2)
Tested with "ant linux-build" w/ JDK 8 and ant 1.8.2 on current Raspbian.
1 parent a9011ad commit a298203

1 file changed

Lines changed: 46 additions & 15 deletions

File tree

build/build.xml

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@
2424
<echo message="The tools.jar file is not required to build Processing." />
2525
</target>
2626

27+
<!-- detetect Raspberry Pi and friends -->
28+
<condition property="linux-arm32" value="linux-arm32">
29+
<and>
30+
<equals arg1="${platform}" arg2="linux" />
31+
<equals arg1="${os.arch}" arg2="arm" />
32+
<equals arg1="${sun.arch.data.model}" arg2="32" />
33+
</and>
34+
</condition>
35+
36+
<target name="check-linux-arm32" if="linux-arm32">
37+
<!-- there is currently no JRE available -->
38+
<property name="jre.download.jdk" value="true" />
39+
<property name="jre.downloader" value="linux-arm-vfp-hflt.tar.gz" />
40+
</target>
41+
2742
<!-- Require Java 8 everywhere. -->
2843
<fail message="Unsupported Java version: ${java.version}. To build, make sure that Java 8 (aka Java 1.8) is installed.">
2944
<condition>
@@ -46,7 +61,7 @@
4661
<property name="jdk.update" value="72" />
4762
<property name="jdk.build" value="14" />
4863
-->
49-
<!-- Switching to 8 because updates for 7 end April 2015 -->
64+
<!-- Switching to 8 because updates for 7 ended April 2015 -->
5065
<property name="jdk.version" value="8" />
5166
<property name="jdk.update" value="51" />
5267
<property name="jdk.build" value="16" />
@@ -65,16 +80,6 @@
6580
</condition>
6681
-->
6782

68-
<!-- for use with the Ant Task -->
69-
<condition property="jre.downloader"
70-
value="${platform}-i586.tar.gz">
71-
<equals arg1="${sun.arch.data.model}" arg2="32" />
72-
</condition>
73-
<condition property="jre.downloader"
74-
value="${platform}-x64.tar.gz">
75-
<equals arg1="${sun.arch.data.model}" arg2="64" />
76-
</condition>
77-
7883
<!-- JDK location for Mac OS X -->
7984
<!--
8085
<condition property="jdk.file" value="jdk-${jdk.short}-macosx-x64.dmg">
@@ -211,10 +216,22 @@
211216

212217
<target name="jre-download" depends="jre-check, downloader-setup"
213218
unless="jre.tgz.downloaded">
219+
<!-- we normally download a JRE, except on arm -->
220+
<property name="jre.download.jdk" value="false" />
221+
222+
<condition property="jre.downloader"
223+
value="${platform}-i586.tar.gz">
224+
<equals arg1="${sun.arch.data.model}" arg2="32" />
225+
</condition>
226+
<condition property="jre.downloader"
227+
value="${platform}-x64.tar.gz">
228+
<equals arg1="${sun.arch.data.model}" arg2="64" />
229+
</condition>
230+
214231
<downloader version="${jdk.version}"
215232
update="${jdk.update}"
216233
build="${jdk.build}"
217-
jdk="false"
234+
jdk="${jre.download.jdk}"
218235
flavor="${jre.downloader}"
219236
path="${jre.tgz.path}" />
220237
</target>
@@ -706,7 +723,7 @@
706723
<fail message="wrong platform (${os.name})" />
707724
</target>
708725

709-
<target name="linux-build" depends="ignore-tools, revision-check, linux-check-os, jre-download, subprojects-build" description="Build Linux version">
726+
<target name="linux-build" depends="ignore-tools, check-linux-arm32, revision-check, linux-check-os, jre-download, subprojects-build" description="Build Linux version">
710727
<mkdir dir="linux/work" />
711728

712729
<copy todir="linux/work">
@@ -783,13 +800,27 @@
783800
We only want to move when the folder didn't exist before
784801
<move file="linux/jre1.7.0_40" tofile="linux/work/java" />
785802
-->
803+
804+
<!-- use the jre subfolder when having downloaded a JDK file -->
805+
<condition property="jre.dir" value="jdk${jdk.esoteric}/jre/">
806+
<!-- property might not be set, but it is for arm -->
807+
<equals arg1="${jre.download.jdk}" arg2="true" />
808+
</condition>
809+
<condition property="jre.dir" value="jre${jdk.esoteric}/">
810+
<not>
811+
<equals arg1="${jre.download.jdk}" arg2="true" />
812+
</not>
813+
</condition>
814+
786815
<exec executable="rsync" dir="linux">
787816
<arg value="-a" />
788817
<arg value="--delete" />
789-
<arg value="jre${jdk.esoteric}/" />
818+
<arg value="${jre.dir}" />
790819
<arg value="work/java" />
791820
</exec>
792-
<delete dir="linux/jre${jdk.esoteric}" />
821+
822+
<delete dir="linux/jre${jdk.esoteric}" failonerror="false" />
823+
<delete dir="linux/jdk${jdk.esoteric}" failonerror="false" />
793824

794825
<!-- Remove unused JRE bloat. -->
795826
<delete failonerror="true">

0 commit comments

Comments
 (0)