Skip to content

Commit

Permalink
Run spotless on cli
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbaker committed Dec 11, 2024
1 parent 99536a4 commit 2559334
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions smithy-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
}

// This is needed in order for integration tests to find the CLI runtime image
val smithyBinary = if (Os.isFamily(Os.FAMILY_WINDOWS)) {
layout.buildDirectory.file("image/smithy-cli-$imageOs/bin/smithy.bat").get().asFile.path
} else {
layout.buildDirectory.file("image/smithy-cli-$imageOs/bin/smithy").get().asFile.path
}
val smithyBinary =
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
layout.buildDirectory.file("image/smithy-cli-$imageOs/bin/smithy.bat").get().asFile.path
} else {
layout.buildDirectory.file("image/smithy-cli-$imageOs/bin/smithy").get().asFile.path
}
System.setProperty("SMITHY_BINARY", smithyBinary)

runtime {
Expand Down Expand Up @@ -143,9 +144,10 @@ runtime {
// This is needed to ensure that jlink is available (jlink is Java 9+), we should use the JDK that
// is configured for the runtime
// NOTE: For the runtime task, you *must* have the right JDK set up in your environment (17 at the time of writing)
javaHome = javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(imageJreVersion))
}.map { it.metadata.installationPath.asFile.path }
javaHome =
javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(imageJreVersion))
}.map { it.metadata.installationPath.asFile.path }
}

tasks {
Expand All @@ -156,10 +158,11 @@ tasks {
}

register("generateVersionFile") {
val versionFile = sourceSets.main.map { sourceSet ->
sourceSet.output.resourcesDir?.resolve("software/amazon/smithy/cli/cli-version")
?: throw GradleException("Resources directory not found for main sourceSet")
}
val versionFile =
sourceSets.main.map { sourceSet ->
sourceSet.output.resourcesDir?.resolve("software/amazon/smithy/cli/cli-version")
?: throw GradleException("Resources directory not found for main sourceSet")
}

outputs.file(versionFile)

Expand Down Expand Up @@ -320,11 +323,12 @@ if (project.hasProperty("release.cli")) {

platform {
// These replacements are for the names of files that are released, *not* for names within this build config
replacements = mapOf(
"osx" to "darwin",
"aarch_64" to "aarch64",
"windows_x86_64" to "windows_x64",
)
replacements =
mapOf(
"osx" to "darwin",
"aarch_64" to "aarch64",
"windows_x86_64" to "windows_x64",
)
}

distributions {
Expand Down

0 comments on commit 2559334

Please sign in to comment.