-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
118 lines (97 loc) · 2.95 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
plugins {
id 'java'
id 'application'
id 'maven-publish'
id 'net.neoforged.gradleutils' version '2.+'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group = 'net.neoforged'
version = gradleutils.getTagOffsetVersion()
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(20)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
application {
mainClass.set('net.neoforged.waifu.BotMain')
}
base {
archivesName.set('waifu')
}
changelog {
fromTag '1.0'
}
tasks.named('run', JavaExec) {
it.jvmArgs(
'--add-modules', 'ALL-MODULE-PATH',
'--add-opens', 'java.base/java.util.jar=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED',
'--add-exports', 'java.base/sun.security.util=ALL-UNNAMED',
'--enable-preview',
"-Dwaifu.propsFile=$projectDir/run/secrets/bot.properties",
"-Dwaifu.rootdir=$projectDir/waifubot"
)
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.neoforged.net/'
}
}
dependencies {
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.ow2.asm:asm:9.5'
implementation 'org.ow2.asm:asm-tree:9.5'
implementation 'org.ow2.asm:asm-util:9.5'
implementation 'cpw.mods:securejarhandler:1.0.8'
implementation 'net.minecraftforge:srgutils:0.4.3'
implementation 'com.electronwill.night-config:toml:3.6.6'
implementation 'org.flywaydb:flyway-core:9.18.0'
implementation 'org.jdbi:jdbi3-core:3.32.0'
implementation 'org.jdbi:jdbi3-sqlobject:3.32.0'
implementation 'org.xerial:sqlite-jdbc:3.41.2.2'
implementation 'org.postgresql:postgresql:42.6.0'
implementation 'io.github.matyrobbrt:curseforgeapi:1.7.8'
implementation 'net.dv8tion:JDA:5.0.0-beta.9'
implementation project(':metabase-api')
implementation 'ch.qos.logback:logback-classic:1.4.7'
}
jar {
manifest {
attributes.putAll([
'Main-Class': application.mainClass.get(),
'Implementation-Version': version
])
}
}
shadowJar {
mergeServiceFiles()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.add('--enable-preview')
}
tasks.register('buildBot') {
it.dependsOn(tasks.shadowJar)
doLast {
tasks.shadowJar.archiveFile.get().asFile.renameTo(project.file('build/libs/waifu-all.jar'))
}
}
tasks.register('outputVersion') {
doLast {
file('envs').text = "VERSION=${project.version}"
}
}
artifacts {
archives shadowJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven gradleutils.getPublishingForgeMaven()
}
}