I’m facing an issue using ProGuard for an Add-On Library project.
I’m getting the following error at the end of the build process of my library:
BUILD FAILED
Found an error when building my-library
* Where
File : C:\Program Files\MicroEJ\MicroEJ-SDK-21.11\rcp\configuration\org.eclipse.osgi\528\data\repositories\microej-build-repository\com\is2t\easyant\plugins\obf-proguard\3.0.0\obf-proguard-3.0.0.ant
Line : 75 column : 151
* Problem Report:
The output jar is empty. Did you specify the proper '-keep' options?
* Recommendation...
Run easyant with -verbose or -debug option to get more details.
Total time: 4 seconds
Some information about my environment:
I added the following line in my module.ivy to use ProGuard: <ea:plugin organisation="com.is2t.easyant.plugins" module="obf-proguard" revision="3.0.0"/>
Looks like Proguard did shrink all types, resulting in an empty output jar. According to the information that you provided, you are missing a file defining the Proguard rules to use. As a consequence, Proguard will apply the default rules. The official Proguard documentation states that “by default, ProGuard shrinks the code: it removes all unused classes and class members. It only keeps the ones listed by the various -keep options, and the ones on which they depend, directly or indirectly.”.
To provide custom rules, you can add them in a file named “module.pro” file at the root of your project.
Note that you can check how Proguard renamed your types and methods by looking at the file target~/build-env/[mymodule].renamelog at the end of the build.