-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
82 lines (65 loc) · 2.07 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
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
ext {
buildVersion = '1.0-SNAPSHOT'
sqliteVersion = '3.44.1.0'
commonsVersion = "3.12.0"
}
group "com.github.thelampgod"
version "$buildVersion"
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
repositories {
mavenCentral()
}
configurations {
jarLibs
implementation.extendsFrom jarLibs
}
dependencies {
jarLibs "org.apache.commons:commons-lang3:$commonsVersion"
jarLibs 'com.google.guava:guava:33.0.0-jre'
jarLibs "com.google.code.gson:gson:2.9.1"
//database
jarLibs "org.xerial:sqlite-jdbc:$sqliteVersion"
jarLibs "org.apache.commons:commons-dbcp2:2.9.0"
jarLibs "org.slf4j:slf4j-api:1.7.36"
jarLibs "org.slf4j:slf4j-simple:1.7.36"
jarLibs(group: 'net.minecrell', name: 'terminalconsoleappender', version: '1.2.0')
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.name
}
jar {
dependsOn shadowJar
from("LICENSE") {
rename { "${it}_${project.name}" }
}
manifest {
attributes "Implementation-Title": "thelampgod",
"Implementation-Version": "$buildVersion",
"Main-Class": "com.github.thelampgod.snowflake.Main"
}
}
shadowJar {
configurations = [project.configurations.jarLibs]
archiveClassifier.set('shadow')
}