Download Java Card Ant Tasks User Guide

Transcript
CODE EXAMPLE 6-1
build.xml (Continued)
CrefExe="${jcardkit_home}/bin/cref.exe"
CapFile="${classroot}/com/sun/javacard/samples/SampleLibrary/javacard/SampleLibrary.cap" >
<classpath refid="classpath"/>
</deploycap>
</target>
<!-- Deploy JavaPurse using the resulting EEPROM image from deploying SampleLibrary -->
<target name="deploy_java_purse" depends="convert_purse, deploy_sample_library" >
<deploycap
inEEFile="${samples.eeprom}/EEFile"
outEEFile="${samples.eeprom}/EEFile"
CrefExe="${jcardkit_home}/bin/cref.exe"
CapFile="${classroot}/com/sun/javacard/samples/JavaPurse/javacard/JavaPurse.cap" >
<classpath refid="classpath"/>
</deploycap>
</target>
<!-- Now that JavaPurse is deployed we can run our test script -->
<target name="run_test_script" depends="deploy_java_purse" >
<apdutool
scriptFile="${samples.scripts}/testpurse.scr"
inEEFile="${samples.eeprom}/EEFile"
outEEFile="${samples.eeprom}/EEFile"
CheckDownloadFailure="false"
CrefExe="${jcardkit_home}/bin/cref.exe">
<classpath refid="classpath"/>
</apdutool>
</target>
<!-- Clean output directories -->
<target name="clean">
<delete dir="${classroot}" />
<delete dir="${samples.eeprom}" />
</target>
<!-- Clean, compile, convert, verify, deploy cap files and run test script -->
<target name="all" depends="clean, run_test_script" />
</project>
The following code example is for testpurse.scr.
CODE EXAMPLE 6-2
testpurse.scr
//+
// Copyright 2005 Sun Microsystems, Inc. All rights reserved.
//powerup;
echo "****Select the installer applet";
0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
// 90 00 = SW_NO_ERROR
echo "****create JavaPurse";
0x80 0xB8 0x00 0x00 0x0c 0x0a 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x0c 0x2 0x01 0x00 0x7F;
42
Ant Tasks User’s Guide, Java Card Platform, Version 2.2.2 • March 2006