mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 11:21:06 +01:00
Moves to Java11 and OpenJDK via AdoptOpenJDK within the processing4 train using a squash of sampottinger processing fork's java11 branch. **Primary required changes:** Some changes directly support OpenJFX / OpenJDK 11: - Response to image loading changes caused by [JEP 320](https://openjdk.java.net/jeps/320) - Use of jmodules as necessitated by [JEP 261](https://openjdk.java.net/jeps/261) - Reponse to largely changed file paths caused by [JEP 220](https://openjdk.java.net/jeps/220). - Modifications in build system related to AdoptOpenJDK and Java 11 which have a different naming structure for downloads. - Allowing use of non-Oracle Java within internal Processing checks. **Secondary required changes:** There were some secondary required changes that impacted the usability of Processing after having moved to OpenJFX / OpenJDK 11: - Removal of com.apple.eawt calls related to [JEP 272](http://openjdk.java.net/jeps/272) - Response to HiDPI support on Windows and Linux in [JEP 263](https://openjdk.java.net/jeps/263) - Removal of `java.ext.dirs`. Would be forced by [JEP 220](http://openjdk.java.net/jeps/220). - Due to bugs on Windows, updated the JNA jars. - Changes in downloader build tasks to support AdoptOpenJDK and OpenJFX. - Updated org.eclipse.* / equinox jars. - Some optimization around size of distribution. - Update of AppBundler. - Some changes in formulation of classpath and modifications in PreprocessingService given [JEP 261](https://openjdk.java.net/jeps/261). **Incidental changes:** This was (ahem) a bit of a larger PR with the above modifications. So, I wanted to introduce automated tests when possible and convenient along with a few changes for platform sustainability in order to support development: - Addition of cross-building capability (!) made possible by AdoptOpenJDK. - Addition of mockito for testing. - Upgrade of junit. - Addition of ant-contrib. - Standardized nomenclature around JRE / JDK in `build/build.xml` - Deduplication of code in `jre/build.xml`. - Addition of JavaDoc in a few places. - Some refactoring of PImage / Shape to support increased testing and readability in image manipulation code.
123 lines
4.1 KiB
XML
123 lines
4.1 KiB
XML
<?xml version="1.0"?>
|
|
<project name="Processing Core" default="build">
|
|
|
|
<property environment="env"/>
|
|
|
|
<target name="clean" description="Clean out the build directories">
|
|
<delete dir="bin" />
|
|
<delete dir="bin-test" />
|
|
<delete file="library/core.jar" />
|
|
</target>
|
|
|
|
<target name="methods-check">
|
|
<available file="methods/methods.jar" property="methods.present" />
|
|
</target>
|
|
|
|
<target name="methods-build" depends="methods-check" unless="methods.present">
|
|
<subant buildpath="methods" target="dist" />
|
|
</target>
|
|
|
|
<path id="classpath.base">
|
|
<!-- kinda gross, but if not using the JDT, this just ignored anyway -->
|
|
<pathelement location="apple.jar" />
|
|
<pathelement location="library/jogl-all.jar" />
|
|
<pathelement location="library/gluegen-rt.jar" />
|
|
<pathelement location="library/javafx-swt.jar" />
|
|
<pathelement location="library/javafx.base.jar" />
|
|
<pathelement location="library/javafx.controls.jar" />
|
|
<pathelement location="library/javafx.fxml.jar" />
|
|
<pathelement location="library/javafx.graphics.jar" />
|
|
<pathelement location="library/javafx.media.jar" />
|
|
<pathelement location="library/javafx.properties" />
|
|
<pathelement location="library/javafx.swing.jar" />
|
|
<pathelement location="library/javafx.web.jar" />
|
|
</path>
|
|
|
|
<path id="classpath.test">
|
|
<pathelement location="library-test/junit-4.8.1.jar" />
|
|
<pathelement location="library-test/mockito-all-1.10.19.jar" />
|
|
<pathelement location="bin-test" />
|
|
<path refid="classpath.base" />
|
|
</path>
|
|
|
|
<macrodef name="compilecommon">
|
|
<attribute name="destdir"/>
|
|
<attribute name="srcdir"/>
|
|
<attribute name="classpath"/>
|
|
<sequential>
|
|
<taskdef name="methods"
|
|
classname="PAppletMethods"
|
|
classpath="methods/methods.jar" />
|
|
<methods dir="${basedir}/src/processing/core" recorder="true" />
|
|
|
|
<!-- Where can I expect to find Java Mode JARs? -->
|
|
<property name="java.mode" value="../java/mode/" />
|
|
|
|
<!-- JavaFX got removed from the Oracle's JDK for arm and Java 11 -->
|
|
<condition property="fx.unavailable" value="true">
|
|
<or>
|
|
<equals arg1="${os.arch}" arg2="arm" />
|
|
<equals arg1="${os.arch}" arg2="aarch64" />
|
|
</or>
|
|
</condition>
|
|
|
|
<!-- link against apple.jar for the ThinkDifferent class -->
|
|
<mkdir dir="@{destdir}" />
|
|
<javac source="1.8"
|
|
target="1.8"
|
|
encoding="UTF-8"
|
|
includeAntRuntime="false"
|
|
debug="true"
|
|
destdir="@{destdir}"
|
|
nowarn="true">
|
|
<classpath refid="@{classpath}"/>
|
|
<src path="@{srcdir}" />
|
|
<include name="processing/**" />
|
|
<exclude name="processing/javafx/**" if="fx.unavailable" />
|
|
</javac>
|
|
|
|
<!-- Copy the jnilib to the bin folder so it's included. -->
|
|
<copy todir="bin/japplemenubar"
|
|
file="src/japplemenubar/libjAppleMenuBar.jnilib" />
|
|
|
|
<!-- Copy shaders to bin. (Eclipse does this automatically.) -->
|
|
<copy todir="bin">
|
|
<fileset dir="src">
|
|
<include name="processing/opengl/shaders/*.glsl" />
|
|
<include name="processing/opengl/cursors/*.png" />
|
|
<include name="icon/*.png" />
|
|
</fileset>
|
|
</copy>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="test-compile" description="Compile" depends="methods-build">
|
|
<compilecommon srcdir="src; test" destdir="bin-test" classpath="classpath.test" />
|
|
</target>
|
|
|
|
<target name="clean-pre-test" description="Required step prior to test">
|
|
<delete dir="resource-test/scratch" />
|
|
</target>
|
|
|
|
<target name="test" depends="test-compile, clean-pre-test">
|
|
<junit haltonfailure="true">
|
|
<classpath refid="classpath.test" />
|
|
<formatter type="brief" usefile="false" />
|
|
<batchtest>
|
|
<fileset dir="test">
|
|
<include name="**/*Test.java" />
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
|
|
<target name="compile" description="Compile" depends="test">
|
|
<compilecommon srcdir="src" destdir="bin" classpath="classpath.base" />
|
|
</target>
|
|
|
|
<target name="build" depends="compile" description="Build core library">
|
|
<jar basedir="bin" destfile="library/core.jar" />
|
|
</target>
|
|
|
|
</project>
|