Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
or http://stackoverflow.com/q/10268583 -->
<property name="jdk.hash" value="1961070e4c9b4e26a04e7f5a083f551e" />

<!-- these a*holes at Oracle... no longer works without a login
<property name="jdk.update" value="212" />
<property name="jdk.build" value="10" />
<property name="jdk.hash" value="59066701cf1a433da9770636fbc4c9aa" />
-->

<property name="jdk.short" value="${jdk.version}u${jdk.update}" />
<property name="jdk.esoteric" value="1.${jdk.version}.0_${jdk.update}" />

Expand Down Expand Up @@ -388,11 +394,11 @@
message="Do not call assemble from the command line." />

<!-- copy shared tools folder -->
<copy todir="${target.path}/tools">
<copy todir="${target.path}/tools" preservelastmodified="true">
<fileset dir="shared/tools" />
</copy>

<copy todir="${target.path}/modes/java">
<copy todir="${target.path}/modes/java" preservelastmodified="true">
<fileset dir="../java">
<!-- don't include LWJGL, it's not operational -->
<exclude name="libraries/lwjgl/**" />
Expand All @@ -403,7 +409,8 @@
</copy>

<!-- get the examples folder, but don't require it to buid -->
<copy todir="${target.path}/modes/java/examples" failonerror="false">
<copy todir="${target.path}/modes/java/examples"
preservelastmodified="true" failonerror="false">
<fileset dir="${examples.dir}" />
</copy>

Expand Down Expand Up @@ -643,7 +650,7 @@
<arg line="${jdk.path.macosx}/Contents/Home/jre/lib/jli/libjli.dylib ${jli.path}"/>
</exec>

<copy todir="${contents.dir}/Java">
<copy todir="${contents.dir}/Java" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" /> <!-- why this? -->
<!--<fileset dir="shared" includes="launch4j/**" />-->
<fileset dir="shared" includes="lib/**" />
Expand Down Expand Up @@ -785,7 +792,7 @@
<target name="linux-build" depends="ignore-tools, check-linux-arm32, check-linux-arm64, revision-check, linux-check-os, jre-download, subprojects-build, subprojects-build-linux-arm32, subprojects-build-linux-arm64" description="Build Linux version">
<mkdir dir="linux/work" />

<copy todir="linux/work">
<copy todir="linux/work" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" />
<fileset dir="shared" includes="launch4j/**" />
<fileset dir="shared" includes="lib/**" />
Expand Down Expand Up @@ -818,7 +825,7 @@
<fileset dir="${launch4j.dir}/bin" includes="windres-*" />
</delete>

<copy todir="linux/work/lib" flatten="true">
<copy todir="linux/work/lib" flatten="true" preservelastmodified="true">
<fileset refid="runtime.jars" />
</copy>

Expand Down Expand Up @@ -1073,7 +1080,7 @@

<!-- assemble the pde -->
<mkdir dir="windows/work/lib" />
<copy todir="windows/work/lib" flatten="true">
<copy todir="windows/work/lib" flatten="true" preservelastmodified="true">
<fileset refid="runtime.jars" />
</copy>

Expand All @@ -1094,7 +1101,7 @@
<mapper type="flatten"/>
</unzip>

<copy todir="windows/work">
<copy todir="windows/work" preservelastmodified="true">
<fileset dir=".." includes="core/library/**" />
<fileset dir="shared" includes="launch4j/**" />
<fileset dir="shared" includes="lib/**" />
Expand Down
Binary file modified build/macosx/appbundler.jar
Binary file not shown.
13 changes: 7 additions & 6 deletions build/macosx/appbundler/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ questions.
version=1.0ea
-->
<property name="arch64" value="-arch x86_64" />
<property name="arch32" value="-arch i386" />
<property name="archppc" value="-arch ppc" />
<!-- <property name="arch32" value="-arch i386" /> -->
<!-- <property name="archppc" value="-arch ppc" /> -->
<property name="cc" value="gcc" />

<property name="folder.src" value="src"/>
Expand Down Expand Up @@ -73,7 +73,8 @@ questions.
</copy>

