Refactor script files for multi-applet projects

This commit is contained in:
Manuel Thalmann 2023-11-03 15:50:46 +01:00
parent 300aec6d85
commit 6ef2140509
17 changed files with 50 additions and 37 deletions

4
scripts/compile.cmd Normal file
View file

@ -0,0 +1,4 @@
:: compile applet with JcDK 2.2.2
CALL %~dp0setup.cmd
javac -g -target 1.1 -source 1.2 -cp %JC_HOME%\lib\api.jar -d . %~dp0../%PACKAGE%/src/%PACKAGE%/*.java
converter -exportpath "%JC_HOME%\api_export_files" -applet 0x01:0x02:0x03:0x04:0x5:0x6:0x8:0x9 %PACKAGE%.%APPLET% %PACKAGE% 0x01:0x02:0x03:0x04:0x5:0x6:0x8 1.0

2
scripts/delete.cmd Normal file
View file

@ -0,0 +1,2 @@
CALL %~dp0setup.cmd
gp --delete %ID%

5
scripts/flash.cmd Normal file
View file

@ -0,0 +1,5 @@
CALL %~dp0setup.cmd
CALL %~dp0compile.cmd
:: "-f" forces overwriting old versions of the package
gp --install %~dp0..\%PACKAGE%\javacard\%PACKAGE%.cap --params %PARAMS% -f

2
scripts/list.cmd Normal file
View file

@ -0,0 +1,2 @@
CALL %~dp0setup.cmd
gp --list

16
scripts/setup.cmd Normal file
View file

@ -0,0 +1,16 @@
:: Common Environment Variables
@echo off
:: To be defined externally
SET "PACKAGE=%PACKAGE%"
SET "APPLET=%APPLET%"
SET "PARAMS=%PARAMS%"
SET "JAVA8_HOME=%JAVA8_HOME%"
SET "JC_HOME=%JC_HOME%"
SET HEXID=0x01:0x02:0x03:0x04:0x5:0x6:0x8:0x9
SET ID=%HEXID:0x0=0%
SET ID=%ID:0x=0%
SET ID=%ID::=%
SET "JAVA_HOME=%JAVA8_HOME%"
SET "PATH=%JAVA_HOME%\bin;%JC_HOME%\bin;%JC_HOME%\..;%JC_HOME%\..\GPShell-1.4.4;%PATH%"

2
scripts/test.cmd Normal file
View file

@ -0,0 +1,2 @@
CALL %~dp0setup.cmd
gpshell %~dp0..\%PACKAGE%\tests\%APPLET%.txt