Skip to content

Commit

Permalink
Updated to Blade Engine v4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bladecoder committed Oct 28, 2023
1 parent 2db020e commit 43234a4
Show file tree
Hide file tree
Showing 23 changed files with 359 additions and 280 deletions.
6 changes: 3 additions & 3 deletions test-prj/assets/BladeEngine.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
bladeEngineVersion=4.1.1-SNAPSHOT
bladeEngineVersion=4.3.0
character_icon_atlas=char-icons
debug=false
fast_leave=true
gdxVersion=1.11.1-SNAPSHOT
gdxVersion=1.12.0
inventory_pos=down
pie_mode.desktop=false
resolutions=1
roboVMVersion=2.3.18
roboVMVersion=2.3.20
title=Blade Engine Adventure
ui_mode=PIE
version=19
28 changes: 13 additions & 15 deletions test-prj/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,19 @@ dependencies {


task setVersion(type: WriteProperties) {
def props = new Properties()
def propFile = project.file("../assets/BladeEngine.properties");
props.load(new FileReader(propFile))
def props = new Properties()
def propFile = project.file("../assets/BladeEngine.properties");
props.load(new FileReader(propFile))

props."version" = version
props."bladeEngineVersion" = bladeEngineVersion
props."gdxVersion" = gdxVersion
props."roboVMVersion" = roboVMVersion

setProperties(props);
setOutputFile(propFile);

doLast {
println "Set version info in versions.properties"
}
}
props."bladeEngineVersion" = bladeEngineVersion
props."gdxVersion" = gdxVersion
props."roboVMVersion" = roboVMVersion

setProperties(props);
setOutputFile(propFile);

processResources.finalizedBy(setVersion)
doLast {
println "Set version info in versions.properties"
}
}
31 changes: 31 additions & 0 deletions test-prj/desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,43 @@ dependencies {
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
}

def os = System.properties['os.name'].toLowerCase()

run {
standardInput = System.in
ignoreExitValue = true

if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}

if (os.contains('mac')) {
jvmArgs = ["-XstartOnFirstThread"]
}
}

jar {
// sets the name of the .jar file this produces to the name of the game or app.
archiveBaseName.set(appName)
// using 'lib' instead of the default 'libs' appears to be needed by jpackageimage.
destinationDirectory = file("$project.buildDir/lib")
// the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
dependsOn configurations.runtimeClasspath
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
// these "exclude" lines remove some unnecessary duplicate files in the output JAR.
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
// setting the manifest makes the JAR runnable.
manifest {
attributes 'Main-Class': project.mainClassName
}
// this last step may help on some OSes that need extra instruction to make runnable JARs.
doLast {
file(archiveFile).setExecutable(true, false)
}
}


