Skip to content

Commit

Permalink
arduino-core project is now correctly compiled through ant build script
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Nov 13, 2014
1 parent ba8eade commit d1f4e03
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<classpathentry excluding="processing/app/tools/format/|processing/app/tools/format/src/|processing/app/Trace.java|processing/app/RunnerClassLoader.java" kind="src" path="app/src"/>
<classpathentry kind="src" path="app/test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
<classpathentry kind="lib" path="app/lib/antlr.jar"/>
<classpathentry kind="lib" path="app/lib/apple.jar"/>
<classpathentry kind="lib" path="app/lib/ecj.jar"/>
Expand All @@ -21,5 +20,6 @@
<classpathentry kind="lib" path="app/lib/jmdns-3.4.1.jar"/>
<classpathentry kind="lib" path="app/lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="app/lib/jssc-2.8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/arduino-core"/>
<classpathentry kind="output" path="app/bin"/>
</classpath>
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
app/bin/
app/pde.jar
build/macosx/work/
core/bin/
core/core.jar
arduino-core/bin/
arduino-core/arduino-core.jar
hardware/arduino/bootloaders/caterina_LUFA/Descriptors.o
hardware/arduino/bootloaders/caterina_LUFA/Descriptors.lst
hardware/arduino/bootloaders/caterina_LUFA/Caterina.sym
Expand Down
10 changes: 6 additions & 4 deletions app/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<include name="*.jar"/>
</fileset>
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement path="../core/core.jar"/>
<pathelement path="../arduino-core/arduino-core.jar"/>
</path>

<path id="class.path.test">
Expand All @@ -24,6 +24,11 @@
</target>

<target name="compile" description="Compile sources">
<condition property="core-built">
<available file="../arduino-core/arduino-core.jar" />
</condition>
<fail unless="core-built" message="Please build the Arduino-core library first and make sure it sits in ../arduino-core/arduino-core.jar" />

<mkdir dir="bin" />

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

<target name="test" depends="compile" description="Runs the test">
Expand Down
52 changes: 52 additions & 0 deletions arduino-core/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<project name="Arduino IDE Core" default="build">

<path id="class.path">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
</path>

<target name="clean" description="Clean out the build directories">
<delete dir="bin" />
<delete file="arduino-core.jar" />
</target>

<target name="compile" description="Compile">
<!--
<taskdef name="methods"
classname="PAppletMethods"
classpath="methods/methods.jar" />
<methods dir="${basedir}/src/processing/core" />
-->
<mkdir dir="bin" />

<!-- ant seems to nuke ${java.home} for some reason, pointing at the JRE
subfolder instead of the actual JDK found at JAVA_HOME.
To avoid this, we grab the actual JAVA_HOME environment variable
and use that to specify the location of tools.jar. -->

<!-- if someone is better with ant please help clean this up -->
<property environment="env" />
<property name="java_home" value="${env.JAVA_HOME}" />

<javac source="1.6"
target="1.6"
encoding="UTF-8"
includeAntRuntime="false"
srcdir="src"
classpathref="class.path"
destdir="bin">
</javac>

<copy todir="bin" overwrite="true" verbose="true">
<fileset dir="src" includes="**/*.properties" />
</copy>
</target>

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

</project>
7 changes: 5 additions & 2 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
<include name="arduino-core/arduino-core.jar" />
<include name="app/pde.jar" />
<include name="app/lib/commons-codec-1.7.jar" />
<include name="app/lib/commons-exec-1.1.jar" />
Expand Down Expand Up @@ -83,10 +84,12 @@
<!-- - - - - - - - - - - - - - - - - - -->

<target name="subprojects-clean">
<subant buildpath="../arduino-core" target="clean"/>
<subant buildpath="../app" target="clean"/>
</target>

<target name="subprojects-build">
<subant buildpath="../arduino-core" target="build"/>
<subant buildpath="../app" target="build"/>
</target>

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

<!-- figure out the revision number in base.java -->
<loadfile srcfile="../app/src/processing/app/Base.java"
<loadfile srcfile="../arduino-core/src/processing/app/BaseNoGui.java"
property="revision.base">
<filterchain>
<tokenfilter>
Expand All @@ -170,7 +173,7 @@
</tokenfilter>
</filterchain>
</loadfile>
<echo message="Revision in Base.java is: ${revision.base}" />
<echo message="Revision in BaseNoGui.java is: ${revision.base}" />
</target>

<!-- - - - - - - - -->
Expand Down
2 changes: 1 addition & 1 deletion build/macosx/template.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<!-- In 0149, removed /System/Library/Java from the CLASSPATH because
it can cause problems if users have installed weird files there.
http://dev.processing.org/bugs/show_bug.cgi?id=1045 -->
<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>
<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>

<key>JVMArchs</key>
<array>
Expand Down

0 comments on commit d1f4e03

Please sign in to comment.