Skip to content

Commit

Permalink
Merge pull request #23 from DaanVanYperen/development
Browse files Browse the repository at this point in the history
Upgrade to libGDX 1.9.9
Upgrade to artemis-odb 2.2.0
Upgrade to artemis-odb-contrib 2.4.0
Fix various issues with the build configuration.
Simplify example world.
  • Loading branch information
DaanVanYperen authored Jan 12, 2019
2 parents d1308a1 + 19d0d63 commit cf7aa92
Show file tree
Hide file tree
Showing 73 changed files with 846 additions and 936 deletions.
104 changes: 82 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,121 @@
*.ear
hs_err_pid*

## Robovm
/ios/robovm-build/

## GWT
war/
html/war/gwt_bree/
html/gwt-unitCache/
/html/war/
/html/gwt-unitCache/
.apt_generated/
html/war/WEB-INF/deploy/
html/war/WEB-INF/classes/
.gwt/
gwt-unitCache/
www-test/
.gwt-tmp/

## Android Studio and Intellij and Android in general
android/libs/armeabi/
android/libs/armeabi-v7a/
android/libs/x86/
android/gen/
/android/libs/armeabi/
/android/libs/armeabi-v7a/
/android/libs/arm64-v8a/
/android/libs/x86/
/android/libs/x86_64/
/android/gen/
.idea/
*.ipr
*.iws
*.iml
out/
/android/out/
com_crashlytics_export_strings.xml

## Eclipse

.classpath
.project
.metadata
**/bin/
tmp/
.metadata/
/android/bin/
/core/bin/
/desktop/bin/
/html/bin/
/ios/bin/
/ios-moe/bin/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.externalToolBuilders/
*.launch

## NetBeans
**/nbproject/private/
build/
nbbuild/
dist/
nbdist/

/nbproject/private/
/android/nbproject/private/
/core/nbproject/private/
/desktop/nbproject/private/
/html/nbproject/private/
/ios/nbproject/private/
/ios-moe/nbproject/private/

/build/
/android/build/
/core/build/
/desktop/build/
/html/build/
/ios/build/
/ios-moe/build/

/nbbuild/
/android/nbbuild/
/core/nbbuild/
/desktop/nbbuild/
/html/nbbuild/
/ios/nbbuild/
/ios-moe/nbbuild/

/dist/
/android/dist/
/core/dist/
/desktop/dist/
/html/dist/
/ios/dist/
/ios-moe/dist/

/nbdist/
/android/nbdist/
/core/nbdist/
/desktop/nbdist/
/html/nbdist/
/ios/nbdist/
/ios-moe/nbdist/

nbactions.xml
nb-configuration.xml

## Gradle

.gradle
/local.properties
.gradle/
gradle-app.setting
build/
/build/
/android/build/
/core/build/
/desktop/build/
/html/build/
/ios/build/
/ios-moe/build/

## OS Specific
.DS_Store
/matrix
Thumbs.db