Expand All @@ -40,3 +70,4 @@ task dist(type: Jar) {

dist.dependsOn classes
dist.dependsOn ':core:jar'
processResources.dependsOn ':core:setVersion'
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ private void hideCursor() {
}

public static void main(String[] args) {
if(System.getProperty("os.name").contains("Mac"))
Configuration.GLFW_LIBRARY_NAME.set("glfw_async");
// if(System.getProperty("os.name").contains("Mac"))
// Configuration.GLFW_LIBRARY_NAME.set("glfw_async");

DesktopLauncher game = new DesktopLauncher();
game.parseParams(args);
Expand Down
16 changes: 8 additions & 8 deletions test-prj/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
android.injected.testOnly=false
androidGradlePluginVersion=8.1.0
appName=test-prj
bladeEngineVersion=4.1.1-SNAPSHOT
gdxVersion=1.11.1-SNAPSHOT
roboVMVersion=2.3.18
androidGradlePluginVersion=7.2.2
bladeEngineVersion=4.3.0
bladeInkVersion=1.1.2
spinePlugin=false
gdxControllersVersion=2.2.2
gdxControllersVersion=2.2.3
gdxVersion=1.12.0
org.gradle.configureondemand=false
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx1536m
org.gradle.configureondemand=false
android.injected.testOnly=false
roboVMVersion=2.3.20
spinePlugin=false
version=19
2 changes: 1 addition & 1 deletion test-prj/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions test-spine/assets/BladeEngine.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
bladeEngineVersion=4.1.0
bladeEngineVersion=4.3.0
debug=true
gdxVersion=1.10.0
gdxVersion=1.12.0
inventory_pos=down
pie_mode.desktop=false
resolutions=1
roboVMVersion=2.3.12
roboVMVersion=2.3.20
scene_screen=com.bladecoder.engine.ui.retro.RetroSceneScreen
title=Spine Animation Test
version=unspecified
Binary file modified test-spine/assets/spine/john_back.skel
Binary file not shown.
Binary file modified test-spine/assets/spine/john_front.skel
Binary file not shown.
Binary file modified test-spine/assets/spine/john_left.skel
Binary file not shown.
54 changes: 23 additions & 31 deletions test-spine/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
apply plugin: 'java'
apply plugin: 'java-library'

sourceCompatibility = 1.7
targetCompatibility=1.7
sourceCompatibility = 1.8
targetCompatibility = 1.8

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
eclipse.project.name = appName + '-core'

dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api fileTree(dir: '../libs', include: '*.jar')
api "com.bladecoder.engine:blade-engine:$bladeEngineVersion"
api "com.bladecoder.ink:blade-ink:$bladeInkVersion"
api "org.minimalcode:minimalcode-beans:0.5.1"
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion"


if(project.hasProperty("spinePlugin") && project.spinePlugin.equals("true")) {
println "Using Spine Plugin..."
api "com.bladecoder.engine:blade-engine-spine-plugin:$bladeEngineVersion"
}
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.bladecoder.engine:blade-engine:$bladeEngineVersion"
implementation "com.bladecoder.ink:blade-ink:$bladeInkVersion"
implementation "org.minimalcode:minimalcode-beans:0.5.1"
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion"

implementation "com.bladecoder.engine:blade-engine-spine-plugin:$bladeEngineVersion"
}


task setVersion(type: WriteProperties) {

def props = new Properties()
def propFile = project.file("../assets/BladeEngine.properties");
props.load(new FileReader(propFile))
def props = new Properties()
def propFile = project.file("../assets/BladeEngine.properties");
props.load(new FileReader(propFile))

props."version" = version
props."bladeEngineVersion" = bladeEngineVersion
props."gdxVersion" = gdxVersion
props."roboVMVersion" = roboVMVersion

setProperties(props);
setOutputFile(propFile);

doLast {
println "Set version info in versions.properties"
}
}
props."bladeEngineVersion" = bladeEngineVersion
props."gdxVersion" = gdxVersion
props."roboVMVersion" = roboVMVersion

processResources.finalizedBy(setVersion)
setProperties(props);
setOutputFile(propFile);

doLast {
println "Set version info in versions.properties"
}
}
68 changes: 46 additions & 22 deletions test-spine/desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,75 @@ apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'application'

sourceCompatibility = 1.7
targetCompatibility=1.7
sourceCompatibility = 1.8
targetCompatibility=1.8

sourceSets.main.resources.srcDirs += [ rootProject.file('assets').absolutePath ]
mainClassName = "com.bladecoder.advtestspine.desktop.DesktopLauncher"
mainClassName = "com.bladecoder.engine.DesktopLauncher"
eclipse.project.name = appName + '-desktop'

dependencies {
api project(":core")
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
implementation project(":core")
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-lwjgl3-angle:$gdxVersion"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"

}

jar {
archiveName "${appName}-${version}.jar"
from { configurations.compile.collect { zipTree(it) } }
manifest {
attributes 'Main-Class': project.mainClassName
}
// sets the name of the .jar file this produces to the name of the game or app.
archiveBaseName.set(appName)
// using 'lib' instead of the default 'libs' appears to be needed by jpackageimage.
destinationDirectory = file("$project.buildDir/lib")
// the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
dependsOn configurations.runtimeClasspath
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
// these "exclude" lines remove some unnecessary duplicate files in the output JAR.
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
// setting the manifest makes the JAR runnable.
manifest {
attributes 'Main-Class': project.mainClassName
}
// this last step may help on some OSes that need extra instruction to make runnable JARs.
doLast {
file(archiveFile).setExecutable(true, false)
}
}

def os = System.properties['os.name'].toLowerCase()

run {
standardInput = System.in
ignoreExitValue = true

if (project.hasProperty("appArgs") ) {
args Eval.me(appArgs)
}

if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}

if (os.contains('mac')) {
jvmArgs = ["-XstartOnFirstThread"]
}
}


task dist(type: Jar) {
baseName = appName + "-desktop"

from files(sourceSets.main.output.classesDirs)
from files(sourceSets.main.output.resourcesDir)
from {configurations.runtimeClasspath.collect {zipTree(it)}}

duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
manifest {
attributes 'Main-Class': project.mainClassName
}
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}

dist.dependsOn classes
dist.dependsOn ':core:jar'
processResources.dependsOn ':core:setVersion'
Loading

0 comments on commit 43234a4

Please sign in to comment.