Skip to content

Commit 53eb07e

Browse files
committedNov 27, 2019
upgrade : libgdx 1.9.8 -> 1.9.10, gradle 1.11 -> 5.4.1
1 parent 3d30197 commit 53eb07e

10 files changed

+157
-80
lines changed
 

‎android/AndroidManifest.xml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<application
1212
android:allowBackup="true"
1313
android:icon="@drawable/ic_launcher"
14+
android:isGame="true"
15+
android:appCategory="game"
1416
android:label="@string/app_name"
1517
android:theme="@style/GdxTheme" >
1618
<activity

‎android/build.gradle

+45-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
android {
2-
buildToolsVersion "27.0.3"
3-
compileSdkVersion 27
2+
buildToolsVersion "29.0.2"
3+
compileSdkVersion 29
44
sourceSets {
55
main {
66
manifest.srcFile 'AndroidManifest.xml'
@@ -9,41 +9,64 @@ android {
99
renderscript.srcDirs = ['src']
1010
res.srcDirs = ['res']
1111
assets.srcDirs = ['assets']
12+
jniLibs.srcDirs = ['libs']
1213
}
1314

14-
instrumentTest.setRoot('tests')
15+
}
16+
packagingOptions {
17+
exclude 'META-INF/robovm/ios/robovm.xml'
18+
}
19+
defaultConfig {
20+
applicationId "ch.asynk.rustanddust.android"
21+
minSdkVersion 14
22+
targetSdkVersion 29
23+
versionCode 1
24+
versionName "1.0.1"
25+
}
26+
buildTypes {
27+
release {
28+
minifyEnabled false
29+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30+
}
1531
}
1632
}
1733

18-
// needed to add JNI shared libraries to APK when compiling on CLI
19-
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
20-
pkgTask.jniFolders = new HashSet<File>()
21-
pkgTask.jniFolders.add(new File(projectDir, 'libs'))
22-
}
2334

