diff --git a/build.gradle b/build.gradle index 339f1131..fae24875 100644 --- a/build.gradle +++ b/build.gradle @@ -33,10 +33,10 @@ plugins { id "application" id "maven-publish" - id "signing" id "com.palantir.git-version" version "0.12.3" id "checkstyle" id "org.jreleaser" version "1.13.0" + id 'org.beryx.runtime' version '1.13.1' } @@ -69,6 +69,8 @@ task javadocJar(type: Jar) { ext { // Load the Smithy Language Server version from VERSION. libraryVersion = project.file("VERSION").getText('UTF-8').replace(System.lineSeparator(), "") + imageJreVersion = "17" + correttoRoot = "https://corretto.aws/downloads/latest/amazon-corretto-${imageJreVersion}" } println "Smithy Language Server version: '${libraryVersion}'" @@ -78,7 +80,6 @@ def stagingDirectory = rootProject.layout.buildDirectory.dir("staging") allprojects { apply plugin: "java" apply plugin: "maven-publish" - apply plugin: "signing" group = "software.amazon.smithy" version = libraryVersion description = "Language Server Protocol implementation for Smithy" @@ -200,7 +201,7 @@ tasks.named("checkstyleTest") { java { toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(17) } } @@ -223,6 +224,43 @@ jar { } } + +runtime { + addOptions("--compress", "2", "--strip-debug", "--no-header-files", "--no-man-pages") + addModules("java.logging") + + launcher { + jvmArgs = [ + '-XX:-UsePerfData', + '-Xshare:auto', + '-XX:SharedArchiveFile={{BIN_DIR}}/../lib/smithy.jsa' + ] + } + + targetPlatform("linux-x86_64") { + jdkHome = jdkDownload("${correttoRoot}-x64-linux-jdk.tar.gz") + } + + targetPlatform("linux-aarch64") { + jdkHome = jdkDownload("${correttoRoot}-aarch64-linux-jdk.tar.gz") + } + + targetPlatform("darwin-x86_64") { + jdkHome = jdkDownload("${correttoRoot}-x64-macos-jdk.tar.gz") + } + + targetPlatform("darwin-aarch64") { + jdkHome = jdkDownload("${correttoRoot}-aarch64-macos-jdk.tar.gz") + } + + targetPlatform("windows-x64") { + jdkHome = jdkDownload("${correttoRoot}-x64-windows-jdk.zip") + } + + // Because we're using target-platforms, it will use this property as a prefix for each target zip + imageZip = layout.buildDirectory.file("image/smithy-language-server.zip") +} + jreleaser { dryrun = false