1
+
2
+ buildscript {
3
+ repositories {
4
+ mavenLocal()
5
+ mavenCentral()
6
+ maven { url " https://oss.sonatype.org/content/repositories/snapshots/" }
7
+ jcenter()
8
+ google()
9
+ }
10
+ dependencies {
11
+ classpath ' com.android.tools.build:gradle:3.2.0'
12
+ }
13
+ }
14
+
15
+ apply plugin : " com.android.application"
16
+
17
+ configurations { natives }
18
+
19
+ dependencies {
20
+ implementation project(" :core" )
21
+ implementation " com.badlogicgames.gdx:gdx-backend-android:$gdxVersion "
22
+ natives " com.badlogicgames.gdx:gdx-platform:$gdxVersion :natives-armeabi"
23
+ natives " com.badlogicgames.gdx:gdx-platform:$gdxVersion :natives-armeabi-v7a"
24
+ natives " com.badlogicgames.gdx:gdx-platform:$gdxVersion :natives-arm64-v8a"
25
+ natives " com.badlogicgames.gdx:gdx-platform:$gdxVersion :natives-x86"
26
+ natives " com.badlogicgames.gdx:gdx-platform:$gdxVersion :natives-x86_64"
27
+ implementation " com.android.support:appcompat-v7:23.4.0"
28
+ implementation files(" ../../../../android-client-dep/target/android-client-dep-1.0.jar" )
29
+ }
30
+
1
31
android {
2
- buildToolsVersion " 25"
3
- compileSdkVersion 23
32
+ compileSdkVersion 26
33
+
34
+ defaultConfig {
35
+ applicationId " com.graphicsfuzz.libgdxclient"
36
+ minSdkVersion 24
37
+ targetSdkVersion 26
38
+ versionCode 1
39
+ versionName ' 0.0.1'
40
+ }
41
+ buildTypes {
42
+ release {
43
+ minifyEnabled false
44
+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ),
45
+ ' proguard-rules.pro'
46
+ }
47
+ }
4
48
sourceSets {
5
49
main {
6
50
manifest. srcFile ' AndroidManifest.xml'
@@ -13,22 +57,13 @@ android {
13
57
}
14
58
15
59
}
16
- defaultConfig {
17
- applicationId " com.graphicsfuzz.libgdxclient"
18
- minSdkVersion 18
19
- targetSdkVersion 23
20
- }
21
- lintOptions {
22
- checkReleaseBuilds false
23
- abortOnError false
24
- }
25
60
}
26
61
27
62
28
63
// called every time gradle gets executed, takes the native dependencies of
29
64
// the natives configuration, and extracts them to the proper libs/ folders
30
65
// so they get packed with the APK.
31
- task copyAndroidNatives () {
66
+ task copyAndroidNatives () {
32
67
file(" libs/armeabi/" ). mkdirs();
33
68
file(" libs/armeabi-v7a/" ). mkdirs();
34
69
file(" libs/arm64-v8a/" ). mkdirs();
@@ -38,7 +73,7 @@ task copyAndroidNatives() {
38
73
configurations. natives. files. each { jar ->
39
74
def outputDir = null
40
75
if (jar. name. endsWith(" natives-arm64-v8a.jar" )) outputDir = file(" libs/arm64-v8a" )
41
- if (jar. name. endsWith(" natives-armeabi-v7a.jar" )) outputDir = file(" libs/armeabi-v7a" )
76
+ if (jar. name. endsWith(" natives-armeabi-v7a.jar" )) outputDir = file(" libs/armeabi-v7a" )
42
77
if (jar. name. endsWith(" natives-armeabi.jar" )) outputDir = file(" libs/armeabi" )
43
78
if (jar. name. endsWith(" natives-x86_64.jar" )) outputDir = file(" libs/x86_64" )
44
79
if (jar. name. endsWith(" natives-x86.jar" )) outputDir = file(" libs/x86" )
@@ -52,78 +87,3 @@ task copyAndroidNatives() {
52
87
}
53
88
}
54
89
55
- task run (type : Exec ) {
56
- def path
57
- def localProperties = project. file(" ../local.properties" )
58
- if (localProperties. exists()) {
59
- Properties properties = new Properties ()
60
- localProperties. withInputStream { instr ->
61
- properties. load(instr)
62
- }
63
- def sdkDir = properties. getProperty(' sdk.dir' )
64
- if (sdkDir) {
65
- path = sdkDir
66
- } else {
67
- path = " $System . env . ANDROID_HOME "
68
- }
69
- } else {
70
- path = " $System . env . ANDROID_HOME "
71
- }
72
-
73
- def adb = path + " /platform-tools/adb"
74
- commandLine " $adb " , ' shell' , ' am' , ' start' , ' -n' , ' com.graphicsfuzz.libgdxclient/com.graphicsfuzz.libgdxclient.AndroidLauncher'
75
- }
76
-
77
- // sets up the Android Eclipse project, using the old Ant based build.
78
- eclipse {
79
- // need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
80
- // ignores any nodes added in classpath.file.withXml
81
- sourceSets {
82
- main {
83
- java. srcDirs " src" , ' gen'
84
- }
85
- }
86
-
87
- jdt {
88
- sourceCompatibility = 1.6
89
- targetCompatibility = 1.6
90
- }
91
-
92
- classpath {
93
- plusConfigurations + = [ project. configurations. compile ]
94
- containers ' com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' , ' com.android.ide.eclipse.adt.LIBRARIES'
95
- }
96
-
97
- project {
98
- name = appName + " -android"
99
- natures ' com.android.ide.eclipse.adt.AndroidNature'
100
- buildCommands. clear();
101
- buildCommand " com.android.ide.eclipse.adt.ResourceManagerBuilder"
102
- buildCommand " com.android.ide.eclipse.adt.PreCompilerBuilder"
103
- buildCommand " org.eclipse.jdt.core.javabuilder"
104
- buildCommand " com.android.ide.eclipse.adt.ApkBuilder"
105
- }
106
- }
107
-
108
- // sets up the Android Idea project, using the old Ant based build.
109
- idea {
110
- module {
111
- sourceDirs + = file(" src" );
112
- scopes = [ COMPILE : [plus :[project. configurations. compile]]]
113
-
114
- iml {
115
- withXml {
116
- def node = it. asNode()
117
- def builder = NodeBuilder . newInstance();
118
- builder. current = node;
119
- builder. component(name : " FacetManager" ) {
120
- facet(type : " android" , name : " Android" ) {
121
- configuration {
122
- option(name : " UPDATE_PROPERTY_FILES" , value :" true" )
123
- }
124
- }
125
- }
126
- }
127
- }
128
- }
129
- }
0 commit comments