<exec executable="${cc}">
<arg line="${arch64} ${arch32}"/>
<!-- <arg line="${arch64} ${arch32}"/> -->
<arg line="${arch64}"/>
<arg value="-I"/>
<arg value="${env.JAVA_HOME}/include"/>
<arg value="-I"/>
Expand All @@ -87,10 +88,10 @@ questions.
<arg value="-isysroot"/>
<!--
<arg value="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"/>
<arg value="-mmacosx-version-min=10.7"/>
<arg value="-mmacosx-version-min=10.7"/>
-->
<arg value="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"/>
<arg value="-mmacosx-version-min=10.8"/>
<arg value="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"/>
<arg value="-mmacosx-version-min=10.8"/>
<arg value="native/main.m"/>
</exec>
</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ private void copyResources(File resourcesDirectory) throws IOException {
} finally {
outputStream.close();
}
file.setLastModified(zipEntry.getTime());
}
zipEntry = zipInputStream.getNextEntry();
}
Expand Down Expand Up @@ -729,7 +730,9 @@ private static void delete(File file) throws IOException {

private static void copy(URL location, File file) throws IOException {
try (InputStream in = location.openStream()) {
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
Files.copy(in, file.toPath(),
// can't do attributes when coming from URL
StandardCopyOption.REPLACE_EXISTING);
}
}

Expand All @@ -740,13 +743,15 @@ private static void copy(File source, File destination) throws IOException {

destination.getParentFile().mkdirs();

Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING, LinkOption.NOFOLLOW_LINKS);
Files.copy(sourcePath, destinationPath,
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.COPY_ATTRIBUTES,
LinkOption.NOFOLLOW_LINKS);

if (Files.isDirectory(sourcePath, LinkOption.NOFOLLOW_LINKS)) {
String[] files = source.list();

for (int i = 0; i < files.length; i++) {
String file = files[i];
for (String file : files) {
copy(new File(source, file), new File(destination, file));
}
}
Expand Down
27 changes: 14 additions & 13 deletions core/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
</target>

<target name="compile" description="Compile" depends="methods-build">
<taskdef name="methods"
classname="PAppletMethods"
<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/" />

<!-- Check for JDT compiler, since this is likely a PDE build. Using
it allows us to build the PDE with only a JRE on Windows and Linux.
So that the core can be built independently of the PDE,
So that the core can be built independently of the PDE,
use javac (the "modern" compiler) if ecj is not present. -->
<property name="jdt.jar" value="${java.mode}/org.eclipse.jdt.core.jar" />
<condition property="build.compiler"
<condition property="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"
else="modern">
<available file="${jdt.jar}" />
Expand All @@ -51,8 +51,8 @@
includeAntRuntime="false"
debug="true"
destdir="bin"
classpath="apple.jar;
library/jogl-all.jar;
classpath="apple.jar;
library/jogl-all.jar;
library/gluegen-rt.jar"
nowarn="true">
<!-- kinda gross, but if not using the JDT, this just ignored anyway -->
Expand All @@ -61,23 +61,24 @@
<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 todir="bin/japplemenubar"
file="src/japplemenubar/libjAppleMenuBar.jnilib"
preservelastmodified="true" />

<!-- Copy shaders to bin. (Eclipse does this automatically.) -->
<copy todir="bin">
<copy todir="bin" preservelastmodified="true">
<fileset dir="src">
<include name="processing/opengl/shaders/*.glsl" />
<include name="processing/opengl/cursors/*.png" />
<include name="icon/*.png" />
</fileset>
</copy>
</target>
</target>

<target name="build" depends="compile" description="Build core library">
<jar basedir="bin" destfile="library/core.jar" />
</target>

</project>
105 changes: 50 additions & 55 deletions java/build.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<project name="Java Mode" default="build">

<property name="generated"
value="${basedir}/generated/processing/mode/java/preproc" />
<property name="generated"
value="${basedir}/generated/processing/mode/java/preproc" />
<mkdir dir="${generated}" />

<property name="grammars"
value="${basedir}/src/processing/mode/java/preproc" />
<property name="grammars"
value="${basedir}/src/processing/mode/java/preproc" />

<property name="antlr_jar"
value="${basedir}/mode/antlr.jar" />
<property name="antlr_jar"
value="${basedir}/mode/antlr.jar" />

<property name="mode_jar"
value="${basedir}/mode/JavaMode.jar" />
Expand All @@ -23,12 +23,12 @@
<delete file="${mode_jar}" />
<delete>
<fileset dir="${generated}">
<include name="*.java" />
<include name="*.tokens" />
<include name="*.txt" />
<include name="*.g" />
<include name="*.smap" />
<include name="*.properties" />
<include name="*.java" />
<include name="*.tokens" />
<include name="*.txt" />
<include name="*.g" />
<include name="*.smap" />
<include name="*.properties" />
</fileset>
</delete>
</target>
Expand All @@ -37,9 +37,9 @@
<antlr target="${grammars}/java15.g" outputdirectory="${generated}">
<classpath path="${antlr_jar}" />
</antlr>
<antlr target="${grammars}/pde.g"
outputdirectory="${generated}"
glib="${grammars}/java15.g">
<antlr target="${grammars}/pde.g"
outputdirectory="${generated}"
glib="${grammars}/java15.g">
<classpath path="${antlr_jar}" />
</antlr>

Expand All @@ -49,28 +49,24 @@
<property name="uc" value="@SuppressWarnings({ &quot;unused&quot;, &quot;cast&quot; })${line.separator}" />

<!-- need to match against the previous line so that we don't re-add -->
<replaceregexp
file="generated/processing/mode/java/preproc/JavaLexer.java"
match="(\n\n)(public class JavaLexer .*)"
replace="\1${uucr}\2">
<replaceregexp file="generated/processing/mode/java/preproc/JavaLexer.java"
match="(\n\n)(public class JavaLexer .*)"
replace="\1${uucr}\2">
</replaceregexp>

<replaceregexp
file="generated/processing/mode/java/preproc/JavaRecognizer.java"
match="(\*/\n)(public class JavaRecognizer .*)"
replace="\1${uc}\2">
<replaceregexp file="generated/processing/mode/java/preproc/JavaRecognizer.java"
match="(\*/\n)(public class JavaRecognizer .*)"
replace="\1${uc}\2">
</replaceregexp>

<replaceregexp
file="generated/processing/mode/java/preproc/PdeLexer.java"
match="(\n\n)(public class PdeLexer .*)"
replace="\1${uucr}\2">
<replaceregexp file="generated/processing/mode/java/preproc/PdeLexer.java"
match="(\n\n)(public class PdeLexer .*)"
replace="\1${uucr}\2">
</replaceregexp>

<replaceregexp
file="generated/processing/mode/java/preproc/PdeRecognizer.java"
match="(\n\n)(public class PdeRecognizer .*)"
replace="\1${uc}\2">
<replaceregexp file="generated/processing/mode/java/preproc/PdeRecognizer.java"
match="(\n\n)(public class PdeRecognizer .*)"
replace="\1${uc}\2">
</replaceregexp>
<!-- end of workaround for old antlr -->
</target>
Expand All @@ -86,38 +82,37 @@
</condition>
<fail unless="app-built" message="Please build app first and make sure it is located at ../app/pde.jar" />


<mkdir dir="bin" />

<!-- in some cases, pde.jar was not getting built
https://github.com/processing/processing/issues/1792 -->
https://github.com/processing/processing/issues/1792 -->
<delete file="${mode_jar}" />

<!-- env used to set classpath below -->
<property environment="env" />

<javac source="1.8"
target="1.8"
destdir="bin"
excludes="**/tools/format/**"
encoding="UTF-8"
includeAntRuntime="false"
classpath="../core/library/core.jar;
target="1.8"
destdir="bin"
excludes="**/tools/format/**"
encoding="UTF-8"
includeAntRuntime="false"
classpath="../core/library/core.jar;

../app/pde.jar;
../app/lib/ant.jar;
../app/lib/ant-launcher.jar;
../app/lib/apple.jar;
../app/lib/jna.jar;
../app/lib/jna-platform.jar;

mode/antlr.jar;
mode/classpath-explorer-1.0.jar;
../app/lib/ant.jar;
../app/lib/ant-launcher.jar;
../app/lib/apple.jar;
../app/lib/jna.jar;
../app/lib/jna-platform.jar;

mode/antlr.jar;
mode/classpath-explorer-1.0.jar;
mode/jsoup-1.7.1.jar;
mode/org.netbeans.swing.outline.jar;
mode/org.netbeans.swing.outline.jar;

mode/jdi.jar;
mode/jdimodel.jar;
mode/jdi.jar;
mode/jdimodel.jar;

mode/com.ibm.icu.jar;

Expand All @@ -130,12 +125,12 @@
mode/org.eclipse.jdt.core.jar;
mode/org.eclipse.osgi.jar;
mode/org.eclipse.text.jar"
debug="on"
nowarn="true"
compiler="org.eclipse.jdt.core.JDTCompilerAdapter">
debug="on"
nowarn="true"
compiler="org.eclipse.jdt.core.JDTCompilerAdapter">
<src path="src" />
<src path="generated" />
<compilerclasspath path="mode/org.eclipse.jdt.core.jar;
<compilerclasspath path="mode/org.eclipse.jdt.core.jar;
mode/jdtCompilerAdapter.jar" />
</javac>
</target>
Expand Down
Loading