Skip to content

Commit 18bd4f1

Browse files
gguussGerrit Code Review
authored andcommitted
Merge "Adds basic Windows building instructions"
2 parents 8f5216d + c3c2e95 commit 18bd4f1

File tree

4 files changed

+45
-191
lines changed

4 files changed

+45
-191
lines changed

samples-android/README.build

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ A set of the sample to demonstrate how to use Google Play Games Native Interface
77

88
Pre-requisites
99
--------------
10-
1. change the applicationId inside each individual samples build.gradle to your own package name
11-
2. change app_id to your registered game ID, which was assigned to you by play game console
10+
1. Change the applicationId inside each individual samples build.gradle to your own package name
11+
1. Update the `app_id` and any configured constants in the sample's `src/main/res/values/id.xml` file to those registered in the [Play Games Services console](https://play.google.com/apps/publish)
1212

1313
Build with Android Studio
1414
-------------------------
15-
This project need Android Studio 1.5+ with ndk support
15+
This project requires Android Studio 1.5+ with ndk support
1616
1. Launch Android Studio.
1717
1. Open the sample project at cpp-android-basic-samples/samples-android
1818
1. Disable "Instant Run" from Settings-> Build Execution, Deployment -> Instant Run
@@ -26,26 +26,48 @@ This project need Android Studio 1.5+ with ndk support
2626
All projects could be built at one shot from Android Studio menu "Build" -> "Clean Project"/"Rebuild Project"
2727
you could also build with Gradle on Terminal/Command line
2828

29-
Build with Ant/ndk-build
30-
------------------------
31-
The script needed for ant build are kept in the file structure.
32-
The build script depends on the following environment variables to be set:
33-
ANDROID_HOME to the path where the Android SDK is installed
34-
NDK_ROOT to the path where the Android NDK is installed
35-
NDK_MODULE_PATH to the location of the Play Games cpp libraries.
36-
Change package name in AndroidManifest.xml to your own package
37-
Change app_id (in string.xml/ids.xml) to your own one
38-
39-
Note: NDK_MODULE_PATH should point one directory *above* where
40-
you've installed gpg-cpp-sdk. This variable is used by ndk-build to locate
41-
all installed modules, not just the Google Play Games library.
42-
43-
- To build any individual project
44-
- go to samples-android/your-selected-project/src/main, like samples-android/ButtonClicker/src/main
45-
- execute build.sh
46-
- To build all projects
47-
- in samples-android directory, execute build.sh
48-
The apk(s) will be placed into your-project-dir/src/main/bin
29+
Build using Gradle on OS X or Linux
30+
-----------------------------------
31+
1. Install Android Studio
32+
1. Set the path to the Android SDK
33+
34+
export ANDROID_HOME=~/Library/Android/sdk
35+
36+
1. Add the SDK to your path
37+
38+
export PATH=$PATH;$ANDROID_HOME/tools;$ANDROID_HOME/platform-tools
39+
40+
1. Set the path to the Android NDK
41+
42+
export ANDROID_NDK_HOME=<PATH_TO_NDK>/android-ndk-r10e
43+
44+
1. Execute the build script
45+
46+
./gradlew assemble
47+
48+
Build on Windows using Gradle
49+
-----------------------------
50+
1. Install Android Studio
51+
1. Set the path to the Android SDK
52+
53+
set ANDROID_HOME=C:\Users\<yourusername>\AppData\Local\Android\sdk
54+
55+
1. Add the SDK to your path
56+
57+
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
58+
59+
1. Set the path to the Android NDK
60+
61+
set ANDROID_NDK_HOME=C:\Users\<yourusername>\Desktop\android-ndk-r10e
62+
63+
1. (Optional) On some versions of Windows it is helpful to map the samples folder to a shortened path.
64+
65+
subst G: C:\<full-path-to-sample-folder>
66+
67+
1. Execute the build script
68+
69+
G:
70+
gradlew.bat assemble
4971

5072
Support
5173
-------

samples-android/build.sh

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

samples-android/build_sample.sh

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

samples-android/build_template.sh

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

0 commit comments

Comments
 (0)