Skip to content

Commit fba177d

Browse files
committed
Updated Blade Engine to v1.3.2
1 parent 4da8709 commit fba177d

File tree

191 files changed

+503
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+503
-280
lines changed

adventure-test-project/android/AndroidManifest.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.bladecoder.advtest"
4-
android:versionCode="1"
5-
android:versionName="1.0" >
4+
>
65

76
<uses-sdk android:minSdkVersion="15"
8-
android:targetSdkVersion="23" />
7+
android:targetSdkVersion="26" />
98

109
<uses-feature android:glEsVersion="0x00020000"
1110
android:required="true" />
@@ -16,7 +15,7 @@
1615
android:label="@string/app_name"
1716
android:theme="@style/GdxTheme" >
1817
<activity
19-
android:name="com.bladecoder.engine.android.AndroidLauncher"
18+
android:name="com.bladecoder.advtest.AndroidLauncher"
2019
android:label="@string/app_name"
2120
android:screenOrientation="landscape"
2221
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">

adventure-test-project/android/build.gradle

Lines changed: 158 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,122 @@
1+
apply plugin: 'android'
2+
13
android {
2-
buildToolsVersion "23.0.3"
3-
compileSdkVersion 23
4-
sourceSets {
4+
buildToolsVersion latestBuildToolsAvailable("26.0.2")
5+
compileSdkVersion highestSdkAvailable(26)
6+
7+
defaultConfig {
8+
applicationId "com.bladecoder.advtest"
9+
minSdkVersion 15
10+
targetSdkVersion 26
11+
versionName version
12+
13+
if(project.hasProperty('versionCode'))
14+
versionCode project.versionCode.toInteger()
15+
else
16+
versionCode 1
17+
18+
buildConfigField "int", "EXPANSION_FILE_VERSION", "0"
19+
}
20+
21+
productFlavors {
22+
full {
23+
}
24+
25+
expansion {
26+
buildConfigField "int", "EXPANSION_FILE_VERSION", String.valueOf(android.defaultConfig.versionCode)
27+
}
28+
}
29+
30+
sourceSets {
531
main {
632
manifest.srcFile 'AndroidManifest.xml'
7-
java.srcDirs = ['src']
8-
aidl.srcDirs = ['src']
9-
renderscript.srcDirs = ['src']
33+
java.srcDirs = ['src/main/java']
34+
aidl.srcDirs = ['src/main/java']
35+
renderscript.srcDirs = ['src/main/java']
1036
res.srcDirs = ['res']
11-
assets.srcDirs = ['assets']
1237
jniLibs.srcDirs = ['libs']
1338
}
1439

40+
full.assets.srcDirs = ['../assets']
41+
expansion.assets.srcDirs = ['../base-assets']
42+
1543
instrumentTest.setRoot('tests')
16-
17-
1844
}
1945

20-
21-
defaultConfig {
22-
applicationId "com.bladecoder.advtest"
23-
minSdkVersion 15
24-
targetSdkVersion 23
25-
}
46+
packagingOptions {
47+
// Preventing from license violations (more or less):
48+
pickFirst 'META-INF/LICENSE.txt'
49+
pickFirst 'META-INF/LICENSE'
50+
pickFirst 'META-INF/license.txt'
51+
pickFirst 'META-INF/LGPL2.1'
52+
pickFirst 'META-INF/NOTICE.txt'
53+
pickFirst 'META-INF/NOTICE'
54+
pickFirst 'META-INF/notice.txt'
55+
// Excluding unnecessary meta-data:
56+
exclude 'META-INF/robovm/ios/robovm.xml'
57+
exclude 'META-INF/DEPENDENCIES.txt'
58+
exclude 'META-INF/DEPENDENCIES'
59+
exclude 'META-INF/dependencies.txt'
60+
}
2661

27-
if(project.hasProperty('keystore')) {
62+
if(project.hasProperty('keystore')) {
2863
signingConfigs {
2964
release {
30-
storeFile file(project.keystore)
31-
storePassword project.storePassword
32-
keyAlias project.alias
33-
keyPassword project.keyPassword
65+
storeFile file(project.keystore)
66+
storePassword project.storePassword
67+
keyAlias project.alias
68+
keyPassword project.keyPassword
3469
}
3570
}
36-
37-
buildTypes {
38-
release {
39-
signingConfig signingConfigs.release
40-
}
71+
72+
buildTypes {
73+
release {
74+
signingConfig signingConfigs.release
75+
}
4176
}
42-
}
77+
}
78+
79+
buildTypes {
80+
release {
81+
minifyEnabled false
82+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
83+
}
84+
}
85+
}
86+
87+
configurations { natives }
88+
89+
dependencies {
90+
compile project(":core")
91+
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
92+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
93+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
94+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
95+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
96+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
97+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
98+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
99+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
100+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
101+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
43102
}
44103

45104
// called every time gradle gets executed, takes the native dependencies of
46105
// the natives configuration, and extracts them to the proper libs/ folders
47106
// so they get packed with the APK.
48-
task copyAndroidNatives() {
107+
task copyAndroidNatives() {
49108
file("libs/armeabi/").mkdirs();
50109
file("libs/armeabi-v7a/").mkdirs();
110+
file("libs/arm64-v8a/").mkdirs();
111+
file("libs/x86_64/").mkdirs();
51112
file("libs/x86/").mkdirs();
52113

53114
configurations.natives.files.each { jar ->
54115
def outputDir = null
116+
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
55117
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
56118
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
119+
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
57120
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
58121
if(outputDir != null) {
59122
copy {
@@ -84,7 +147,28 @@ task run(type: Exec) {
84147
}
85148

86149
def adb = path + "/platform-tools/adb"
87-
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.bladecoder.advtest/com.bladecoder.engine.android.AndroidLauncher'
150+
commandLine "$adb", 'shell', 'am', 'start', '-n', android.defaultConfig.applicationId + '/' + android.defaultConfig.applicationId + '.AndroidLauncher'
151+
}
152+
153+
task('packageMainExpansionFile', type: Zip) {
154+
155+
FileTree tree = fileTree(dir: '../assets')
156+
157+
from tree
158+
//into 'assets'
159+
160+
// Expansion file name format: main.versionCode.packageName.obb
161+
entryCompression = ZipEntryCompression.STORED
162+
archiveName = 'main.' + android.defaultConfig.versionCode + "." + android.defaultConfig.applicationId + ".obb"
163+
164+
println "Generating main." + archiveName
165+
166+
}
167+
168+
tasks.whenTaskAdded { task ->
169+
if(task.name == 'generateExpansionReleaseBuildConfig') {
170+
task.dependsOn packageMainExpansionFile
171+
}
88172
}
89173

90174
// sets up the Android Eclipse project, using the old Ant based build.
@@ -93,18 +177,18 @@ eclipse {
93177
// ignores any nodes added in classpath.file.withXml
94178
sourceSets {
95179
main {
96-
java.srcDirs "src", 'gen'
180+
java.srcDirs "src/main/java", 'gen'
97181
}
98182
}
99183

100184
jdt {
101-
sourceCompatibility = 1.6
102-
targetCompatibility = 1.6
185+
sourceCompatibility=1.7
186+
targetCompatibility=1.7
103187
}
104188

105189
classpath {
106-
plusConfigurations += [ project.configurations.compile ]
107-
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
190+
plusConfigurations += [ project.configurations.compile ]
191+
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
108192
}
109193

110194
project {
@@ -122,7 +206,7 @@ eclipse {
122206
idea {
123207
module {
124208
sourceDirs += file("src");
125-
scopes = [ COMPILE: [plus:[project.configurations.compile]]]
209+
scopes = [ COMPILE: [plus:[project.configurations.compile]]]
126210

127211
iml {
128212
withXml {
@@ -139,4 +223,44 @@ idea {
139223
}
140224
}
141225
}
226+
}
227+
228+
229+
int highestSdkAvailable(int defaultSdk) {
230+
try {
231+
def buildToolsDir = new File(android.getSdkDirectory().toString(), "platforms")
232+
def sdks = buildToolsDir.list([accept:{ d, f-> f.startsWith("android-") && new File(d, f).isDirectory() }] as FilenameFilter).sort { a, b -> b <=> a }
233+
def highestSdk = sdks[0]
234+
if (highestSdk != null) {
235+
println "Using highest found SDK " + highestSdk.substring(8)
236+
highestSdk.substring(8).toInteger()
237+
} else {
238+
println "No installed SDKs found. Using default SDK " + defaultSdk
239+
defaultSdk
240+
}
241+
} catch (any) {
242+
println "Exception while determining highest SDK. Using default SDK " +
243+
defaultSdk
244+
defaultSdk
245+
}
246+
}
247+
248+
String latestBuildToolsAvailable(String defaultBuildTools) {
249+
try {
250+
def buildToolsDir = new File(android.getSdkDirectory().toString(), "build-tools")
251+
def buildToolsVersions = buildToolsDir.list([accept:{ d, f-> new File(d, f).isDirectory() }] as FilenameFilter).sort { a, b -> b <=> a }
252+
def latestBuildTools = buildToolsVersions[0]
253+
if (latestBuildTools != null) {
254+
println "Using latest found build tools " + latestBuildTools
255+
latestBuildTools
256+
} else {
257+
println "No installed build tools found. Using default build tools " +
258+
defaultBuildTools
259+
defaultBuildTools
260+
}
261+
} catch (any) {
262+
println "Exception while determining latest build tools. Using default build tools " +
263+
defaultBuildTools
264+
defaultBuildTools
265+
}
142266
}
176 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
# This file is automatically generated by Android Tools.
2-
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3-
#
4-
# This file must be checked in Version Control Systems.
5-
#
6-
# To customize properties used by the Ant build system edit
7-
# "ant.properties", and override values to adapt the script to your
8-
# project structure.
9-
#
10-
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11-
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1+
# This file is used by the Eclipse ADT plugin. It is unnecessary for IDEA and Android Studio projects, which
2+
# configure Proguard and the Android target via the build.gradle file.
3+
4+
# To enable ProGuard to work with Eclipse ADT, uncomment this (available properties: sdk.dir, user.home)
5+
# and ensure proguard.jar in the Android SDK is up to date (or alternately reduce the android target to 23 or lower):
6+
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro
127

138
# Project target.
14-
target=android-23
9+
target=android-26

adventure-test-project/android/src/com/bladecoder/engine/android/AndroidLauncher.java renamed to adventure-test-project/android/src/main/java/com/bladecoder/advtest/AndroidLauncher.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package com.bladecoder.engine.android;
1+
package com.bladecoder.advtest;
2+
3+
import com.bladecoder.engine.BladeEngine;
24

35
import android.os.Bundle;
46
import android.view.WindowManager;
57

68
import com.badlogic.gdx.backends.android.AndroidApplication;
79
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
8-
import com.bladecoder.engine.BladeEngine;
910

1011
public class AndroidLauncher extends AndroidApplication {
1112
@Override
@@ -15,7 +16,7 @@ public void onCreate(Bundle savedInstanceState) {
1516
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
1617
cfg.useAccelerometer = false;
1718
cfg.useCompass = false;
18-
// cfg.numSamples = 2;
19+
//cfg.numSamples = 2;
1920
cfg.useImmersiveMode = true;
2021

2122
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
#Mon Oct 23 11:17:51 CEST 2017
2-
roboVMVersion=2.3.3
1+
bladeEngineVersion=1.3.2
32
debug=false
4-
gdxVersion=1.9.7
53
fast_leave=true
6-
bladeEngineVersion=1.3.2-SNAPSHOT
7-
version=unspecified
8-
title=Blade Engine Adventure
9-
ui_mode=PIE
4+
gdxVersion=1.9.7
105
inventory_pos=down
116
pie_mode.desktop=false
7+
roboVMVersion=2.3.3
8+
title=Blade Engine Adventure
9+
ui_mode=PIE
10+
version=19

0 commit comments

Comments
 (0)