Skip to content

Commit 697fe5f

Browse files
committed
Porting gpg playgame samples to One Android Studio project space
Bug Id: b2/25978620 Tested: Linux Host / Android L + Nexus 9 Change-Id: I5ee4bd6215f1375f8a84e9640c9852b18f47b199
1 parent b150946 commit 697fe5f

File tree

331 files changed

+1476
-18278
lines changed

Some content is hidden

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

331 files changed

+1476
-18278
lines changed

samples-android/ButtonClicker/.classpath

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

samples-android/ButtonClicker/.cproject

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

samples-android/ButtonClicker/.project

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

samples-android/ButtonClicker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Please follow steps described in [Getting Started for C++](https://developers.go
1414

1515
First of all, take a look at our [troubleshooting guide](https://developers.google.com/games/services/android/troubleshooting). Most setup issues can be solved by following this guide.
1616

17-
If your question is not answered by the troubleshooting guide, we encourage you to post your question to [stackoverflow.com](stackoverflow.com). Our team answers questions there reguarly.
17+
If your question is not answered by the troubleshooting guide, we encourage you to post your question to [stackoverflow.com](stackoverflow.com) with tag "google-play-games". Our team answers questions there reguarly.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
apply plugin: 'com.android.model.application'
2+
3+
// Retrieve ndk path: ndk.dir MUST be set in file local.properties
4+
Properties properties = new Properties()
5+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
6+
def ndkDir = properties.getProperty('ndk.dir')
7+
8+
def gpg_cpp_path = file(project(':gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android"
9+
10+
// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"]
11+
// used to set stl and location of libgpg.a
12+
def stlportType = "c++"
13+
def stllinkType = "static"
14+
15+
model {
16+
repositories {
17+
libs(PrebuiltLibraries) {
18+
gpg {
19+
headers.srcDir "${gpg_cpp_path}/include"
20+
// StaticLibraryBinary does not work, use SharedLibraryBinary for now
21+
binaries.withType(SharedLibraryBinary) {
22+
sharedLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a")
23+
}
24+
}
25+
}
26+
}
27+
android {
28+
compileSdkVersion=22
29+
buildToolsVersion="23.0.1"
30+
31+
defaultConfig.with {
32+
applicationId="com.google.example.games.ButtonClicker"
33+
minSdkVersion.apiLevel = 11
34+
targetSdkVersion.apiLevel = 22
35+
}
36+
}
37+
android.sources {
38+
main {
39+
jni {
40+
dependencies {
41+
library "gpg"
42+
project ":cpufeatures" linkage "static"
43+
project ":native_app_glue" linkage "static"
44+
}
45+
source {
46+
srcDir 'src/main/jni'
47+
srcDir '../Common/ndk_helper'
48+
srcDir '../Common/jui_helper'
49+
}
50+
}
51+
}
52+
}
53+
android.ndk {
54+
platformVersion = 11
55+
moduleName = "ButtonClickerNativeActivity"
56+
stl = "${stlportType}_${stllinkType}"
57+
ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"])
58+
abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"])
59+
cppFlags.addAll(["-std=c++11",
60+
"-I${file("../Common/ndk_helper")}".toString(),
61+
"-I${file("../Common/jui_helper")}".toString() ])
62+
}
63+
android.buildTypes {
64+
release {
65+
minifyEnabled=false
66+
proguardFiles.add(file('proguard-android.txt'))
67+
}
68+
}
69+
android.abis {
70+
create("armeabi-v7a") {
71+
cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"])
72+
ldLibs.add("m_hard")
73+
ldFlags.add("-Wl,--no-warn-mismatch")
74+
}
75+
}
76+
}
77+
78+
dependencies {
79+
compile 'com.android.support:support-v4:22.2.1'
80+
compile 'com.google.android.gms:play-services:8.3.0'
81+
}

samples-android/ButtonClicker/AndroidManifest.xml renamed to samples-android/ButtonClicker/src/main/AndroidManifest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.google.example.games.bc3"
2+
package="com.google.example.games.ButtonClicker"
33
android:versionCode="1"
44
android:versionName="1.0" >
5-
5+
66
<uses-sdk
77
android:minSdkVersion="11"
88
android:targetSdkVersion="22" />
@@ -14,7 +14,7 @@
1414
</uses-permission>
1515

1616
<application
17-
android:name="com.google.example.games.bc3.ButtonClickerApplication"
17+
android:name="com.google.example.games.ButtonClicker.ButtonClickerApplication"
1818
android:allowBackup="true"
1919
android:hasCode="true"
2020
android:icon="@drawable/ic_launcher"
@@ -32,7 +32,7 @@
3232
This will take care of integrating with our NDK code.
3333
-->
3434
<activity
35-
android:name="com.google.example.games.bc3.ButtonClickerNativeActivity"
35+
android:name="com.google.example.games.ButtonClicker.ButtonClickerNativeActivity"
3636
android:label="@string/app_name" >
3737

3838
<!-- Tell NativeActivity the name of or .so -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source.dir=java

samples-android/ButtonClicker/assets/Shaders/ShaderPlain.fsh renamed to samples-android/ButtonClicker/src/main/assets/Shaders/ShaderPlain.fsh

File renamed without changes.

samples-android/ButtonClicker/assets/Shaders/VS_ShaderPlain.vsh renamed to samples-android/ButtonClicker/src/main/assets/Shaders/VS_ShaderPlain.vsh

File renamed without changes.

samples-android/ButtonClicker/build.sh renamed to samples-android/ButtonClicker/src/main/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ set -eua
33

44
declare -r script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55
pushd "${script_dir}"
6-
source ../build_sample.sh
6+
source ../../../build_sample.sh "$@"
77

0 commit comments

Comments
 (0)