forked from processing/processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
146 lines (121 loc) · 5.06 KB
/
build.xml
File metadata and controls
146 lines (121 loc) · 5.06 KB
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
<?xml version="1.0"?>
<project name="Java Mode" default="build">
<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="antlr_jar"
value="${basedir}/mode/antlr.jar" />
<property name="mode_jar"
value="${basedir}/mode/JavaMode.jar" />
<classloader taskname="antlr">
<classpath path="${antlr_jar}" />
</classloader>
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<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" />
</fileset>
</delete>
</target>
<target name="preproc" description="Compile ANTLR grammar">
<antlr target="${grammars}/java15.g" outputdirectory="${generated}">
<classpath path="${antlr_jar}" />
</antlr>
<antlr target="${grammars}/pde.g"
outputdirectory="${generated}"
glib="${grammars}/java15.g">
<classpath path="${antlr_jar}" />
</antlr>
<!-- clean up the warning mess caused by this old antlr version -->
<!--<property name="uuc" value="@SuppressWarnings({ "unused", "unchecked", "cast" })${line.separator}" />-->
<property name="uucr" value="@SuppressWarnings({ "unused", "unchecked", "cast", "rawtypes" })${line.separator}" />
<property name="uc" value="@SuppressWarnings({ "unused", "cast" })${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>
<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>
<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>
<target name="compile" depends="preproc" description="Compile sources">
<condition property="core-built">
<available file="../core/library/core.jar" />
</condition>
<fail unless="core-built" message="Please first build the core library and make sure it is located at ../core/library/core.jar" />
<condition property="app-built">
<available file="../app/pde.jar" />
</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 -->
<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;
../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;
mode/jsoup-1.7.1.jar;
mode/org.netbeans.swing.outline.jar;
mode/jdi.jar;
mode/jdimodel.jar;
mode/com.ibm.icu.jar;
mode/org.eclipse.core.contenttype.jar;
mode/org.eclipse.core.jobs.jar;
mode/org.eclipse.core.resources.jar;
mode/org.eclipse.core.runtime.jar;
mode/org.eclipse.equinox.common.jar;
mode/org.eclipse.equinox.preferences.jar;
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">
<src path="src" />
<src path="generated" />
<compilerclasspath path="mode/org.eclipse.jdt.core.jar;
mode/jdtCompilerAdapter.jar" />
</javac>
</target>
<target name="build" depends="compile" description="Build PDE">
<jar basedir="bin" destfile="${mode_jar}" />
</target>
</project>