From cbf37a7c9cfdc278da6a0a9f974910175e127796 Mon Sep 17 00:00:00 2001 From: ButterscotchVanilla Date: Wed, 7 Jul 2021 18:48:24 -0400 Subject: [PATCH 1/4] Add Slime Java Commons as a dependency and add runnable jar task --- build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.gradle b/build.gradle index dc924bdb1..ed7dcedd2 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,8 @@ repositories { } dependencies { + compile project(':Slime Java Commons') + // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' api 'org.yaml:snakeyaml:1.25' @@ -33,3 +35,13 @@ dependencies { // Use JUnit test framework testImplementation 'junit:junit:4.12' } + +jar { + manifest { + attributes 'Main-Class': 'io.eiren.vr.Main' + } + + from { + configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } + } +} From 5b2918acb20011f9e178eed92c2bd0d126221b9b Mon Sep 17 00:00:00 2001 From: ButterscotchVanilla Date: Wed, 7 Jul 2021 19:19:46 -0400 Subject: [PATCH 2/4] Build dependencies when packaging a server jar --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ed7dcedd2..93b46112d 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,8 @@ dependencies { testImplementation 'junit:junit:4.12' } -jar { +subprojects.each { subproject -> evaluationDependsOn(subproject.path) } +task serverJar (type: Jar, dependsOn: subprojects.tasks['build']) { manifest { attributes 'Main-Class': 'io.eiren.vr.Main' } @@ -44,4 +45,5 @@ jar { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar } From b97a92b6820696e29882bc120610efa03ad25b1f Mon Sep 17 00:00:00 2001 From: Butterscotch! Date: Wed, 7 Jul 2021 19:29:54 -0400 Subject: [PATCH 3/4] Create GitHub Actions build script (#1) * Create gradle.yml --- .github/workflows/gradle.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..14fa87078 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,45 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Build SlimeVR Server with Gradle + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.4 + + - name: Clone Slime Java Commons + uses: actions/checkout@v2.3.4 + with: + repository: Eirenliel/slime-java-commons + # Relative path under $GITHUB_WORKSPACE to place the repository + path: Slime Java Commons + + - name: Set up JDK 11 + uses: actions/setup-java@v2.1.0 + with: + java-version: '11' + distribution: 'adopt' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew clean serverJar + + - name: Upload the Server JAR as a Build Artifact + uses: actions/upload-artifact@v2.2.4 + with: + # Artifact name + name: "SlimeVR-Server" # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: build/libs/* From d3f81625cee280b6d937d57de8e30bdc8e5af21e Mon Sep 17 00:00:00 2001 From: Butterscotch! Date: Wed, 7 Jul 2021 19:39:08 -0400 Subject: [PATCH 4/4] Add testing to workflow --- .github/workflows/gradle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 14fa87078..1236527da 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -33,6 +33,9 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Test with Gradle + run: ./gradlew clean test + - name: Build with Gradle run: ./gradlew clean serverJar