[sword-svn] r119 - in trunk: . micro micro/bin
Apache
apache at www.crosswire.org
Tue May 1 02:50:58 MST 2007
Author:
Date: 2007-05-01 02:50:57 -0700 (Tue, 01 May 2007)
New Revision: 119
Added:
trunk/build.micro1.xml
trunk/build.micro2.xml
trunk/genfcmobile.sh
trunk/micro/bin/
trunk/micro/bin/MANIFEST.MF
trunk/micro/bin/fc.jad
Modified:
trunk/Makefile
trunk/build.xml
Log:
Added build system for micro packages of each lesson set
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2007-05-01 01:34:17 UTC (rev 118)
+++ trunk/Makefile 2007-05-01 09:50:57 UTC (rev 119)
@@ -21,3 +21,7 @@
serverinstalllessons: serverinstallzip
cp -f FlashCards/lessons.jar /home/flashcards/html/webstart/
+
+mobile:
+ ./genfcmobile.sh
+
Added: trunk/build.micro1.xml
===================================================================
--- trunk/build.micro1.xml (rev 0)
+++ trunk/build.micro1.xml 2007-05-01 09:50:57 UTC (rev 119)
@@ -0,0 +1,51 @@
+<project name="flashcards" default="preverify">
+ <property name="WTK.dir" value="/usr/local/WTK2.2"/>
+ <property name="MIDP.lib" value="${WTK.dir}/lib/midpapi10.jar" />
+ <property name="CLDC.lib" value="${WTK.dir}/lib/cldcapi10.jar" />
+
+ <path id="microbootclasspath">
+ <pathelement path="${MIDP.lib}"/>
+ <pathelement path="${CLDC.lib}"/>
+ </path>
+
+ <path id="microclasspath">
+ </path>
+
+ <target name="microcompile" depends="init">
+ <mkdir dir="microbuild/classes" />
+ <javac destdir="microbuild/classes" srcdir="src" target="1.1">
+ <bootclasspath refid="microbootclasspath"/>
+ <classpath refid="microclasspath"/>
+ </javac>
+ <javac destdir="microbuild/classes" srcdir="micro/src" target="1.1">
+ <bootclasspath refid="microbootclasspath"/>
+ <classpath refid="microclasspath"/>
+ </javac>
+ </target>
+
+ <target name="init" description="Prepare for other tasks">
+ <echo message="Initializing ${ant.project.name}"/>
+ <tstamp/>
+ </target>
+
+<target name="preverify" depends="microcompile">
+ <mkdir dir="microbuild/preverified"/>
+ <exec executable="${WTK.dir}/bin/preverify1.0">
+ <arg line="-classpath ${MIDP.lib}:${CLDC.lib}"/>
+ <arg line="-d microbuild/preverified"/>
+ <arg line="microbuild/classes"/>
+ </exec>
+</target>
+
+<target name="microdist" depends="preverify">
+ <mkdir dir="microbuild/bin"/>
+ <jar basedir="microbuild/preverified"
+ jarfile="microbuild/bin/fc.jar"
+ manifest="micro/bin/MANIFEST.MF">
+ <fileset dir="micro/res"/>
+ </jar>
+ <copy file="micro/bin/fc.jad"
+ tofile="microbuild/bin/fc.jad"/>
+</target>
+
+</project>
Added: trunk/build.micro2.xml
===================================================================
--- trunk/build.micro2.xml (rev 0)
+++ trunk/build.micro2.xml 2007-05-01 09:50:57 UTC (rev 119)
@@ -0,0 +1,23 @@
+<project name="flashcards" default="microdist">
+ <property name="WTK.dir" value="/usr/local/WTK2.2"/>
+ <property name="MIDP.lib" value="${WTK.dir}/lib/midpapi10.jar" />
+ <property name="CLDC.lib" value="${WTK.dir}/lib/cldcapi10.jar" />
+
+ <path id="microbootclasspath">
+ <pathelement path="${MIDP.lib}"/>
+ <pathelement path="${CLDC.lib}"/>
+ </path>
+
+ <path id="microclasspath">
+ </path>
+
+<target name="microdist">
+ <mkdir dir="microbuild/bin"/>
+ <jar basedir="microbuild/preverified"
+ jarfile="${dest.path}/${dest.name}.jar"
+ manifest="${dest.path}/MANIFEST.MF">
+ <fileset dir="${dest.path}/res"/>
+ </jar>
+</target>
+
+</project>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2007-05-01 01:34:17 UTC (rev 118)
+++ trunk/build.xml 2007-05-01 09:50:57 UTC (rev 119)
@@ -72,7 +72,7 @@
== where project is replaced with the name of the project.
== This jar is built to the target.install directory.
=========================================================================-->
- <target name="build" depends="compile, resource, jar.check, keygen" unless="jar.uptodate" description="Run a full build">
+ <target name="build" depends="compile, resource, jar.check, keygen, microcompile" unless="jar.uptodate" description="Run a full build">
<mkdir dir="${target.install}"/>
<jar jarfile="${target.install}/${ant.project.name}.jar" manifest="${target.classes}/org/crosswire/flashcards/flashcards.manifest">
<fileset dir="${target.classes}"/>
@@ -171,5 +171,4 @@
<target name="keygen.check" description="Check the keystore is there">
<available property="keygen.uptodate" file="${keystore.file}"/>
</target>
-
</project>
Added: trunk/genfcmobile.sh
===================================================================
--- trunk/genfcmobile.sh (rev 0)
+++ trunk/genfcmobile.sh 2007-05-01 09:50:57 UTC (rev 119)
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+WORKDIR=fcMobilePackage.$$
+
+echo setting up workspace at $WORKDIR
+mkdir $WORKDIR
+
+echo copying jars
+cp target/install/lessons.jar $WORKDIR
+cp target/install/flashcards.jar $WORKDIR
+cd $WORKDIR
+
+echo unjarring lessons
+jar -xfv lessons.jar
+
+#so we don't find when we run flashcards, below
+mv lessons lessons.orig
+rm lessons.jar
+
+cat > index.html <<!
+<html><head><title>CrossWire</title></head><body><b>Flashcards</b><br/>This is an early release of a micro edition of Flashcards from CrossWire Bible Society. To try it out, click on the link below below:<br/>
+<a href="/fc/FlashcardsMobile.jad">Flashcards - Hebrew</a><br/>
+<a href="/fc/oldphone/FlashcardsMobile.jad">Flashcards(old phones) - Hebrew</a><br/>
+<a href="/fc/test/FlashcardsMobile.jad">Flashcards - Phone Test</a><br/>
+!
+
+echo generating pre-rendered images
+
+for i in `cd lessons.orig; ls`
+do
+ rm -rf res lessons
+ mkdir -p lessons/$i
+ mkdir -p res
+ cd lessons.orig/$i
+ jNum=0;
+ for j in *
+ do
+ cp $j ../../lessons/$i/lesson${jNum}.flash
+ jNum=$(($jNum+1))
+ done
+ cd ../../
+#yeah, I know, it outputs to $HOME/.flashcards, lame. FIXME
+ rm -rf ~/.flashcards/lessons/$i/images
+ jar cf lessons.jar lessons
+ java -cp flashcards.jar org.crosswire.flashcards.LessonManager -genImages
+ mv ~/.flashcards/lessons/$i/images lessons/$i/
+ mv lessons res/
+ rm lessons.jar
+ echo LessonSet0=$i > res/lessons/lessons.properties
+ echo LessonDescription0=$i >> res/lessons/lessons.properties
+ PKGNAME=fc$i
+ sed s/##NAME##/${PKGNAME}/ ../micro/bin/MANIFEST.MF > MANIFEST.MF
+ sed s/##NAME##/${PKGNAME}/ ../micro/bin/fc.jad > ${PKGNAME}.jad
+ cd ..
+ ant -Ddest.path=${WORKDIR} -Ddest.name=${PKGNAME} -f build.micro2.xml
+ cd ${WORKDIR}
+ JARSIZE=`ls -l ${PKGNAME}.jar |cut -f5 -d' '`
+ sed -i s/##SIZE##/${JARSIZE}/ ${PKGNAME}.jad
+ cat >> index.html <<!
+ <a href="/fc/${PKGNAME}.jad">$i</a><br/>
+!
+done
+cat >> index.html <<!
+</body></html>
+!
Property changes on: trunk/genfcmobile.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/micro/bin/MANIFEST.MF
===================================================================
--- trunk/micro/bin/MANIFEST.MF (rev 0)
+++ trunk/micro/bin/MANIFEST.MF 2007-05-01 09:50:57 UTC (rev 119)
@@ -0,0 +1,7 @@
+MIDlet-1: ##NAME##, FlashcardsMobile.png, org.crosswire.flashc
+ ards.mobile.FlashCards
+MIDlet-Name: ##NAME##
+MIDlet-Vendor: CrossWire
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-1.0
Added: trunk/micro/bin/fc.jad
===================================================================
--- trunk/micro/bin/fc.jad (rev 0)
+++ trunk/micro/bin/fc.jad 2007-05-01 09:50:57 UTC (rev 119)
@@ -0,0 +1,8 @@
+MIDlet-1: ##NAME##, FlashcardsMobile.png, org.crosswire.flashcards.mobile.FlashCards
+MIDlet-Jar-Size: ##SIZE##
+MIDlet-Jar-URL: http://crosswire.org/fc/##NAME##.jar
+MIDlet-Name: ##NAME##
+MIDlet-Vendor: CrossWire
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-1.0
More information about the sword-cvs
mailing list