Skip to content

Commit

Permalink
Copy fonts from JVM lib folder, to attempt standalone behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgewareRoad committed Jun 26, 2024
1 parent a90e3ec commit de637f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 18 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ version = appProps.getProperty("trivysummary.version")

def javaHome = System.properties['java.home']

nativeCompile.dependsOn test
nativeTestCompile.dependsOn test

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -158,6 +155,24 @@ graalvmNative {
}
}

nativeCompile.dependsOn(test)
nativeTestCompile.dependsOn(test)

task copyFontsToNativeCompile(dependsOn: nativeCompile, type: Copy) {
from javaHome + '/lib'
into "build/native/nativeCompile/lib"
include "*font*"
}

task copyFontsToNativeTestCompile(dependsOn: nativeTestCompile, type: Copy) {
from javaHome + '/lib'
into "build/native/nativeTestCompile/lib"
include "*font*"
}

nativeCompile.finalizedBy(copyFontsToNativeCompile)
nativeTestCompile.finalizedBy(copyFontsToNativeTestCompile)

// Publishing the output to GitHub (standard JAR, sources plus POM file, distribution ZIP)
publishing {
publications {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public class TrivySummaryApp implements ApplicationRunner, ExitCodeGenerator {
public static void main(String[] args) {
// Suppress logging and banner output that otherwise we can't control
System.setProperty("spring.main.banner-mode", "off");

if (System.getProperty("java.home") == null)
{
System.setProperty("java.home", TrivySummaryApp.class.getProtectionDomain().getCodeSource().getLocation().getPath());
}

XRLog.setLoggerImpl(new Slf4jLogger());

System.exit(SpringApplication.exit(SpringApplication.run(TrivySummaryApp.class, args)));
Expand Down

0 comments on commit de637f8

Please sign in to comment.