Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from JavaCardSpot-dev/pullrequest/build
Browse files Browse the repository at this point in the history
Add gradle build + Travis CI + codecov
  • Loading branch information
Nicolas Bacca authored Jun 11, 2018
2 parents d2cc7b1 + 6d8ef89 commit 8493f8e
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gradle/
build/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libs-sdks"]
path = libs-sdks
url = https://github.com/martinpaljak/oracle_javacard_sdks.git
[submodule "libs"]
path = libs
url = https://github.com/J08nY/javacard-libs
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: java

jdk:
- oraclejdk8

script:
- ./gradlew check --info
- ./gradlew buildJavaCard --info
- ./gradlew jacocoTestReport

after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Ledger U2F Applet
=================

[![Build status](https://travis-ci.org/LedgerHQ/ledger-u2f-javacard.svg?branch=master)](https://travis-ci.org/LedgerHQ/ledger-u2f-javacard) [![Codecov](https://img.shields.io/codecov/c/github/ledgerhq/ledger-u2f-javacard.svg)](https://codecov.io/gh/ledgerhq/ledger-u2f-javacard)

# Overview

This applet is a Java Card implementation of the [FIDO Alliance U2F standard](https://fidoalliance.org/)
Expand Down
99 changes: 84 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,96 @@
apply plugin: 'javacard'
group 'ledger-u2f-javacard'
version '1.0-SNAPSHOT'

// Buildscript configuration for the javacard-gradle plugin.
// Do not modify this particular block. Dependencies for the project are lower.
buildscript {
repositories {
maven { url 'http://snapshots.marmeladburk.fidesmo.com/' }
mavenCentral()
}

dependencies {
classpath 'com.fidesmo:gradle-javacard:0.2.7-SNAPSHOT'
classpath 'com.klinec:gradle-javacard:1.5.5'
}
}

apply plugin: 'javacard'
apply plugin: 'jacoco'
sourceCompatibility = 1.7

// Common settings, definitions
final def rootPath = rootDir.absolutePath
final def libs = rootPath + '/libs'
final def libsSdk = rootPath + '/libs-sdks'

// Repositories for your project
repositories {
mavenCentral()
// mavenLocal() // for local maven repository if needed
flatDir {
dirs libs
}
}

// Dependencies for your project
dependencies {
// testCompile group: 'junit', name: 'junit', version: '4.12'
// testCompile 'org.testng:testng:6.1.1'

jcardsim 'com.licel:jcardsim:3.0.4'
}

test {
useTestNG()
jvmArgs '-noverify'
}

// JavaCard SDKs and libraries
final def JC212 = libsSdk + '/jc212_kit'
final def JC221 = libsSdk + '/jc221_kit'
final def JC222 = libsSdk + '/jc222_kit'
final def JC303 = libsSdk + '/jc303_kit'
final def JC304 = libsSdk + '/jc304_kit'
final def JC305 = libsSdk + '/jc305u1_kit'

// Which JavaCard SDK to use - select
final def JC_SELECTED = JC304

javacard {

sdkVersion = '3.0.2'

cap {
aid = '0xa0:0x00:0x00:0x06:0x17:0x00:0x4f:0x97:0xa2:0xe9:0x50:0x01'
packageName = 'com.ledger.u2f'
applet {
aid = '0xa0:0x00:0x00:0x06:0x17:0x00:0x4f:0x97:0xa2:0xe9:0x49:0x01'
className = 'U2FApplet'
}
version = '1.1'
}
//noinspection GroovyAssignabilityCheck
config {
jckit JC_SELECTED

// JCardSim automatically added by the javacard-gradle plugin
addSurrogateJcardSimRepo true
addImplicitJcardSim true
addImplicitJcardSimJunit true

//noinspection GroovyAssignabilityCheck
cap {
packageName 'com.ledger.u2f'
version '1.1'
aid '0xa0:0x00:0x00:0x06:0x17:0x00:0x4f:0x97:0xa2:0xe9:0x50:0x01'
output 'ledger-u2f.cap'

//noinspection GroovyAssignabilityCheck
applet {
className 'U2FApplet'
aid '0xa0:0x00:0x00:0x06:0x17:0x00:0x4f:0x97:0xa2:0xe9:0x49:0x01'
}

//noinspection GroovyAssignabilityCheck
dependencies {
remote 'fr.bmartel:gplatform:2.1.1'
}
}
}
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}

check.dependsOn jacocoTestReport
Binary file removed cap/ledger-u2f.cap
Binary file not shown.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 13 13:45:49 CEST 2014
#Sun Dec 10 20:07:32 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
1 change: 1 addition & 0 deletions libs
Submodule libs added at 6bda0b
1 change: 1 addition & 0 deletions libs-sdks
Submodule libs-sdks added at 2b3694

0 comments on commit 8493f8e

Please sign in to comment.