File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ subprojects {
86
86
}
87
87
}
88
88
89
+ task licenseFile {
90
+ outputs. file(project. parent. file(' LICENSE.txt' ))
91
+ }
92
+
89
93
task dependencySearch(type : DependencyInsightReportTask ) {
90
94
description ' Searches all projects for a dependency'
91
95
group ' help'
@@ -102,6 +106,25 @@ subprojects {
102
106
}
103
107
}
104
108
}
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
+ }
105
128
}
106
129
107
130
apply from : ' build.publishing.gradle'
Original file line number Diff line number Diff line change @@ -64,11 +64,15 @@ shadowJar {
64
64
exclude(dependency(" $it :" ))
65
65
}
66
66
}
67
+ exclude " META-INF/maven/org.apache*/**"
67
68
exclude " META-INF/versions/**/*"
68
69
exclude " META-INF/services/**/*"
69
70
exclude " META-INF/NOTICE*"
70
71
exclude " META-INF/LICENSE*"
72
+ exclude " META-INF/DEPENDENCIES*"
71
73
exclude " utf8.json"
74
+
75
+ metaInf { from tasks. licenseFile }
72
76
}
73
77
74
78
assemble. dependsOn shadowJar
You can’t perform that action at this time.
0 commit comments