-
Notifications
You must be signed in to change notification settings - Fork 5
Building example project
Before we can start building, we need to clone a example project repository:
- Windows - use Git Bash (Start → Git → Git Bash)
- Ubuntu - use normal terminal
$ git clone --recurse-submodules [email protected]:mclear/OMNI-Ring.git
This repository is using a oracle_javacard_sdks git submodule created by Martin Paljak. It’s all the Javacard SDK versions packaged into single repository to ease the toolchain setup. That's why we use --recurse-submodules flag to pull submodule code as well as our example project.
Once git finished pulling all the code from the GitHub repository, you should end up with following project structure:
- /src/ - source files
- MyApplet.java - example applet source code
- /sdks/ - oracle_javacard_sdks submodule
- multiple folders using the name format of jcXXX_kit, where XXX’s are the Javacard versions
- /build.xml - ANT build configuration file
There is one more utility we need to download before we can successfully build our example project.
Download ant-javacard.jar from ant-javacard repository release page and put it in the project root folder (where the build.xml is).
Now we can try to build the project. To do so, open a terminal and navigate to the folder where build.xml is located and run the following command:
$ ant build
The ant
should generate the similar output:
lm@lm-VirtualBox:~/dev-ring-getting-started$ ant build
Buildfile: /home/lm/dev-ring-getting-started/build.xml
build:
[cap] INFO: using JavaCard 3.0.1 SDK in sdks/jc303_kit
[cap] INFO: Setting package name to ExampleProject
[cap] Building CAP with 1 applet from package ExampleProject (AID: 0102030405)
[cap] ExampleProject.MyApplet 0102030405060708
[compile] Compiling files from /home/lm/dev-ring-getting-started/src
[compile] Compiling 1 source file to /tmp/jccpro9900755542760480669
[convert] [ INFO: ] Converter [v3.0.3]
[convert] [ INFO: ] Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
[convert]
[convert]
[convert] [ INFO: ] conversion completed with 0 errors and 0 warnings.
[javacard] NB! Please use JavaCard SDK 3.0.5u3 or later for verifying!
[verify] Verification passed
[cap] CAP saved to /home/lm/dev-ring-getting-started/MyApplet.cap
BUILD SUCCESSFUL
Total time: 1 second
To double-confirm successful build, check that the MyApplet.cap exists in project root folder.