diff --git a/build.gradle b/build.gradle index d7ca5ff4d..43545453c 100644 --- a/build.gradle +++ b/build.gradle @@ -86,6 +86,10 @@ subprojects { } } + task licenseFile { + outputs.file(project.parent.file('LICENSE.txt')) + } + task dependencySearch(type: DependencyInsightReportTask) { description 'Searches all projects for a dependency' group 'help' @@ -102,6 +106,25 @@ subprojects { } } } + + // copied from https://stackoverflow.com/a/38058671/568723 + task depSize { + description 'Lists all dependencies sorted by their size' + doLast { + final formatStr = "%,10.2f" + final conf = configurations.default + final size = conf.collect { it.length() / (1024 * 1024) }.sum() + final out = new StringBuffer() + out << 'Total dependencies size:'.padRight(45) + out << "${String.format(formatStr, size)} Mb\n\n" + conf.sort { -it.length() } + .each { + out << "${it.name}".padRight(45) + out << "${String.format(formatStr, (it.length() / 1024))} kb\n" + } + println(out) + } + } } apply from: 'build.publishing.gradle' diff --git a/okapi-shade/build.gradle b/okapi-shade/build.gradle index 7e071c54f..ca885049e 100644 --- a/okapi-shade/build.gradle +++ b/okapi-shade/build.gradle @@ -64,11 +64,15 @@ shadowJar { exclude(dependency("$it:")) } } + exclude "META-INF/maven/org.apache*/**" exclude "META-INF/versions/**/*" exclude "META-INF/services/**/*" exclude "META-INF/NOTICE*" exclude "META-INF/LICENSE*" + exclude "META-INF/DEPENDENCIES*" exclude "utf8.json" + + metaInf { from tasks.licenseFile } } assemble.dependsOn shadowJar