Skip to content

Commit

Permalink
Now set native executable name in the gradle build. Removed old Windo…
Browse files Browse the repository at this point in the history
…ws BAT file ref
  • Loading branch information
EdgewareRoad committed Jun 19, 2024
1 parent c4582d6 commit 1c59da8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ jobs:
keys: 'trivysummary.version'
- name: Build natively with Gradle
run: gradle nativeCompile
- name: Copy native executable to output name
run: copy build/native/nativeCompile/${{ matrix.executable }} build/distributions/trivysummary-${{ matrix.output-variant }}-${{ steps.read-properties.outputs.trivysummary_version }}${{ matrix.output-suffix }}
publish:
needs: build-native
runs-on: ubuntu-latest
Expand All @@ -95,6 +93,6 @@ jobs:
token: ${{ secrets.MAVENREPO_TOKEN }}
files: |
build/distributions/trivysummary-${{ steps.read-properties.outputs.trivysummary_version }}.zip
build/distributions/trivysummary-windows-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.exe
build/distributions/trivysummary-linux-amd64-${{ steps.read-properties.outputs.trivysummary_version }}
build/distributions/trivysummary-macos-amd64-${{ steps.read-properties.outputs.trivysummary_version }}
build/native/nativeCompile/trivysummary-windows-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.exe
build/native/nativeCompile/trivysummary-linux-amd64-${{ steps.read-properties.outputs.trivysummary_version }}
build/native/nativeCompile/trivysummary-macos-amd64-${{ steps.read-properties.outputs.trivysummary_version }}
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ group = 'com.fujitsu.edgewareroad'
def appProps = new Properties()
file("src/main/resources/application.properties").withInputStream { appProps.load(it) }

version = appProps.getProperty("trivysummary.version")
def osName = System.getProperty("os.name")
def os = osName.startsWith("Windows") ? "windows" : ( osName.startsWith("Linux") ? "linux" : ( osName.startsWith("Mac") ? "macos" : "unknown" ) )
def arch = System.getProperty("os.arch")

def version = appProps.getProperty("trivysummary.version")

repositories {
mavenCentral()
Expand Down Expand Up @@ -106,7 +110,7 @@ testing {
graalvmNative {
binaries {
main {
imageName = 'trivysummary'
imageName = 'trivysummary-'+os+'-'+arch+'-'+version
mainClass = 'com.fujitsu.edgewareroad.trivysummary.TrivySummaryApp'
buildArgs.add("-O4")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,6 @@ private void displayHelp()
output(" scan and the current one. Similar to the simple summary above, and");
output(" allows a view to be taken of improvements made, & what's left to fix.");

output("");
output("Note that, on Windows, trivysummary.bat should be used as the command.");

output("");
output("For scan dates, this application relies on the createdAt property added by");
output("later versions of Trivy (since v0.48.0).");
Expand Down

0 comments on commit 1c59da8

Please sign in to comment.