A cross platform template for jMonkeyEngine games supporting both common-platform and platform-specific environment using gradle sub-projects.
- Game module
:game
: holdsbuild.gradle
dependencies for the game code & should hold your code. - Game-assets module
:game-assets
: holds game assets at./game-assets/src/main/resources
and supports java code specific to loading assets which is also a cross-platform module. - Desktop module
:desktop
: holdsbuild.gradle
for desktop dependencies and implements the:game
module and thegame-assets
module, this module can hold the desktop dependent gui and hardware code. - Android module
:android
: holdsbuild.gradle
for the android dependencies and implements the:game
module and thegame-assets
module, this module can hold android dependent gui and hardware code.
- A platform independent assets module
:game-assets
for game assets. - A platform independent game module
:game
for game logic. - Android Support via
:android
module. - Desktop Support via
:desktop
module. - Desktop executable jar building task.
- Automate game building using gradle tasks via GitHub CI.
- Automate game releasing
on-release
via GitHub CIon-release
action. - Android emulator and adb helper tasks (wip).
./gradlew run
Install the app on a connected device via adb.
┌─[✗]─[twisted@parrot]─[~/AndroidStudioProjects/CrossPlatformModule]
└──╼ $./gradlew :android:installDebug
> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Redmi Note 6 Pro - 10' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 4s
33 actionable tasks: 1 executed, 32 up-to-date
$./gradlew :desktop:clean &&
./gradlew :desktop:build &&
./gradlew :desktop:copyJars &&
./gradlew :desktop:releaseJar
$./gradlew :android:clean &&
./gradlew :android:build &&
./gradlew :android:assemble
=> Thanks Ali_RS for the suggestion of separating game and game-assets module from desktop and android ones.
=> Thanks wizzardo for fixing creating jar from desktop issue.
=> Android studio-AGP-Gradle release notes
=> Gradle DSL
=> Gradle multi-project-builds
=> Gradle/Groovy Udacity course by google
=> See JMonkeyEngine Android Examples:
=> See JMonkeyEngine RPI armhf Desktop Example: