[editor only] Fix double jar in snapshot builds

This commit is contained in:
fgnm
2022-01-23 19:28:48 +01:00
parent f832bcbc94
commit 89356590d3
6 changed files with 22 additions and 14 deletions
+9 -3
View File
@@ -23,7 +23,9 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build JAR dist files
run: ./gradlew dist
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew dist -PSNAPSHOT=true
- name: Build deb package
env:
WORKFLOW_RUN: ${{ github.run_number }}
@@ -55,7 +57,9 @@ jobs:
with:
java-version: 16
- name: Build JAR dist files
run: ./gradlew.bat dist
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew.bat dist -PSNAPSHOT=true
- name: Build msi package
env:
WORKFLOW_RUN: ${{ github.run_number }}
@@ -83,7 +87,9 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build JAR dist files
run: ./gradlew dist
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew dist -PSNAPSHOT=true
- name: Build dmg package
env:
WORKFLOW_RUN: ${{ github.run_number }}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13 -11
View File
@@ -52,6 +52,17 @@ mainClassName = "games.rednblack.editor.Main"
project.ext.assetsDir = new File("assets/");
def osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
def getBuildVersion = {
if (osName.contains('mac')) {
return getVersion().toString().replaceAll("0\\.", "")
}
if (project.hasProperty('SNAPSHOT')) {
return getVersion() + (project.hasProperty('WORKFLOW_RUN') ? WORKFLOW_RUN : "$System.env.WORKFLOW_RUN")
} else {
return getVersion()
}
}
task runHyperLap2D(dependsOn: classes, type: JavaExec) {
mainClass = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
@@ -61,6 +72,8 @@ task runHyperLap2D(dependsOn: classes, type: JavaExec) {
}
task dist(type: Jar) {
archiveVersion.set(getBuildVersion())
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from files(sourceSets.main.output.classesDirs)
from files(sourceSets.main.output.resourcesDir)
@@ -121,17 +134,6 @@ dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
def getBuildVersion = {
if (osName.contains('mac')) {
return getVersion().toString().replaceAll("0\\.", "")
}
if (project.hasProperty('SNAPSHOT')) {
return getVersion() + (project.hasProperty('WORKFLOW_RUN') ? WORKFLOW_RUN : "$System.env.WORKFLOW_RUN")
} else {
return getVersion()
}
}
task deleteInstallerTemp(type: Delete) {
delete "$buildDir/installer"
}