-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (80 loc) · 2.81 KB
/
build.gradle
File metadata and controls
99 lines (80 loc) · 2.81 KB
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
import com.github.stickerifier.stickerify.JlinkJavaLauncher
import com.github.stickerifier.stickerify.JlinkTask
plugins {
id('java')
id('application')
alias(libs.plugins.spring.nullability)
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(libs.jspecify)
implementation(libs.gson)
implementation(libs.logback.classic)
implementation(libs.telegram.bot.api)
implementation(libs.tika)
testCompileOnly(libs.jspecify)
testImplementation(libs.hamcrest)
testImplementation(libs.junit.jupiter)
testImplementation(libs.mockwebserver)
testRuntimeOnly(libs.junit.platform)
}
group = 'com.github.stickerifier'
version = '2.0'
description = 'Telegram bot to convert medias into the format required to be used as Telegram stickers'
java.toolchain {
languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.ADOPTIUM
}
updateDaemonJvm {
languageVersion = JavaLanguageVersion.of(25)
vendor = JvmVendorSpec.ADOPTIUM
}
def jlink = tasks.register('jlink', JlinkTask) {
options = ['--strip-debug', '--no-header-files', '--no-man-pages', '--ignore-modified-runtime']
modules = [
'java.instrument', // for junit
'java.naming', // for logback
'java.sql', // for tika
'jdk.unsupported' // for gson
]
includeModulePath = false
group = 'build'
description = 'Generates a minimal JRE for the project.'
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
test {
inputs.dir(jlink.map { it.outputDirectory.get().asFile })
javaLauncher = providers.provider { new JlinkJavaLauncher(jlink.get()) }
useJUnitPlatform()
testLogging {
events('passed', 'failed', 'skipped')
}
}
def generateCohArchive = tasks.register('generateCohArchive', Exec) {
inputs.dir(jlink.map { it.outputDirectory.get().asFile })
def java = jlink.map { it.outputDirectory.file('jre/bin/java').get().asFile.absolutePath }
doFirst { commandLine(java.get(), '-XX:+UseCompactObjectHeaders', '-Xshare:dump') }
}
jlink.configure { finalizedBy(generateCohArchive) }
test.mustRunAfter(generateCohArchive)
installDist.mustRunAfter(generateCohArchive)
application {
mainClass = 'com.github.stickerifier.stickerify.runner.Main'
applicationDefaultJvmArgs = ['-XX:+UseCompactObjectHeaders', '-XX:+UseShenandoahGC', '-XX:ShenandoahGCMode=generational']
}
distributions {
main {
contents {
//noinspection GroovyAssignabilityCheck
from(jlink)
}
}
}
tasks.named('startScripts', CreateStartScripts) {
unixStartScriptGenerator.template = resources.text.fromFile('src/main/resources/customUnixStartScript.txt')
windowsStartScriptGenerator.template = resources.text.fromFile('src/main/resources/customWindowsStartScript.txt')
}