forked from Yoosk/ServerStarter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
85 lines (69 loc) · 1.86 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
plugins {
id 'java'
id 'distribution'
id "org.jetbrains.kotlin.jvm" version "1.4.32"
id "com.github.johnrengelman.shadow" version "6.1.0"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
repositories {
mavenCentral()
}
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
distTar.enabled(false)
distributions {
main {
contents {
from jar
filesMatching("startserver.*") {
filter { it.replaceAll("@@serverstarter-libVersion@@", version as String) }
}
}
}
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'org.yaml:snakeyaml:1.29'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.fusesource.jansi:jansi:1.17.1'
testImplementation 'junit:junit:4.13.2'
}
tasks.build.dependsOn shadowJar
shadowJar {
archiveClassifier.set('')
}
jar {
manifest {
attributes(
'Main-Class': 'atm.bloodworkxgaming.serverstarter.ServerStarterKt'
)
}
}
task depsize {
group = "help"
doLast {
def size = 0
def formatStr = "%,10.2f"
configurations.default.collect { it.length() / (1024 * 1024) }.each { size += it }
def out = new StringBuffer()
out << 'Total dependencies size:'.padRight(45)
out << "${String.format(formatStr, size)} Mb\n\n"
configurations
.default
.sort { -it.length() }
.each {
out << "${it.name}".padRight(45)
out << "${String.format(formatStr, (it.length() / 1024))} kb\n"
}
println(out)
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}