Skip to content

Commit 69cb055

Browse files
Rerun test if jre changes
Also update runtime plugin to a newer fork, that should work better for JDK 21+
1 parent f766cd4 commit 69cb055

File tree

3 files changed

+36
-33
lines changed

3 files changed

+36
-33
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ FROM gcr.io/distroless/base-nossl:nonroot AS bot
2323
COPY --from=mwader/static-ffmpeg:7.0.2 /ffmpeg /usr/local/bin/
2424
ENV FFMPEG_PATH=/usr/local/bin/ffmpeg
2525

26-
COPY --from=builder /app/build/jre ./jre
27-
COPY --from=builder /app/build/libs/Stickerify-shadow.jar .
2826
COPY --from=builder /app/libwebp/bin/cwebp /usr/local/bin/
2927
COPY --from=builder /app/libwebp/bin/dwebp /usr/local/bin/
28+
COPY --from=builder /app/libwebp/bin/gif2webp /usr/local/bin/
3029

31-
CMD ["jre/bin/java", "-XX:+UseZGC", "-Dcom.sksamuel.scrimage.webp.binary.dir=/usr/local/bin/", "-jar", "Stickerify-shadow.jar"]
30+
COPY --from=builder /app/build/jre jre
31+
COPY --from=builder /app/build/libs/Stickerify-*-all.jar Stickerify.jar
32+
33+
CMD ["jre/bin/java", "-XX:+UseZGC", "-Dcom.sksamuel.scrimage.webp.binary.dir=/usr/local/bin/", "-jar", "Stickerify.jar"]

build.gradle

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ dependencies {
3838
}
3939
}
4040

41-
jacocoTestReport {
42-
reports {
43-
html.required = false
44-
xml.required = true
45-
xml.outputLocation = file(".qodana/code-coverage/report.xml")
46-
}
47-
48-
afterEvaluate {
49-
classDirectories = files(classDirectories.files.collect {
50-
fileTree(dir: it, exclude: ['**/MediaConstraints.class',
51-
'**/stickerify/exception/**',
52-
'**/stickerify/process/**',
53-
'**/stickerify/runner**',
54-
'**/stickerify/telegram/**'])
55-
})
56-
}
57-
}
58-
5941
group = 'com.github.stickerifier'
6042
version = '1.0'
6143
description = 'Telegram bot to convert medias in the format required to be used as Telegram stickers'
@@ -71,30 +53,49 @@ tasks.withType(JavaCompile).configureEach {
7153
}
7254

7355
test {
74-
dependsOn('runtime')
75-
useJUnitPlatform()
76-
finalizedBy(jacocoTestReport)
56+
dependsOn jre
57+
inputs.files jre.outputs.files
7758

7859
def file = DefaultNativePlatform.currentOperatingSystem.isWindows() ? 'java.exe' : 'java'
7960
executable = layout.buildDirectory.file('jre/bin/' + file).get()
61+
62+
useJUnitPlatform()
63+
finalizedBy jacocoTestReport
8064
}
8165

82-
application {
83-
mainClass = 'com.github.stickerifier.stickerify.runner.Main'
66+
jacocoTestReport {
67+
reports {
68+
html.required = false
69+
xml.required = true
70+
xml.outputLocation = file(".qodana/code-coverage/report.xml")
71+
}
72+
73+
afterEvaluate {
74+
classDirectories = files(classDirectories.files.collect {
75+
fileTree(dir: it, exclude: ['**/MediaConstraints.class',
76+
'**/stickerify/exception/**',
77+
'**/stickerify/process/**',
78+
'**/stickerify/runner**',
79+
'**/stickerify/telegram/**'])
80+
})
81+
}
8482
}
8583

86-
runtime {
87-
options = ['--strip-debug', '--no-header-files', '--no-man-pages']
88-
modules = ['java.desktop', 'java.instrument', 'java.naming', 'java.sql', 'jdk.crypto.ec', 'jdk.unsupported']
84+
application {
85+
mainClass = 'com.github.stickerifier.stickerify.runner.Main'
8986
}
9087

9188
shadowJar {
92-
archiveBaseName = 'Stickerify'
93-
archiveClassifier = 'shadow'
94-
archiveVersion = ''
9589
mergeServiceFiles()
9690

9791
dependencies {
9892
exclude('dist_webp_binaries/')
9993
}
10094
}
95+
96+
runtime {
97+
options = ['--compress', 'zip-9', '--no-header-files', '--no-man-pages', '--strip-debug']
98+
modules = [ 'java.desktop', 'java.instrument', 'java.naming', 'java.sql', 'jdk.crypto.ec', 'jdk.unsupported']
99+
}
100+
101+
suggestModules.dependsOn shadowJar

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ telegram-bot-api = "com.github.pengrad:java-telegram-bot-api:8.3.0"
2424
tika = "org.apache.tika:tika-core:3.1.0"
2525

2626
[plugins]
27-
runtime = "org.beryx.runtime:1.13.1"
27+
runtime = "com.dua3.gradle.runtime:1.13.1-patch-1"
2828
shadow = "com.gradleup.shadow:8.3.6"

0 commit comments

Comments
 (0)