[Pcsclite-cvs-commit] MCardApplet Java.conf,NONE,1.1 DocGenerate.sh,NONE,1.1 Compile.sh,1.2,1.3 Convert.sh,1.2,1.3 Verify.sh,1.2,1.3

rousseau@quantz.debian.org rousseau@quantz.debian.org
Wed, 19 Nov 2003 13:53:25 +0100


Update of /cvsroot/muscleplugins/MCardApplet
In directory quantz:/tmp/cvs-serv11264a

Modified Files:
	Compile.sh Convert.sh Verify.sh 
Added Files:
	Java.conf DocGenerate.sh 
Log Message:
use config file Java.conf


--- NEW FILE: Java.conf ---
#!/bin/sh

#    Java.conf: set PATH and comand line tools for Java and JavaCard
#    Copyright (C) 2002-2003  Ludovic Rousseau <ludovic.rousseau@free.fr>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# System dependent data
JAVA_HOME=${JAVA_HOME:-/usr/local/tools/java/j2sdk_nb/j2sdk1.4.2}
export JAVA_HOME

JAVAC=$JAVA_HOME/bin/javac
JAVADOC=$JAVA_HOME/bin/javadoc

JC21=${JC21:-/usr/local/tools/java/java_card_kit-2_1_2}
JC21BIN=$JC21/bin
APIDIR=$JC21/api21_export_files

CONVERTER=$JC21BIN/converter
CAPGEN=$JC21BIN/capgen
VERIFYCAP=$JC21BIN/verifycap

function ConvertDotInSlash
{
	echo $1 | sed -e 's/\./\//g'
}


--- NEW FILE: DocGenerate.sh ---
#!/bin/sh

rm -rf doc
mkdir doc
cd doc

SRCDIR=../src/com/musclecard/CardEdge
SOURCES=$(echo $SRCDIR/{ObjectManager,MemoryManager,CardEdge}.java)

source ../Java.conf

ARGS="-private -sourcepath $APIDIR -version -author -nodeprecated"

# print executed commands
set -x

$JAVADOC $ARGS $SOURCES


Index: Compile.sh
===================================================================
RCS file: /cvsroot/muscleplugins/MCardApplet/Compile.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Compile.sh	7 Jan 2003 21:40:01 -0000	1.2
+++ Compile.sh	19 Nov 2003 12:53:23 -0000	1.3
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #    Compile.sh, script to compile a javacard applet
-#    Copyright (C) 2002  Ludovic Rousseau <ludovic.rousseau@free.fr>
+#    Copyright (C) 2002-2003  Ludovic Rousseau <ludovic.rousseau@free.fr>
 #
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -17,21 +17,21 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# $Id$
-
-APPLET_SRC=$(pwd)/src/*.java
+APPLET_SRC=$(pwd)/src/com/musclecard/CardEdge/*.java
 OUTPUT_DIR=./out
 
-# System dependent data
-JAVA_HOME=${JAVA_HOME:-/usr/local/tools/jdk/j2sdk1.3.1}
-export JAVA_HOME
+source Java.conf
 
-JC21=${JC21:-/usr/local/tools/JavaCard/java_card_kit-2_1_2}
+# exit if error
+set -e
 
-JAVAC=$JAVA_HOME/bin/javac
+if [ ! -d "$OUTPUT_DIR" ]
+then
+	mkdir "$OUTPUT_DIR"
+fi
 
 # print executed commands
 set -x
 
-$JAVAC -verbose -classpath $JC21/lib/api21.jar -g -d $OUTPUT_DIR $APPLET_SRC
+$JAVAC -verbose -classpath $JC21/lib/api21.jar -g -d "$OUTPUT_DIR" $APPLET_SRC
 

Index: Convert.sh
===================================================================
RCS file: /cvsroot/muscleplugins/MCardApplet/Convert.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Convert.sh	7 Jan 2003 21:40:01 -0000	1.2
+++ Convert.sh	19 Nov 2003 12:53:23 -0000	1.3
@@ -17,8 +17,6 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# $Id$
-
 # Applet dependent data
 PACKAGE_AID="0xA0:00:00:00:01"
 APPLET_AID=$PACKAGE_AID:01
@@ -27,23 +25,14 @@
 
 OUTPUT_DIR=./out
 
-
-# System dependent data
-JAVA_HOME=${JAVA_HOME:-/usr/local/tools/jdk/j2sdk1.3.1}
-export JAVA_HOME
-
-JC21=${JC21:-/usr/local/tools/JavaCard/java_card_kit-2_1_2}
-JC21BIN=$JC21/bin
-
-CONVERTER=$JC21BIN/converter
-CAPGEN=$JC21BIN/capgen
+source Java.conf
 
 # applet name with '.' converted in '/'
-# com.sun.javacard.samples.CardEdge -> com/sun/javacard/samples/CardEdge
-APPLET_SLASH=$(echo $APPLET | sed -e 's/\./\//g' )
+# com.musclecard.CardEdge -> com/musclecard/CardEdge
+APPLET_SLASH=$(ConvertDotInSlash $APPLET)
 
 # last element of applet name
-# com.sun.javacard.samples.CardEdge -> CardEdge
+# com.musclecard.CardEdge -> CardEdge
 APPLET_NAME=$(basename $APPLET_SLASH)
 
 # exit on the first error

Index: Verify.sh
===================================================================
RCS file: /cvsroot/muscleplugins/MCardApplet/Verify.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Verify.sh	7 Jan 2003 21:40:01 -0000	1.2
+++ Verify.sh	19 Nov 2003 12:53:23 -0000	1.3
@@ -17,26 +17,17 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-# $Id$
-
 # Applet dependent data
 APPLET=com.musclecard.CardEdge
 
 OUTPUT_DIR=./out
 
 
-# System dependent data
-JAVA_HOME=${JAVA_HOME:-/usr/local/tools/jdk/j2sdk1.3.1}
-export JAVA_HOME
-
-JC21=${JC21:-/usr/local/tools/JavaCard/java_card_kit-2_1_2}
-JC21BIN=$JC21/bin
-
-VERIFYCAP=$JC21BIN/verifycap
+source Java.conf
 
 # applet name with '.' converted in '/'
 # com.sun.javacard.samples.CardEdge -> com/sun/javacard/samples/CardEdge
-APPLET_SLASH=$(echo $APPLET | sed -e 's/\./\//g' )
+APPLET_SLASH=$(ConvertDotInSlash $APPLET)
 
 # last element of applet name
 # com.sun.javacard.samples.CardEdge -> CardEdge
@@ -45,10 +36,10 @@
 # print executed commands
 set -x
 
-$VERIFYCAP -verbose $JC21/api21_export_files/java/lang/javacard/lang.exp \
-  $JC21/api21_export_files/javacard/framework/javacard/framework.exp \
-  $JC21/api21_export_files/javacardx/crypto/javacard/crypto.exp \
-  $JC21/api21_export_files/javacard/security/javacard/security.exp \
+$VERIFYCAP -verbose $APIDIR/java/lang/javacard/lang.exp \
+  $APIDIR/javacard/framework/javacard/framework.exp \
+  $APIDIR/javacardx/crypto/javacard/crypto.exp \
+  $APIDIR/javacard/security/javacard/security.exp \
   \
   $OUTPUT_DIR/$APPLET_SLASH/javacard/$APPLET_NAME.exp \
   $OUTPUT_DIR/$APPLET_SLASH/javacard/$APPLET_NAME.jar