2435
// called every time gradle gets executed, takes the native dependencies of
2536
// the natives configuration, and extracts them to the proper libs/ folders
2637
// so they get packed with the APK.
27-
task copyAndroidNatives() {
28-
file("libs/armeabi/").mkdirs();
29-
file("libs/armeabi-v7a/").mkdirs();
30-
file("libs/x86/").mkdirs();
38+
task copyAndroidNatives {
39+
doFirst {
40+
file("libs/armeabi/").mkdirs()
41+
file("libs/armeabi-v7a/").mkdirs()
42+
file("libs/arm64-v8a/").mkdirs()
43+
file("libs/x86_64/").mkdirs()
44+
file("libs/x86/").mkdirs()
3145

32-
configurations.natives.files.each { jar ->
33-
def outputDir = null
34-
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
35-
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
36-
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
37-
if(outputDir != null) {
38-
copy {
39-
from zipTree(jar)
40-
into outputDir
41-
include "*.so"
46+
configurations.natives.files.each { jar ->
47+
def outputDir = null
48+
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
49+
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
50+
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
51+
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
52+
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
53+
if(outputDir != null) {
54+
copy {
55+
from zipTree(jar)
56+
into outputDir
57+
include "*.so"
58+
}
4259
}
4360
}
4461
}
4562
}
4663

64+
tasks.whenTaskAdded { packageTask ->
65+
if (packageTask.name.contains("package")) {
66+
packageTask.dependsOn 'copyAndroidNatives'
67+
}
68+
}
69+
4770
task run(type: Exec) {
4871
def path
4972
def localProperties = project.file("../local.properties")

‎android/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212

1313
# Project target.
14-
target=android-19
14+
target=android-27

‎build.gradle

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
buildscript {
22
repositories {
3+
mavenLocal()
34
mavenCentral()
5+
maven { url "https://plugins.gradle.org/m2/" }
6+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
47
jcenter()
8+
google()
59
}
610
dependencies {
7-
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
8-
classpath 'com.android.tools.build:gradle:0.10+'
9-
classpath 'com.github.jtakakura:gradle-robovm-plugin:0.0.10'
11+
classpath 'com.android.tools.build:gradle:3.4.1'
1012
}
1113
}
1214

1315
allprojects {
1416
version = '1.0.1'
1517
ext {
1618
appName = 'RustAndDust'
17-
gdxVersion = '1.9.8'
18-
roboVMVersion = '0.0.14'
19+
gdxVersion = '1.9.10'
20+
roboVMVersion = '2.3.8'
1921
}
2022

2123
repositories {
24+
mavenLocal()
2225
mavenCentral()
26+
jcenter()
27+
google()
2328
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
2429
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
2530
}
@@ -52,11 +57,15 @@ project(":android") {
5257
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
5358
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
5459
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
60+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
5561
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
62+
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
5663
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
5764
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
5865
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
66+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
5967
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
68+
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
6069
compile fileTree(dir: 'libs', include: '*.jar')
6170
}
6271
}

‎desktop/build.gradle

+13-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@ task run(dependsOn: classes, type: JavaExec) {
1616

1717
def sqliteFiles = ["data/rustanddust.sqlite"]
1818

19+
task debug(dependsOn: classes, type: JavaExec) {
20+
main = project.mainClassName
21+
classpath = sourceSets.main.runtimeClasspath
22+
standardInput = System.in
23+
workingDir = project.assetsDir
24+
ignoreExitValue = true
25+
debug = true
26+
}
27+
1928
task dist(type: Jar) {
20-
from files(sourceSets.main.output.classesDir)
21-
from files(sourceSets.main.output.resourcesDir)
22-
from {configurations.compile.collect {zipTree(it)}}
2329
from fileTree(dir: project.assetsDir, excludes : sqliteFiles)
2430

2531
manifest {
2632
attributes 'Main-Class': project.mainClassName
2733
}
34+
from {
35+
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
36+
}
37+
with jar
2838
}
2939

3040
dist.dependsOn classes

‎gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=true
2-
org.gradle.jvmargs=-Xms128m -Xmx512m
3-
org.gradle.configureondemand=true
2+
org.gradle.jvmargs=-Xms128m -Xmx1500m
3+
org.gradle.configureondemand=false

‎gradle/wrapper/gradle-wrapper.jar

4.98 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Sep 21 13:08:26 CEST 2013
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip

‎gradlew

+59-35
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,31 +75,11 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6883
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6984

7085
# Determine the Java command to use to start the JVM.
@@ -90,7 +105,7 @@ location of your Java installation."
90105
fi
91106

92107
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
108+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
94109
MAX_FD_LIMIT=`ulimit -H -n`
95110
if [ $? -eq 0 ] ; then
96111
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +129,7 @@ fi
114129
if $cygwin ; then
115130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132+
JAVACMD=`cygpath --unix "$JAVACMD"`
117133

118134
# We build the pattern for arguments to be converted via cygpath
119135
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +170,19 @@ if $cygwin ; then
154170
esac
155171
fi
156172

157-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158-
function splitJvmOpts() {
159-
JVM_OPTS=("$@")
173+
# Escape application args
174+
save () {
175+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176+
echo " "
160177
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
178+
APP_ARGS=$(save "$@")
179+
180+
# Collect all arguments for the java command, following the shell quoting and substitution rules
181+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182+
183+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185+
cd "$(dirname "$0")"
186+
fi
163187

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
188+
exec "$JAVACMD" "$@"

‎gradlew.bat

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem http://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -8,14 +24,14 @@
824
@rem Set local scope for the variables with windows NT shell
925
if "%OS%"=="Windows_NT" setlocal
1026

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1427
set DIRNAME=%~dp0
1528
if "%DIRNAME%" == "" set DIRNAME=.
1629
set APP_BASE_NAME=%~n0
1730
set APP_HOME=%DIRNAME%
1831

32+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34+
1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
2137

@@ -46,10 +62,9 @@ echo location of your Java installation.
4662
goto fail
4763

4864
:init
49-
@rem Get command-line arguments, handling Windowz variants
65+
@rem Get command-line arguments, handling Windows variants
5066

5167
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5368

5469
:win9xME_args
5570
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
6075
if "x%~1" == "x" goto execute
6176

6277
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6878

6979
:execute
7080
@rem Setup the command line

0 commit comments

Comments
 (0)
Please sign in to comment.