Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ native-bootstrap = "0.1.4"
nifty = "1.4.3"
spotbugs = "4.9.8"
jmeAndroidNatives = "3.10.0-xt16kb-alloc"
jme3-testdata = "2026-10-31-3"
googleMaterial = "1.14.0"
androidx-fragment-testing = "1.9.0"

Expand Down Expand Up @@ -40,6 +41,8 @@ gson = "com.google.code.gson:gson:2.14.0"
googleMaterial = { module = "com.google.android.material:material", version.ref = "googleMaterial" }
j-ogg-vorbis = "com.github.stephengold:j-ogg-vorbis:1.0.6"
jme3-android-natives = { module = "org.jmonkeyengine:jme3-android-native", version.ref = "jmeAndroidNatives" }
# Test data published from the standalone jMonkeyEngine/jme-testdata repo (Java 11 compatible).
jme3-testdata = { module = "org.jmonkeyengine:jme3-testdata", version.ref = "jme3-testdata" }
jbullet = "com.github.stephengold:jbullet:1.0.3"
jinput = "net.java.jinput:jinput:2.0.9"
jna = "net.java.dev.jna:jna:5.19.1"
Expand Down
20 changes: 18 additions & 2 deletions jme3-android-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ apply plugin: 'com.android.application'

def examplesJar = project(':jme3-examples').tasks.named('jar')

configurations {
testData
}

dependencies {
testData libs.jme3.testdata
}

def extractTestData = tasks.register('extractTestData', Copy) {
def testDataJar = { configurations.testData.singleFile }
inputs.file(testDataJar)
outputs.dir(layout.buildDirectory.dir('jme3-testdata'))
from({ zipTree(testDataJar()) })
into(layout.buildDirectory.dir('jme3-testdata'))
}

android {
namespace "org.jmonkeyengine.jme3androidexamples"
compileSdk gradle.ext.androidExamplesCompileSdk
Expand Down Expand Up @@ -40,7 +56,7 @@ android {
}
assets {
srcDir 'src/assets'
srcDir '../jme3-testdata/src/main/resources'
srcDir layout.buildDirectory.dir('jme3-testdata')
srcDir '../jme3-examples/src/main/resources'
}
}
Expand Down Expand Up @@ -68,7 +84,7 @@ dependencies {
}

tasks.named('preBuild') {
dependsOn examplesJar
dependsOn examplesJar, extractTestData
}

tasks.register('installAndroidExamples', Exec) {
Expand Down
2 changes: 1 addition & 1 deletion jme3-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sourceSets {
}

dependencies {
testRuntimeOnly project(':jme3-testdata')
testRuntimeOnly libs.jme3.testdata
testImplementation project(':jme3-desktop')
testRuntimeOnly project(':jme3-plugins')
}
Expand Down
13 changes: 7 additions & 6 deletions jme3-core/src/test/java/com/jme3/asset/TestLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.jme3.asset.plugins.ClasspathLocator;
import com.jme3.asset.plugins.HttpZipLocator;
import com.jme3.asset.plugins.UrlLocator;
import com.jme3.asset.plugins.ZipLocator;
import com.jme3.audio.plugins.WAVLoader;
import com.jme3.system.JmeSystem;
import com.jme3.texture.plugins.AWTLoader;
Expand Down Expand Up @@ -45,23 +44,25 @@ public void testManyLocators() {
"https://github.com/jMonkeyEngine/wiki/raw/master/docs/modules/tutorials/assets/images/beginner/",
UrlLocator.class);

am.registerLocator("../jme3-examples/town.zip", ZipLocator.class);
am.registerLocator(
"https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jmonkeyengine/wildhouse.zip",
"https://raw.githubusercontent.com/jMonkeyEngine/jme-testdata/refs/heads/master/archives/town.zip",
HttpZipLocator.class);
am.registerLocator(
"https://raw.githubusercontent.com/jMonkeyEngine/jme-testdata/refs/heads/master/archives/wildhouse.zip",
HttpZipLocator.class);
am.registerLocator("/", ClasspathLocator.class);

// Try loading from jme3-core resources using the ClasspathLocator.
assertNotNull(am.locateAsset(new AssetKey<>("Interface/Fonts/Default.fnt")),
"Failed to load from classpath");

// Try loading from the "town.zip" file using the ZipLocator.
// Try loading from the "town.zip" file using the HttpZipLocator.
assertNotNull(am.locateAsset(new ModelKey("casaamarela.jpg")),
"Failed to load from town.zip file");

// Try loading from the Google Code Archive website using the HttpZipLocator.
// Try loading the "wildhouse.zip" file using the HttpZipLocator.
assertNotNull(am.locateAsset(new ModelKey("glasstile2.png")),
"Failed to load from wildhouse.zip on googleapis.com");
"Failed to load from wildhouse.zip");

// Try loading from the GitHub website using the UrlLocator.
assertNotNull(am.locateAsset(new TextureKey("beginner-physics.png")),
Expand Down
2 changes: 1 addition & 1 deletion jme3-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ dependencies {
implementation project(':jme3-plugins-json-gson')
implementation project(':jme3-terrain')
implementation project(':jme3-awt-dialogs')
implementation project(':jme3-testdata')
implementation libs.jme3.testdata
runtimeOnly libs.nifty.examples // for the "all/intro.xml" example GUI
}

Expand Down
Loading
Loading