Skip to content

Commit aeda06d

Browse files
committed
arduino-core project is now correctly compiled through ant build script
1 parent a3cc3ed commit aeda06d

File tree

6 files changed

+67
-10
lines changed

6 files changed

+67
-10
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<classpathentry excluding="processing/app/tools/format/|processing/app/tools/format/src/|processing/app/Trace.java|processing/app/RunnerClassLoader.java" kind="src" path="app/src"/>
44
<classpathentry kind="src" path="app/test"/>
55
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6-
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
76
<classpathentry kind="lib" path="app/lib/antlr.jar"/>
87
<classpathentry kind="lib" path="app/lib/apple.jar"/>
98
<classpathentry kind="lib" path="app/lib/ecj.jar"/>
@@ -21,5 +20,6 @@
2120
<classpathentry kind="lib" path="app/lib/jmdns-3.4.1.jar"/>
2221
<classpathentry kind="lib" path="app/lib/jsch-0.1.50.jar"/>
2322
<classpathentry kind="lib" path="app/lib/jssc-2.8.0.jar"/>
23+
<classpathentry combineaccessrules="false" kind="src" path="/arduino-core"/>
2424
<classpathentry kind="output" path="app/bin"/>
2525
</classpath>

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
app/bin/
22
app/pde.jar
33
build/macosx/work/
4-
core/bin/
5-
core/core.jar
4+
arduino-core/bin/
5+
arduino-core/arduino-core.jar
66
hardware/arduino/bootloaders/caterina_LUFA/Descriptors.o
77
hardware/arduino/bootloaders/caterina_LUFA/Descriptors.lst
88
hardware/arduino/bootloaders/caterina_LUFA/Caterina.sym

app/build.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<include name="*.jar"/>
77
</fileset>
88
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
9-
<pathelement path="../core/core.jar"/>
9+
<pathelement path="../arduino-core/arduino-core.jar"/>
1010
</path>
1111

1212
<path id="class.path.test">
@@ -24,6 +24,11 @@
2424
</target>
2525

2626
<target name="compile" description="Compile sources">
27+
<condition property="core-built">
28+
<available file="../arduino-core/arduino-core.jar" />
29+
</condition>
30+
<fail unless="core-built" message="Please build the Arduino-core library first and make sure it sits in ../arduino-core/arduino-core.jar" />
31+
2732
<mkdir dir="bin" />
2833

2934
<!-- ant seems to nuke ${java.home} for some reason, pointing at the JRE
@@ -75,9 +80,6 @@
7580
includeAntRuntime="false"
7681
debug="true"
7782
classpathref="class.path" />
78-
<copy todir="bin" overwrite="true" verbose="true">
79-
<fileset dir="src" includes="**/*.properties" />
80-
</copy>
8183
</target>
8284

8385
<target name="test" depends="compile" description="Runs the test">

arduino-core/build.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0"?>
2+
<project name="Arduino IDE Core" default="build">
3+
4+
<path id="class.path">
5+
<fileset dir="lib">
6+
<include name="*.jar"/>
7+
</fileset>
8+
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
9+
</path>
10+
11+
<target name="clean" description="Clean out the build directories">
12+
<delete dir="bin" />
13+
<delete file="arduino-core.jar" />
14+
</target>
15+
16+
<target name="compile" description="Compile">
17+
<!--
18+
<taskdef name="methods"
19+
classname="PAppletMethods"
20+
classpath="methods/methods.jar" />
21+
<methods dir="${basedir}/src/processing/core" />
22+
-->
23+
<mkdir dir="bin" />
24+
25+
<!-- ant seems to nuke ${java.home} for some reason, pointing at the JRE
26+
subfolder instead of the actual JDK found at JAVA_HOME.
27+
To avoid this, we grab the actual JAVA_HOME environment variable
28+
and use that to specify the location of tools.jar. -->
29+
30+
<!-- if someone is better with ant please help clean this up -->
31+
<property environment="env" />
32+
<property name="java_home" value="${env.JAVA_HOME}" />
33+
34+
<javac source="1.6"
35+
target="1.6"
36+
encoding="UTF-8"
37+
includeAntRuntime="false"
38+
srcdir="src"
39+
classpathref="class.path"
40+
destdir="bin">
41+
</javac>
42+
43+
<copy todir="bin" overwrite="true" verbose="true">
44+
<fileset dir="src" includes="**/*.properties" />
45+
</copy>
46+
</target>
47+
48+
<target name="build" depends="compile" description="Build core library">
49+
<jar basedir="bin" destfile="arduino-core.jar" />
50+
</target>
51+
52+
</project>

