Open epeee opened 6 years ago
@epeee Maybe you can read somehow Bintray plugin property to avoid duplication? @mockitoguy any hint?
Any updates on this one?
Bump?
Looking at it. I met @epeee at CodeOne conference and he mentioned that his PR needs bump. @jpkrohling, sorry for slow turnaround! I'm on it.
Hey @epeee, I will review and provide my feedback shortly. In the meantime, I commented on the ticket so that @jpkrohling is unblocked and can customize the pom.
I found a hack how to get license info from bintray configuration. @epeee @mockitoguy WDYT?
Object bintray = project.getExtensions().findByName("bintray");
try {
Method getPkg = bintray.getClass().getDeclaredMethod("getPkg");
getPkg.setAccessible(true);
Object pkg = getPkg.invoke(bintray);
Field licensesField = pkg.getClass().getDeclaredField("licenses");
licensesField.setAccessible(true);
String[] licenses = (String[]) licensesField.get(pkg);
for (String license : licenses) {
LOG.lifecycle(" lic " + license);
}
} catch (Exception e) {
e.printStackTrace();
}
I found a hack how to get license info from bintray configuration
Please no :) That's a lot of complexity for little benefit.
It's a simple reflection ;-) But as you wish!
Once we merge it, can we get the license value populated to the Bintray extension, too? Thanks!!! Nice change!
Before merging, we need to add defaults (as my comment) or make it "lenient". I suggest to add defaults because it is simpler and more useful. Then we can merge :) Let me know when you're ready!
Very first draft (#755).
This pr extends shipkit configuration in a way that we have to configure the license used (incl url now).
This will end up in a pom like
The downside of this approach is that we still have to configure the license used by gradle bintray plugin, e.g.:
We could add this one also to shipkit config and do the configuration in our gradle plugin. As a result we'd have the license config in one place.
Note: this is a breaking change and will cause builds without a shipkit.licenseInfo configuration to fail: