Skip to content

Commit cb3184b

Browse files
committed
Updating Turnbased sample to use CMake, GPGS 3.0
Change-Id: Id7033b884b195b1efaf93dbb0828d12b27793fc2
1 parent 1a6e96e commit cb3184b

26 files changed

+105
-3843
lines changed
Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1+
/*
2+
* Copyright 2017 (C) Google LLC
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
115
apply plugin: 'com.android.application'
216

3-
// Depend on another project that downloads and unzips the C++ SDK.
4-
evaluationDependsOn(':Common/gpg-sdk')
5-
6-
// As the plugin has created the build tasks, add the gpg-sdk task to
7-
// the task dependencies so it gets done before compiling
8-
tasks.whenTaskAdded { task ->
9-
project(':Common/gpg-sdk').defaultTasks.each {
10-
t ->task.dependsOn project(':Common/gpg-sdk').tasks[t]
11-
12-
}
13-
}
14-
1517
android {
16-
compileSdkVersion 23
17-
buildToolsVersion '23.0.2'
18+
compileSdkVersion 26
1819
defaultConfig {
1920
//
2021
// REPLACE THE APPLICATION ID with your bundle ID
2122
//
2223
applicationId "com.google.example.games.ReplaceMe"
2324
minSdkVersion 14
24-
targetSdkVersion 23
25+
targetSdkVersion 26
26+
27+
ndk.abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
28+
29+
externalNativeBuild {
30+
cmake {
31+
cppFlags "-std=c++11 -Wall -frtti"
32+
arguments "-DJUI_HELPER_PATH=${project(':Common:JuiHelper').projectDir}" ,
33+
"-DNDK_HELPER_PATH=${project(':Common:NDKHelper').projectDir}" ,
34+
"-DGPG_SDK_PATH=${project(':Common:gpg-sdk').projectDir}/gpg-cpp-sdk/android",
35+
"-DJSON_PATH=${project(':Common:gpg-sdk').projectDir}/../external/jsoncpp/",
36+
"-DTEAPOT_RENDERER_PATH=${project(':Common').projectDir}/TeapotRenderer" ,
37+
"-DANDROID_STL=c++_static"
38+
}
2539

26-
ndk {
27-
abiFilters 'x86', 'armeabi-v7a'
2840
}
2941
}
3042

3143
externalNativeBuild {
32-
ndkBuild {
33-
path 'src/main/jni/Android.mk'
34-
}
44+
cmake.path "CMakeLists.txt"
3545
}
3646
}
3747

3848
dependencies {
39-
compile 'com.google.android.gms:play-services-games:10.0.0'
40-
compile 'com.google.android.gms:play-services-nearby:10.0.0'
41-
compile 'com.android.support:support-v4:23.1.1'
49+
implementation project(":Common:JuiHelper")
50+
implementation 'com.google.android.gms:play-services-games:11.6.2'
51+
implementation 'com.google.android.gms:play-services-nearby:11.6.2'
52+
implementation 'com.android.support:support-v4:26.1.0'
4253
}

samples-android/TbmpSkeletonNative/src/main/java/com/google/example/games/tbmpskel/TBMPSkeletonApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020

2121
public class TBMPSkeletonApplication extends Application {
2222
public void onCreate() {
23+
super.onCreate();
2324
}
2425
}

samples-android/TbmpSkeletonNative/src/main/java/com/google/example/games/tbmpskel/TBMPSkeletonNativeActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class TBMPSkeletonNativeActivity extends NativeActivity {
2727
// Load SO
2828
static {
29-
System.load("libTBMPSkeletonNativeActivity.so");
29+
System.loadLibrary("TBMPSkeletonNativeActivity");
3030
}
3131

3232
@Override

samples-android/TbmpSkeletonNative/src/main/java/com/sample/helper/JUIAlertDialog.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

samples-android/TbmpSkeletonNative/src/main/java/com/sample/helper/JUIButton.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

samples-android/TbmpSkeletonNative/src/main/java/com/sample/helper/JUICheckBox.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

samples-android/TbmpSkeletonNative/src/main/java/com/sample/helper/JUICheckedTextView.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)