Skip to content

Commit 1dc2580

Browse files
authored
Merge pull request #921 from s1ck/master
Remove org.apache related pom files from META-INF
2 parents a255e32 + ae08812 commit 1dc2580

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ subprojects {
8686
}
8787
}
8888

89+
task licenseFile {
90+
outputs.file(project.parent.file('LICENSE.txt'))
91+
}
92+
8993
task dependencySearch(type: DependencyInsightReportTask) {
9094
description 'Searches all projects for a dependency'
9195
group 'help'
@@ -102,6 +106,25 @@ subprojects {
102106
}
103107
}
104108
}
109+
110+
// copied from https://stackoverflow.com/a/38058671/568723
111+
task depSize {
112+
description 'Lists all dependencies sorted by their size'
113+
doLast {
114+
final formatStr = "%,10.2f"
115+
final conf = configurations.default
116+
final size = conf.collect { it.length() / (1024 * 1024) }.sum()
117+
final out = new StringBuffer()
118+
out << 'Total dependencies size:'.padRight(45)
119+
out << "${String.format(formatStr, size)} Mb\n\n"
120+
conf.sort { -it.length() }
121+
.each {
122+
out << "${it.name}".padRight(45)
123+
out << "${String.format(formatStr, (it.length() / 1024))} kb\n"
124+
}
125+
println(out)
126+
}
127+
}
105128
}
106129

107130
apply from: 'build.publishing.gradle'

okapi-shade/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ shadowJar {
6464
exclude(dependency("$it:"))
6565
}
6666
}
67+
exclude "META-INF/maven/org.apache*/**"
6768
exclude "META-INF/versions/**/*"
6869
exclude "META-INF/services/**/*"
6970
exclude "META-INF/NOTICE*"
7071
exclude "META-INF/LICENSE*"
72+
exclude "META-INF/DEPENDENCIES*"
7173
exclude "utf8.json"
74+
75+
metaInf { from tasks.licenseFile }
7276
}
7377

7478
assemble.dependsOn shadowJar

0 commit comments

Comments
 (0)