[editor only] Fix double jar in snapshot builds
This commit is contained in:
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user