diff --git a/README.md b/README.md index 13d5dee..f61e0ad 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,13 @@ resource consumption by tweaking the following variables: - Execute `ant` with no parameter will produce the CAP file in `build/fr/anssi/smartpgp/javacard/smartpgp.cap`. +## Building the CAP file with Gradle + +- Set path to the JavaCard Development Kit: + `export JC_HOME="your/path/to/javacardkit"` + +- Execute `gradle convertJavacard`. It will produce the CAP file in + `build/fr/anssi/smartpgp/javacard/smartpgp.cap`. ## Installing the CAP file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6d25d51 --- /dev/null +++ b/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'javacard' + +buildscript { + repositories { + maven { url 'http://releases.marmeladburk.fidesmo.com/' } + } + + dependencies { + classpath 'com.fidesmo:gradle-javacard:0.2.7' + } +} + +javacard { + sdkVersion = '3.0.4' + + cap { + aid = '0xd2:0x76:0x00:0x01:0x24:0x01' + packageName = 'fr.anssi.smartpgp' + applet { + aid = '0xd2:0x76:0x00:0x01:0x24:0x01:0x03:0x03:0xAF:0xAF:0x00:0x00:0x00:0x00:0x00:0x00' + className = 'SmartPGPApplet' + } + version = '1.0' + } +} + +/* Change source sets to be compatible with the original project layout. */ +sourceSets { + main { + java { + srcDir 'src' + } + } +}