Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 46 additions & 41 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,36 @@ Usage
Include the new version of the plugin from OSS Sonatype snapshot by adding the following to your
`build.gradle`:

apply plugin: 'javacard'
```groovy
apply plugin: 'javacard'

buildscript {
buildscript {

repositories {
maven { url 'http://releases.marmeladburk.fidesmo.com/' }
}

dependencies {
classpath 'com.fidesmo:gradle-javacard:0.2.7'
}
repositories {
maven { url 'http://releases.marmeladburk.fidesmo.com/' }
}

javacard {
/* Specify which version of the JavaCard SDK should be used
to build this project. Supported: 2.2.? and 3.0.? */
sdkVersion = "3.0.4"

cap {
aid = '0x12:0x34:0x00:0x00:0x00:0x01'
packageName = 'com.example.my.jc.code'
applet {
aid = '0x12:0x34:0x00:0x00:0x00:0x01:0x01'
className = 'ClassImplementingApplet'
}
version = '1.0'
dependencies {
classpath 'com.fidesmo:gradle-javacard:0.2.7'
}
}

javacard {
/* Specify which version of the JavaCard SDK should be used
to build this project. Supported: 2.2.? and 3.0.? */
sdkVersion = "3.0.4"

cap {
aid = '0x12:0x34:0x00:0x00:0x00:0x01'
packageName = 'com.example.my.jc.code'
applet {
aid = '0x12:0x34:0x00:0x00:0x00:0x01:0x01'
className = 'ClassImplementingApplet'
}
version = '1.0'
}

}
```

### Installing the Java Card Development Kit

Expand All @@ -58,12 +59,14 @@ Card Development Kit 2.x.x` under MacOSx, Windows and Linux. The development kit
[Website](https://www.oracle.com/technetwork/java/embedded/javacard/downloads/javacard-sdk-2043229.html)
and must be unpacked

# Assumes file to be downloaded as java_card_kit-2_2_2-linux.zip
unzip java_card_kit-2_2_2-linux.zip
cd java_card_kit-2_2_2/
unzip java_card_kit-2_2_2-rr-bin-linux-do.zip
unzip java_card_kit-2_2_2-rr-ant-tasks.zip
export JC_HOME="${PWD}/java_card_kit-2_2_2"
```bash
# Assumes file to be downloaded as java_card_kit-2_2_2-linux.zip
unzip java_card_kit-2_2_2-linux.zip
cd java_card_kit-2_2_2/
unzip java_card_kit-2_2_2-rr-bin-linux-do.zip
unzip java_card_kit-2_2_2-rr-ant-tasks.zip
export JC_HOME="${PWD}/java_card_kit-2_2_2"
```

### Convert applications to Java Card

Expand All @@ -79,11 +82,12 @@ To add external exp files to your build, add a dependencies section to your grad
corresponding paths to the javacardExport configuration. Usually you also will need to add some
classes in order to compile your java code to class files.

dependencies {
compile files('../path/to/class/files/dir')
javacardExport files('../path/to/exp/files/dir')
}

```groovy
dependencies {
compile files('../path/to/class/files/dir')
javacardExport files('../path/to/exp/files/dir')
}
```

### Support for testing with jcardsim

Expand All @@ -92,14 +96,15 @@ testing with jcardsim easier. To properly setup testing with jcardsim you have t
maven repositories to your build.gradle and configure the testCompile configuration to include
jcardsim in the version you want.

repositories {
mavenCentral()
}

dependencies {
testCompile 'com.licel:jcardsim:2.2.2'
}
```groovy
repositories {
mavenCentral()
}

dependencies {
testCompile 'com.licel:jcardsim:2.2.2'
}
```

If you follow the above the plugin will filter the runtime classpath of the test source set (usually
the classes you have under /src/test). The aim is to remove the lib/api.jar from the javacard sdk in
Expand Down