-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
49 lines (40 loc) · 1.51 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
plugins {
id 'com.github.ben-manes.versions' version '0.17.0' apply false
id 'com.github.johnrengelman.shadow' version '2.0.1' apply false
}
subprojects {
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version:'4.12'
}
tasks.withType(JavaCompile) {
options.compilerArgs += ["-parameters"]
}
if (it.name in ["java-guava", "kotlin-module", "scala-module"]) {
apply plugin: "application"
mainClassName = 'foo'
task dependenciesSize(dependsOn: distZip) {
description = 'Counts size of JAR created from each module'
group = 'Help'
doLast {
def count = sourceSets.main.output.classesDirs.collect { fileTree(it) { include '**/*.class' }.files.size() }.sum()
println "$count classes"
int sumBytes = 0
def formatString = "%-36s %6.1f KB"
zipTree(distZip.archivePath).matching { include '*/lib/*' }.files.sort().each {
sumBytes += it.length()
println String.format(formatString, it.name, it.length() / 1024)
}
println String.format(formatString, "ALL", sumBytes / 1024)
}
}
tasks.remove(run)
tasks.remove(distTar)
}
}