forked from Yubico/ykneo-openpgp
-
Notifications
You must be signed in to change notification settings - Fork 1
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
use ant-javacard for compilation #2
Open
pepegar
wants to merge
2
commits into
master
Choose a base branch
from
use-ant-javacard
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<project name="ykneo-openpgp" default="convert" basedir="." xmlns:jacoco="antlib:org.jacoco.ant"> | ||
<project name="ykneo-openpgp" default="applet" basedir="."> | ||
<get src="https://github.com/martinpaljak/ant-javacard/releases/download/v1.6/ant-javacard.jar" dest="."/> | ||
<description>Ant build for ykneo-openpgp applet</description> | ||
<property name="src" location="applet/src"/> | ||
<property name="build" location="applet/bin"/> | ||
<property name="test.src" location="test/test"/> | ||
<property name="test.build" location="test/bin"/> | ||
<property name="test.lib" location="test/lib"/> | ||
<!-- Load user specified extra properties --> | ||
<property file="${user.home}/javacard.properties"/> | ||
<property name="JAVA_PACKAGE" value="openpgpcard"/> | ||
<property name="JAVA_PACKAGE_DIR" value="openpgpcard/"/> | ||
<property name="APPLET_NAME" value="OpenPGPApplet"/> | ||
<property name="PACKAGE_AID" value="0xd2:0x76:0x00:0x01:0x24:0x01"/> | ||
<property name="APPLET_AID" value="0xd2:0x76:0x00:0x01:0x24:0x01:0x02:0x00:0x00:0x00:0x00:0x00:0x00:0x01:0x00:0x00"/> | ||
<property name="VERSION" value="0.1"/> | ||
<target name="init"> | ||
<mkdir dir="${build}"/> | ||
<mkdir dir="${test.build}/output"/> | ||
</target> | ||
<target name="compile" depends="init" description="compile the source" unless="test.build.mock"> | ||
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" source="1.5" target="1.5"> | ||
<classpath> | ||
<pathelement path="${JAVACARD_HOME}/lib/api.jar"/> | ||
</classpath> | ||
</javac> | ||
</target> | ||
<target name="compileMock" depends="init" description="compile with mocked javacard" if="test.build.mock"> | ||
<javac srcdir="${src}" destdir="${build}" source="1.2" target="1.1" includeantruntime="false" debug="yes"> | ||
<classpath> | ||
<fileset dir="${test.lib}"> | ||
<include name="*.jar"/> | ||
</fileset> | ||
</classpath> | ||
</javac> | ||
</target> | ||
<target depends="compile" name="convert" description="convert to .cap" unless="test.build.mock"> | ||
<java classname="com.sun.javacard.converter.Converter" fork="true" failonerror="true"> | ||
<arg line="-classdir ${build}"/> | ||
<arg line="-verbose"/> | ||
<arg line="-exportpath ${JAVACARD_HOME}/api_export_files"/> | ||
<arg line="-out CAP JCA EXP"/> | ||
<arg line="-applet ${APPLET_AID} ${APPLET_NAME}"/> | ||
<arg line="${JAVA_PACKAGE} ${PACKAGE_AID} ${VERSION}"/> | ||
<classpath> | ||
<pathelement location="${JAVACARD_HOME}/lib/converter.jar"/> | ||
<pathelement location="${JAVACARD_HOME}/lib/offcardverifier.jar"/> | ||
</classpath> | ||
</java> | ||
</target> | ||
<target name="clean" description="clean up"> | ||
<delete dir="${build}"/> | ||
<delete dir="${test.build}"/> | ||
</target> | ||
<target name="compileTest" depends="compile,compileMock"> | ||
<javac srcdir="${test.src}" destdir="${test.build}" includeantruntime="false"> | ||
<classpath> | ||
<pathelement path="${build}"/> | ||
<pathelement location="/usr/share/java/junit4.jar"/> | ||
<fileset dir="${test.lib}"> | ||
<include name="*.jar"/> | ||
</fileset> | ||
</classpath> | ||
</javac> | ||
</target> | ||
<target name="test" description="run tests" depends="compileTest"> | ||
<junit printSummary="no" fork="yes" failureproperty="junit.failure"> | ||
<classpath> | ||
<pathelement location="${test.build}"/> | ||
<pathelement path="${build}"/> | ||
<pathelement location="/usr/share/java/junit4.jar"/> | ||
<fileset dir="${test.lib}"> | ||
<include name="*.jar"/> | ||
</fileset> | ||
</classpath> | ||
<formatter type="plain" usefile="false" /> | ||
<formatter type="plain" /> | ||
<batchtest todir="${test.build}/output"> | ||
<fileset dir="${test.src}" includes="**/*.java" /> | ||
</batchtest> | ||
</junit> | ||
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/> | ||
</target> | ||
<target name="coverage" description="run tests with coverage" depends="compileTest"> | ||
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml"> | ||
<classpath> | ||
<fileset dir="${test.lib}"> | ||
<include name="*.jar"/> | ||
</fileset> | ||
</classpath> | ||
</taskdef> | ||
<jacoco:coverage> | ||
<junit printSummary="no" fork="yes" failureproperty="junit.failure"> | ||
<classpath> | ||
<pathelement location="${test.build}"/> | ||
<pathelement path="${build}"/> | ||
<pathelement location="/usr/share/java/junit4.jar"/> | ||
<fileset dir="${test.lib}"> | ||
<include name="*.jar"/> | ||
</fileset> | ||
</classpath> | ||
<formatter type="plain" usefile="false" /> | ||
<formatter type="plain" /> | ||
<batchtest todir="${test.build}/output"> | ||
<fileset dir="${test.src}" includes="**/*.java" /> | ||
</batchtest> | ||
</junit> | ||
</jacoco:coverage> | ||
<jacoco:report> | ||
<executiondata> | ||
<file file="jacoco.exec"/> | ||
</executiondata> | ||
<structure name="ykneo-openpgp project"> | ||
<classfiles> | ||
<fileset dir="applet/bin"/> | ||
</classfiles> | ||
<sourcefiles encoding="UTF-8"> | ||
<fileset dir="applet/src"/> | ||
</sourcefiles> | ||
</structure> | ||
<xml destfile="jacoco.xml"/> | ||
<html destdir="jacoco"/> | ||
</jacoco:report> | ||
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/> | ||
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ant-javacard.jar"/> | ||
<target name="applet"> | ||
<javacard> | ||
<cap aid="A0:00:00:06:17:00:EC:5E:FF:D8" output="PGP.cap" sources="applet/src"> | ||
<applet class="openpgpcard.OpenPGPApplet" aid="A0:00:00:06:17:00:EC:5E:FF:D8:00:00:00:01:00:00"/> | ||
</cap> | ||
</javacard> | ||
</target> | ||
</project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are changing the default applet AID. Is this intentional? IIRC gpg is picky about AID-s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is intentional due to the way our platform handles AIDs: we only allow AIDs composed of:
our RID || application ID assigned to the service provider || custom suffix
We allow exceptions for instance AIDs, but not for ELFs or LMs. A longer explanation is here.