## iOS
/ios/xcode/*.xcodeproj/*
!/ios/xcode/*.xcodeproj/xcshareddata
!/ios/xcode/*.xcodeproj/project.pbxproj
/ios/xcode/native/

/ios-moe/xcode/*.xcodeproj/*
!/ios-moe/xcode/*.xcodeproj/xcshareddata
!/ios-moe/xcode/*.xcodeproj/project.pbxproj
/ios-moe/xcode/native/
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: android
android:
components:
- android-20
- build-tools-20.0.0
- android-28
- build-tools-28.0.3

before_install:
- chmod +x gradlew

# Extend compile timeout to 30 minutes; gwt easily takes 10+.
script: travis_wait 30 ./gradlew clean build
script: travis_wait 30 ./gradlew clean build -x android:validateSigningDebug -x android:packageDebug -x matrix:generateMatrix
24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ libgdx-artemis-quickstart
Quickstart for libgdx artemis-odb based games.

Preconfigured for artemis-odb advanced features. Contains
a logo screen with artemis feature detection and minimal
game scaffold.
minimal game scaffold.s

### When to use this

Expand All @@ -19,20 +18,7 @@ to use it for whatever you need.

### Where to start

Edit `net.mostlyoriginal.game.screen.GameScreen` and start
adding systems!

Running the game displays a odb feature splash screen,
before transitioning to your game.

### Feature detection!

Splash screen icons show available features:

| Icon | Platform supports/feature active
|-----------------------|----------------------------------
| Tiny squares in a box | @PooledWeaver
| Linked squares | Hotspot optimization
Edit `net.mostlyoriginal.game.screen.GameScreen` and start editing!

### Platform cheat sheet

Expand All @@ -41,21 +27,21 @@ Splash screen icons show available features:
| Desktop | ✓ | ✓ | `gradlew desktop:run`
| Android | ✓ | ✓ | `gradlew android:installDebug android:run`, launch emulator first.
| iOS | ✓ | ✓ | `gradlew ios:launchIPhoneSimulator`
| HTML5/GWT | - | ✓ | `gradlew html:superDev`, browse to `http://localhost:8080/html`
| HTML5/GWT | - | ✓ | `gradlew html:superDev`, browse to `http://localhost:8080/index.html`

✓ supported, - not supported

### Library Versions

LibGDX 1.9.6, artemis-odb 2.1.0, artemis-odb-contrib 2.2.0
LibGDX 1.9.9, artemis-odb 2.2.0, artemis-odb-contrib 2.4.0

Alter library versions and enable gdx modules in /build.gradle

### Weaving

Weaving and fluid interface creation are part of the core build step.

Gradle plugin requires Gradle 2.2+!
Gradle plugin requires Gradle 4.6+!
### Generating component/system matrix

`gradlew generateMatrix`
Expand Down
12 changes: 5 additions & 7 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.mostlyoriginal.game.android"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="20" />
package="net.mostlyoriginal.game" >

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:isGame="true"
android:appCategory="game"
android:label="@string/app_name"
android:theme="@style/GdxTheme" >
<activity
android:name="net.mostlyoriginal.game.android.AndroidLauncher"
android:name="net.mostlyoriginal.game.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
77 changes: 47 additions & 30 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
android {
buildToolsVersion "20.0.0"
compileSdkVersion 20
buildToolsVersion "28.0.3"
compileSdkVersion 28
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand All @@ -12,44 +12,62 @@ android {
jniLibs.srcDirs = ['libs']
}

instrumentTest.setRoot('tests')
//instrumentTest.setRoot('tests')
}
packagingOptions {
exclude 'META-INF/robovm/ios/robovm.xml'
}

defaultConfig {
applicationId "net.mostlyoriginal.game.android"
minSdkVersion 8
targetSdkVersion 20
applicationId "net.mostlyoriginal.game"
minSdkVersion 9
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}


// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/x86/").mkdirs();
task copyAndroidNatives {
doFirst {
file("libs/armeabi/").mkdirs()
file("libs/armeabi-v7a/").mkdirs()
file("libs/arm64-v8a/").mkdirs()
file("libs/x86_64/").mkdirs()
file("libs/x86/").mkdirs()

configurations.natives.files.each { jar ->
def outputDir = null
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
}

tasks.whenTaskAdded { packageTask ->
if (packageTask.name.contains("package")) {
packageTask.dependsOn 'copyAndroidNatives'
}
}

task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
Expand All @@ -69,10 +87,9 @@ task run(type: Exec) {
}

def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'net.mostlyoriginal.game.android/net.mostlyoriginal.game.android.AndroidLauncher'
commandLine "$adb", 'shell', 'am', 'start', '-n', 'net.mostlyoriginal.game/net.mostlyoriginal.game.AndroidLauncher'
}


// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
Expand All @@ -89,8 +106,8 @@ eclipse {
}

classpath {
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}

project {
Expand All @@ -108,7 +125,7 @@ eclipse {
idea {
module {
sourceDirs += file("src");
scopes = [ COMPILE: [plus:[project.configurations.compile]]]
scopes = [ COMPILE: [plus:[project.configurations.compile]]]

iml {
withXml {
Expand Down
Binary file modified android/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/libs/arm64-v8a/libgdx.so
Binary file not shown.
Binary file added android/libs/x86_64/libgdx.so
Binary file not shown.
File renamed without changes.
19 changes: 7 additions & 12 deletions android/project.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# This file is used by the Eclipse ADT plugin. It is unnecessary for IDEA and Android Studio projects, which
# configure Proguard and the Android target via the build.gradle file.

# To enable ProGuard to work with Eclipse ADT, uncomment this (available properties: sdk.dir, user.home)
# and ensure proguard.jar in the Android SDK is up to date (or alternately reduce the android target to 23 or lower):
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro

# Project target.
target=android-20
target=android-19
Binary file modified android/res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/res/drawable-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/res/drawable-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">libgdx-artemis-quickstart</string>
<string name="app_name">my-game</string>

</resources>
Loading

0 comments on commit cf7aa92

Please sign in to comment.