2009-05-31 17:53:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
### -- SETUP WORK DIR -------------------------------------------
|
|
|
|
|
2009-06-01 19:10:56 +02:00
|
|
|
RESOURCES=`pwd`/work/Arduino.app/Contents/Resources/Java
|
2009-05-31 17:53:33 +02:00
|
|
|
#echo $RESOURCES
|
|
|
|
#exit
|
|
|
|
|
|
|
|
if test -d work
|
|
|
|
then
|
|
|
|
BUILD_PREPROC=false
|
|
|
|
else
|
|
|
|
echo Setting up directories to build under Mac OS X
|
|
|
|
BUILD_PREPROC=true
|
|
|
|
|
|
|
|
mkdir work
|
|
|
|
|
|
|
|
# to have a copy of this guy around for messing with
|
2009-06-01 19:10:56 +02:00
|
|
|
echo Copying Arduino.app...
|
|
|
|
#cp -a dist/Arduino.app work/ # #@$(* bsd switches
|
|
|
|
#/sw/bin/cp -a dist/Arduino.app work/
|
|
|
|
cp -pRX dist/Arduino.app work/
|
2009-05-31 17:53:33 +02:00
|
|
|
# cvs doesn't seem to want to honor the +x bit
|
2009-06-01 19:10:56 +02:00
|
|
|
chmod +x work/Arduino.app/Contents/MacOS/JavaApplicationStub
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
cp -rX ../shared/lib "$RESOURCES/"
|
|
|
|
cp -rX ../shared/libraries "$RESOURCES/"
|
|
|
|
cp -rX ../shared/tools "$RESOURCES/"
|
2009-06-01 10:32:11 +02:00
|
|
|
|
|
|
|
cp -rX ../../hardware "$RESOURCES/"
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
cp -X ../../app/lib/antlr.jar "$RESOURCES/"
|
|
|
|
cp -X ../../app/lib/ecj.jar "$RESOURCES/"
|
|
|
|
cp -X ../../app/lib/jna.jar "$RESOURCES/"
|
2009-06-01 10:32:11 +02:00
|
|
|
cp -X ../../app/lib/oro.jar "$RESOURCES/"
|
2009-06-01 17:14:05 +02:00
|
|
|
cp -X ../../app/lib/RXTXcomm.jar "$RESOURCES/"
|
2009-05-31 17:53:33 +02:00
|
|
|
|
2009-06-01 10:32:11 +02:00
|
|
|
echo Copying examples...
|
|
|
|
cp -r ../shared/examples "$RESOURCES/"
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
echo Extracting reference...
|
|
|
|
unzip -q -d "$RESOURCES/" ../shared/reference.zip
|
2009-06-01 10:32:11 +02:00
|
|
|
|
|
|
|
echo Extracting avr tools...
|
|
|
|
unzip -q -d "$RESOURCES/hardware" dist/tools-universal.zip
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
LIBRARIES=$RESOURCES/libraries/
|
|
|
|
cp -rX ../../net "$LIBRARIES"
|
|
|
|
cp -rX ../../opengl "$LIBRARIES"
|
|
|
|
cp -rX ../../serial "$LIBRARIES"
|
|
|
|
cp -rX ../../video "$LIBRARIES"
|
|
|
|
cp -rX ../../pdf "$LIBRARIES"
|
|
|
|
cp -rX ../../dxf "$LIBRARIES"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
### -- START BUILDING -------------------------------------------
|
|
|
|
|
|
|
|
# move to root 'processing' directory
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
|
|
|
|
### -- BUILD CORE ----------------------------------------------
|
|
|
|
|
|
|
|
echo Building processing.core...
|
|
|
|
|
|
|
|
cd core
|
|
|
|
|
|
|
|
#CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Java/Extensions/QTJava.zip
|
|
|
|
#export CLASSPATH
|
|
|
|
|
|
|
|
perl preproc.pl
|
|
|
|
|
|
|
|
mkdir -p bin
|
|
|
|
javac -source 1.5 -target 1.5 -d bin \
|
|
|
|
src/processing/core/*.java \
|
|
|
|
src/processing/xml/*.java
|
|
|
|
|
|
|
|
rm -f "$RESOURCES/core.jar"
|
|
|
|
|
|
|
|
cd bin && \
|
|
|
|
zip -rq "$RESOURCES/core.jar" \
|
|
|
|
processing/core/*.class \
|
|
|
|
processing/xml/*.class \
|
|
|
|
&& cd ..
|
|
|
|
|
|
|
|
# head back to "processing/app"
|
|
|
|
cd ../app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### -- BUILD PDE ------------------------------------------------
|
|
|
|
|
|
|
|
echo Building the PDE...
|
|
|
|
|
|
|
|
# For some reason, javac really wants this folder to exist beforehand.
|
|
|
|
rm -rf ../build/macosx/work/classes
|
|
|
|
mkdir ../build/macosx/work/classes
|
|
|
|
# Intentionally keeping this separate from the 'bin' folder
|
|
|
|
# used by eclipse so that they don't cause conflicts.
|
|
|
|
|
|
|
|
javac \
|
|
|
|
-Xlint:deprecation \
|
|
|
|
-source 1.5 -target 1.5 \
|
2009-06-01 17:14:05 +02:00
|
|
|
-classpath "$RESOURCES/core.jar:$RESOURCES/antlr.jar:$RESOURCES/ecj.jar:$RESOURCES/jna.jar:$RESOURCES/oro.jar:$RESOURCES/RXTXcomm.jar" \
|
2009-05-31 17:53:33 +02:00
|
|
|
-d ../build/macosx/work/classes \
|
|
|
|
src/processing/app/*.java \
|
|
|
|
src/processing/app/debug/*.java \
|
|
|
|
src/processing/app/macosx/*.java \
|
|
|
|
src/processing/app/preproc/*.java \
|
|
|
|
src/processing/app/syntax/*.java \
|
2009-06-01 10:32:11 +02:00
|
|
|
src/processing/app/tools/*.java
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
cd ../build/macosx/work/classes
|
|
|
|
rm -f "$RESOURCES/pde.jar"
|
|
|
|
zip -0rq "$RESOURCES/pde.jar" .
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# get updated core.jar and pde.jar; also antlr.jar and others
|
2009-06-01 19:10:56 +02:00
|
|
|
#mkdir -p work/Arduino.app/Contents/Resources/Java/
|
|
|
|
#cp work/lib/*.jar work/Arduino.app/Contents/Resources/Java/
|
2009-05-31 17:53:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo
|
2009-06-01 10:32:11 +02:00
|
|
|
echo Done.
|