[OSM-dev] [patch] Build and runtime fixes for the applet

Petter Reinholdtsen pere at hungry.com
Sun Apr 2 22:09:39 BST 2006


Here are a few patches I have in my svn three.  Please commit them to
the official version.

 - Avoid printing long lines in runapplet.sh
 - Add support for passing arguments to the java program
 - Avoid long line in src/org/openstreetmap/processing/OsmApplet.java
 - Make sure required directory gui/ is created by ant if missing.

Index: runapplet.sh
===================================================================
--- runapplet.sh        (revision 954)
+++ runapplet.sh        (working copy)
@@ -7,23 +7,24 @@
     exit 1
 fi

+user="$1"; shift
+pass="$1"; shift

 if [ ! -d ./dist ] ; then
     echo "You must first build the applet using ant"
     nothing=`which ant`
     if [ $? -ne 0 ] ; then
-        echo "It appears you don't have ant installed. Install ant then run ant in the current directory"
+        echo "It appears you don't have ant installed."
+        echo "Install ant then run ant in the current directory"
     fi
     nothing=`which javac`
     if [ $? -ne 0 ] ; then
-         echo "It appears you don't have a java development kit installed. Install a java development kit before running ant in the current directory"
+        echo "It appears you don't have a java development kit installed."
+        echo "Install a java development kit before running ant in the current directory"
     fi
-       exit 1
+    exit 1
 fi

-
-
-
 [ -n "$JAVA" ] || JAVA=java

 distdir=`dirname $0`/dist
@@ -36,4 +37,4 @@
     -cp $OSMCLASSPATH \
     processing.core.PApplet \
     org.openstreetmap.processing.OsmApplet \
-    --user=$1 --pass=$2
+    --user="$user" --pass="$pass" $@
Index: src/org/openstreetmap/processing/OsmApplet.java
===================================================================
--- src/org/openstreetmap/processing/OsmApplet.java     (revision 954)
+++ src/org/openstreetmap/processing/OsmApplet.java     (working copy)
@@ -241,8 +241,8 @@
                size(WINDOW_WIDTH, WINDOW_HEIGHT);
                smooth();

-               // this font should have all special characters - open to suggestions
-               // for changes though
+               // this font should have all special characters - open
+               // to suggestions for changes though
                font = loadFont("/data/LucidaSansUnicode-11.vlw");

                // initialise node manager and add buttons in desired order
Index: build.xml
===================================================================
--- build.xml   (revision 954)
+++ build.xml   (working copy)
@@ -10,6 +10,7 @@
   <target name="init">
     <tstamp/>
     <mkdir dir="${build}"/>
+    <mkdir dir="${build}/gui"/>
        <mkdir dir="${dist}"/>
     <mkdir dir="${dist}/api"/>
     <mkdir dir="${dist}/rc1/org"/>





More information about the dev mailing list