build/build.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
<!-- Libraries required for running arduino -->
4141
<fileset dir=".." id="runtime.jars">
42+
<include name="arduino-core/arduino-core.jar" />
4243
<include name="app/pde.jar" />
4344
<include name="app/lib/commons-codec-1.7.jar" />
4445
<include name="app/lib/commons-exec-1.1.jar" />
@@ -83,10 +84,12 @@
8384
<!-- - - - - - - - - - - - - - - - - - -->
8485

8586
<target name="subprojects-clean">
87+
<subant buildpath="../arduino-core" target="clean"/>
8688
<subant buildpath="../app" target="clean"/>
8789
</target>
8890

8991
<target name="subprojects-build">
92+
<subant buildpath="../arduino-core" target="build"/>
9093
<subant buildpath="../app" target="build"/>
9194
</target>
9295

@@ -160,7 +163,7 @@
160163
<echo message="Latest revision detected in shared/revision.txt is: ${revision}" />
161164

162165
<!-- figure out the revision number in base.java -->
163-
<loadfile srcfile="../app/src/processing/app/Base.java"
166+
<loadfile srcfile="../arduino-core/src/processing/app/BaseNoGui.java"
164167
property="revision.base">
165168
<filterchain>
166169
<tokenfilter>
@@ -170,7 +173,7 @@
170173
</tokenfilter>
171174
</filterchain>
172175
</loadfile>
173-
<echo message="Revision in Base.java is: ${revision.base}" />
176+
<echo message="Revision in BaseNoGui.java is: ${revision.base}" />
174177
</target>
175178

176179
<!-- - - - - - - - -->

build/macosx/template.app/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<!-- In 0149, removed /System/Library/Java from the CLASSPATH because
7777
it can cause problems if users have installed weird files there.
7878
http://dev.processing.org/bugs/show_bug.cgi?id=1045 -->
79-
<string>$JAVAROOT/pde.jar:$JAVAROOT/antlr.jar:$JAVAROOT/apple.jar:$JAVAROOT/ecj.jar:$JAVAROOT/registry.jar:$JAVAROOT/quaqua.jar:$JAVAROOT/jssc-2.8.0.jar:$JAVAROOT/commons-codec-1.7.jar:$JAVAROOT/commons-exec-1.1.jar:$JAVAROOT/commons-httpclient-3.1.jar:$JAVAROOT/commons-logging-1.0.4.jar:$JAVAROOT/jmdns-3.4.1.jar:$JAVAROOT/jsch-0.1.50.jar:$JAVAROOT/jna.jar</string>
79+
<string>$JAVAROOT/pde.jar:$JAVAROOT/arduino-core.jar:$JAVAROOT/antlr.jar:$JAVAROOT/apple.jar:$JAVAROOT/ecj.jar:$JAVAROOT/registry.jar:$JAVAROOT/quaqua.jar:$JAVAROOT/jssc-2.8.0.jar:$JAVAROOT/commons-codec-1.7.jar:$JAVAROOT/commons-exec-1.1.jar:$JAVAROOT/commons-httpclient-3.1.jar:$JAVAROOT/commons-logging-1.0.4.jar:$JAVAROOT/jmdns-3.4.1.jar:$JAVAROOT/jsch-0.1.50.jar:$JAVAROOT/jna.jar</string>
8080

8181
<key>JVMArchs</key>
8282
<array>

0 commit comments

Comments
 (0)