I've a project that has a lot of libraries to it, for a total of 25135 visible in the classpath, now I'm having proguard only keep 1 class, which has no dependencies at all on anything (it's a trivial java class with a main that only does System.out.println("hello world")). The resulting jar nevertheless, is keeping 1076 classes, none of them make sense, and when using -whyareyoukeeping on any of them, the processing time multiplies by 100 (it ends up taking like 30 minutes, instead of ~40.
The justification for keeping the class is
monix.execution.Scheduler
is kept by a directive in the configuration.
but my directives, as shown by the printseeds is
randomstuff.SimpleMain
I can check via decompilation of my trivial java class that it really has no dependencies on anything else, and the injars and libraries parameters are correctly generated.
The classes that are being kept, all belong to some scala libraries I have in the classpath, though only some classes of some libraires are being kept (it's not even consistent). Here's the code of SmpleMain
package randomstuff;
public class SimpleMain {
public static void main(String[] args) {
System.out.println("hello world");
}
}
Attached are configuration file as well as output from proguard
Errata (because I can't seem to be able to edit the original post):
This can only happen if you have more ProGuard configuration outside of your own configuration file. Are you running ProGuard by itself or as part of a build system? Can the build system be adding options? You can check with
The configuration file is generated by a build tool, nevertheless I've inspected it myself and played with it, and I can run proguard directly with that configuration file and I still observe this behaviour.
Would you be able to share the configuration with us for inspection?
The attachment I included in the original report: "proguardoutput", is a text file that has the configuration at the beginning, and after that (separated with some blank lines and a line of equal signs) comes the log.