From 7a9df5e1bbb6e13d5e1fd7cf971812093049ced4 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sun, 7 Jul 2024 14:48:17 -0400 Subject: [PATCH] try basic support for gradle --- .github/workflows/gradle.yml | 37 +++++++++++++++++++++++++++++++++ .gitignore | 1 + build.gradle | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .github/workflows/gradle.yml create mode 100644 build.gradle diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..3152929f --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,37 @@ +name: gradle +on: + push: + braches: + - master + pull_request: + braches: + - master + +jobs: + gradle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + + - uses: gradle/gradle-build-action@v2 + with: + arguments: check + + - uses: gradle/gradle-build-action@v2 + with: + arguments: jar + + - uses: gradle/gradle-build-action@v2 + with: + arguments: shadowJar + + - uses: actions/upload-artifact@v4 + with: + path: build/libs/ diff --git a/.gitignore b/.gitignore index 1fab025b..d94874aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ out .idea *.class +.gradle # Build products build diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..9679f673 --- /dev/null +++ b/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'application' + id 'java' + id 'com.github.johnrengelman.shadow' version '8.1.1' +} + +java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + archivesBaseName = 'rars' +} + +repositories { + mavenCentral() + gradlePluginPortal() +} + +dependencies { + var flatlafVersion = "3.4" + implementation( "com.formdev:flatlaf:${flatlafVersion}" ) + implementation( "com.formdev:flatlaf:${flatlafVersion}:linux-x86_64@so" ) + implementation( "com.formdev:flatlaf:${flatlafVersion}:macos-arm64@dylib" ) + implementation( "com.formdev:flatlaf:${flatlafVersion}:macos-x86_64@dylib" ) + implementation( "com.formdev:flatlaf:${flatlafVersion}:windows-x86_64@dll" ) +} + +sourceSets.main { + java.srcDirs = ['src/'] + resources.srcDirs = ["src/"] +} + +application { + mainClass = 'rars.Launch' +} + +jar { + manifest { + attributes 'Main-Class': 'rars.Launch' + } +}