This question is targeted to the JCOP Tools plugin team, about the best way to have a Java Card applet target multiple platforms/JCDK's at the same time.
I have an applet (OpenFIPS201) that targets any JC304 platform historically, but is now being FIPS accredited on the P71D600 specifically. This means that I am binding to libraries specific to the JCOP API bundled with the JCOP tools.
Our intention is to keep supporting not just the P71D600, but also generic JC304, JC305 as well as a version bound to the P60SECID and P71D321. I have a basic platform abstraction that is used to provide the platform-specific functionality, but I am having a problem getting this to work in the Eclipse environment and I believe it may be to do with the JCOP plugin, not Eclipse.
The project structure I am trying to make is:
- src/common/org/openfips201/applet/*.java (the common code making up 95% of codebase)
- src/platform/p71d600/org/openfips201/applet/Platform.java
- src/platform/p71d321/org/openfips201/applet/Platform.java
- src/platform/p60secid/org/openfips201/applet/Platform.java
- src/platform/jc310/org/openfips201/applet/Platform.java
- src/platform/jc305/org/openfips201/applet/Platform.java
- src/platform/jc304/org/openfips201/applet/Platform.java
And then to have a separate Eclipse Java Card project for each platform, which links to both the common and the appropriate platform source folders.
The issues is that this cannot compile, specifically because when a Java Card project has two src folders, the package id for one will clobber the package id for the other and then you get the error: "AID for package org.openfips201.applet already exists". If I set them differently, it compiles but upon any code change anywhere, one of the package id's gets clobbered again.
I would be interested in what the NXP approach to this, or if anyone out there in the community has had a similar setup?