File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
107130apply from : ' build.publishing.gradle'
Original file line number Diff line number Diff 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
7478assemble. dependsOn shadowJar
You can’t perform that action at this time.
0 commit comments