diff --git a/.gitignore b/.gitignore index e4d1792..0a5dd25 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ obj/ .gradle/ build/ +.externalNativeBuild/ *.iml diff --git a/samples-android/ButtonClicker/build.gradle b/samples-android/ButtonClicker/build.gradle index 39f46bc..a770382 100644 --- a/samples-android/ButtonClicker/build.gradle +++ b/samples-android/ButtonClicker/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.android.model.application' +apply plugin: 'com.android.application' // Depend on another project that downloads and unzips the C++ SDK. evaluationDependsOn(':Common/gpg-sdk') @@ -12,80 +12,31 @@ tasks.whenTaskAdded { task -> } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" - -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } +android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + // + // REPLACE THE APPLICATION ID with your bundle ID + // + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 + + ndk { + abiFilters 'x86', 'armeabi-v7a' } } - android { - compileSdkVersion=23 - buildToolsVersion="23.0.2" - defaultConfig.with { - // - // REPLACE THE APPLICATION ID with your bundle ID - // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 - } - } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/cpufeatures" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - srcDir '../Common/ndk_helper' - srcDir '../Common/jui_helper' - } - } - } - } - android.ndk { - platformVersion = 11 - moduleName = "ButtonClickerNativeActivity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"]) - cppFlags.addAll(["-std=c++11", - "-I${file("../Common/ndk_helper")}".toString(), - "-I${file("../Common/jui_helper")}".toString() ]) - } - android.buildTypes { - release { - minifyEnabled=false - proguardFiles.add(file('proguard-android.txt')) - } - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } } } dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-nearby:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/ButtonClicker/src/main/jni/Android.mk b/samples-android/ButtonClicker/src/main/jni/Android.mk index f996d09..7757018 100644 --- a/samples-android/ButtonClicker/src/main/jni/Android.mk +++ b/samples-android/ButtonClicker/src/main/jni/Android.mk @@ -27,9 +27,10 @@ endif include $(BUILD_SHARED_LIBRARY) +include $(LOCAL_PATH)/../../../../Common/gpg-sdk/gpg-cpp-sdk/android/Android.mk + $(call import-add-path,$(LOCAL_PATH)/../../../../Common) $(call import-module,ndk_helper) $(call import-module,jui_helper) -$(call import-module,gpg-cpp-sdk/android) $(call import-module,android/native_app_glue) $(call import-module,android/cpufeatures) diff --git a/samples-android/CollectAllTheStarsNative/build.gradle b/samples-android/CollectAllTheStarsNative/build.gradle index 8f81174..304fe2f 100644 --- a/samples-android/CollectAllTheStarsNative/build.gradle +++ b/samples-android/CollectAllTheStarsNative/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.android.model.application' +apply plugin: 'com.android.application' // Depend on another project that downloads and unzips the C++ SDK. evaluationDependsOn(':Common/gpg-sdk') @@ -12,83 +12,31 @@ tasks.whenTaskAdded { task -> } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" +android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + // + // REPLACE THE APPLICATION ID with your bundle ID + // + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } + ndk { + abiFilters 'x86', 'armeabi-v7a' } } - android { - compileSdkVersion = 23 - buildToolsVersion = "23.0.2" - defaultConfig.with { - // - // REPLACE THE APPLICATION ID with your bundle ID - // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 - versionCode = 1.0 - versionName = '1.0' - } - } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/cpufeatures" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - srcDir '../Common/ndk_helper' - srcDir '../Common/jui_helper' - srcDir '../Common/external/jsoncpp/src/lib_json' - } - } - } - } - android.ndk { - platformVersion = 11 - moduleName ="CollectAllTheStarsNativeActivity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a","arm64-v8a", "x86"]) - cppFlags.addAll(["-std=c++11", - "-I${file("../Common/external/jsoncpp/include")}".toString(), - "-I${file("../Common/ndk_helper")}".toString(), - "-I${file("../Common/jui_helper")}".toString() ]) - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") - } - } - android.buildTypes { - release { - minifyEnabled=false - proguardFiles.add(file('proguard-android.txt')) + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } } } + dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-plus:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/CollectAllTheStarsNative/src/main/jni/Android.mk b/samples-android/CollectAllTheStarsNative/src/main/jni/Android.mk index 2008336..c4e3817 100644 --- a/samples-android/CollectAllTheStarsNative/src/main/jni/Android.mk +++ b/samples-android/CollectAllTheStarsNative/src/main/jni/Android.mk @@ -31,9 +31,10 @@ endif include $(BUILD_SHARED_LIBRARY) +include $(LOCAL_PATH)/../../../../Common/gpg-sdk/gpg-cpp-sdk/android/Android.mk + $(call import-add-path,$(LOCAL_PATH)/../../../../Common) $(call import-module,ndk_helper) $(call import-module,jui_helper) -$(call import-module,gpg-cpp-sdk/android) $(call import-module,android/native_app_glue) $(call import-module,android/cpufeatures) diff --git a/samples-android/Common/cpufeatures/build.gradle b/samples-android/Common/cpufeatures/build.gradle deleted file mode 100644 index d9adf77..0000000 --- a/samples-android/Common/cpufeatures/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -apply plugin: "com.android.model.native" - -def ndkDir = null - -if (project.rootProject.file('local.properties').exists()) { - // Retrieve ndk path: ndk.dir MUST be set in file local.properties - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - ndkDir = properties.getProperty('ndk.dir') -} else if (System.getProperty('ANDROID_NDK_HOME') != null) { - ndkDir = System.getProperty('ANDROID_NDK_HOME') -} else if (System.getenv('ANDROID_NDK_HOME') != null) { - ndkDir = System.getenv('ANDROID_NDK_HOME') -} - -if (ndkDir == null || ndkDir == "") { - throw new Exception("Need to run from Android Studio or define ANDROID_NDK_HOME") -} - - -model { - android { - compileSdkVersion = 23 - } - - android.ndk { - moduleName = "cpufeatures" - } - - android.sources { - main { - jni { - exportedHeaders { - srcDir "${ndkDir}/sources/android/cpufeatures" - } - source { - srcDir "${ndkDir}/sources/android/cpufeatures" - } - } - } - } -} diff --git a/samples-android/Common/native_app_glue/build.gradle b/samples-android/Common/native_app_glue/build.gradle deleted file mode 100644 index 9c06bd7..0000000 --- a/samples-android/Common/native_app_glue/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -apply plugin: "com.android.model.native" - -def ndkDir = null - -if (project.rootProject.file('local.properties').exists()) { - // Retrieve ndk path: ndk.dir MUST be set in file local.properties - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - ndkDir = properties.getProperty('ndk.dir') -} else if (System.getProperty('ANDROID_NDK_HOME') != null) { - ndkDir = System.getProperty('ANDROID_NDK_HOME') -} else if (System.getenv('ANDROID_NDK_HOME') != null) { - ndkDir = System.getenv('ANDROID_NDK_HOME') -} - -if (ndkDir == null || ndkDir == "") { - throw new Exception("Need to run from Android Studio or define ANDROID_NDK_HOME") -} - -model { - android { - compileSdkVersion = 23 - } - - android.ndk { - abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"]) - moduleName = "native_app_glue" - } - - android.sources { - main { - jni { - exportedHeaders { - srcDir "${ndkDir}/sources/android/native_app_glue" - } - source { - srcDir "${ndkDir}/sources/android/native_app_glue" - } - } - } - } -} - -/* - We are building a static library, so disable all the shared library tasks. -*/ -tasks.whenTaskAdded { task -> - if (task.name.contains("SharedLibrary")) { - task.enabled = false - } -} diff --git a/samples-android/Minimalist/build.gradle b/samples-android/Minimalist/build.gradle index 174be5d..924e125 100644 --- a/samples-android/Minimalist/build.gradle +++ b/samples-android/Minimalist/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.android.model.application' +apply plugin: 'com.android.application' // Depend on another project that downloads and unzips the C++ SDK. evaluationDependsOn(':Common/gpg-sdk') @@ -12,80 +12,31 @@ tasks.whenTaskAdded { task -> } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" - -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } - } - } - android { - compileSdkVersion = 23 - buildToolsVersion = "23.0.2" - - defaultConfig.with { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { // // REPLACE THE APPLICATION ID with your bundle ID // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 + ndk { + abiFilters 'x86', 'armeabi-v7a' } } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - } - } - } - } - - android.ndk { - platformVersion = 11 - moduleName = "native-activity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv1_CM", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"]) - cppFlags.addAll(["-std=c++11", "-I${file("src/main")}".toString()]) - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") - } - } - - android.buildTypes { - release { - minifyEnabled = false - proguardFiles.add(file('proguard-android.txt')) + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } } } dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-nearby:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/Minimalist/src/main/jni/Android.mk b/samples-android/Minimalist/src/main/jni/Android.mk index 44834af..93090cb 100644 --- a/samples-android/Minimalist/src/main/jni/Android.mk +++ b/samples-android/Minimalist/src/main/jni/Android.mk @@ -16,8 +16,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. $(NDK_MODULE_PATH)/gpg-cpp-sdk/android/include - LOCAL_MODULE := native-activity LOCAL_SRC_FILES := main.cpp StateManager.cpp LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lz @@ -25,5 +23,6 @@ LOCAL_STATIC_LIBRARIES := android_native_app_glue gpg-1 gnustl-static include $(BUILD_SHARED_LIBRARY) -$(call import-module,gpg-cpp-sdk/android) +include $(LOCAL_PATH)/../../../../Common/gpg-sdk/gpg-cpp-sdk/android/Android.mk + $(call import-module,android/native_app_glue) diff --git a/samples-android/Minimalist/src/main/jni/StateManager.cpp b/samples-android/Minimalist/src/main/jni/StateManager.cpp index e449abb..da63d97 100644 --- a/samples-android/Minimalist/src/main/jni/StateManager.cpp +++ b/samples-android/Minimalist/src/main/jni/StateManager.cpp @@ -13,7 +13,7 @@ // limitations under the License. // -#include "jni/StateManager.h" +#include "StateManager.h" #ifdef __APPLE__ // Logging for CoreFoundation diff --git a/samples-android/TbmpSkeletonNative/build.gradle b/samples-android/TbmpSkeletonNative/build.gradle index a5e1045..b2cba16 100644 --- a/samples-android/TbmpSkeletonNative/build.gradle +++ b/samples-android/TbmpSkeletonNative/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.android.model.application' +apply plugin: 'com.android.application' // Depend on another project that downloads and unzips the C++ SDK. evaluationDependsOn(':Common/gpg-sdk') @@ -12,88 +12,31 @@ tasks.whenTaskAdded { task -> } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" - -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } - } - } - - android { - compileSdkVersion = 23 - buildToolsVersion = "23.0.2" - - defaultConfig.with { +android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { // // REPLACE THE APPLICATION ID with your bundle ID // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 - - versionCode = 1.0 - versionName = '1.0' - } + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 - } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/cpufeatures" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - srcDir '../Common/ndk_helper' - srcDir '../Common/jui_helper' - srcDir '../Common/external/jsoncpp/src/lib_json' - } - } + ndk { + abiFilters 'x86', 'armeabi-v7a' } } - android.ndk { - platformVersion = 11 - moduleName ="TBMPSkeletonNativeActivity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a","arm64-v8a", "x86"]) - cppFlags.addAll(["-std=c++11", - "-I${file("../Common/external/jsoncpp/include")}".toString(), - "-I${file("../Common/ndk_helper")}".toString(), - "-I${file("../Common/jui_helper")}".toString() ]) - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") - } + + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } - android.buildTypes { - release { - minifyEnabled=false - proguardFiles.add(file('proguard-android.txt')) - } } } - dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-nearby:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/TbmpSkeletonNative/src/main/jni/Android.mk b/samples-android/TbmpSkeletonNative/src/main/jni/Android.mk index 5d9769f..42abd83 100644 --- a/samples-android/TbmpSkeletonNative/src/main/jni/Android.mk +++ b/samples-android/TbmpSkeletonNative/src/main/jni/Android.mk @@ -10,7 +10,7 @@ LOCAL_SRC_FILES := TBMPSkeletonNativeActivity.cpp \ ../../../../Common/external/jsoncpp/src/lib_json/json_reader.cpp \ ../../../../Common/external/jsoncpp/src/lib_json/json_value.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. $(LOCAL_PATH)/../../../../Common/external/jsoncpp/include/ +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../Common/external/jsoncpp/include/ LOCAL_CFLAGS := LOCAL_CPPFLAGS := -std=c++11 @@ -31,10 +31,10 @@ endif include $(BUILD_SHARED_LIBRARY) +include $(LOCAL_PATH)/../../../../Common/gpg-sdk/gpg-cpp-sdk/android/Android.mk + $(call import-add-path,$(LOCAL_PATH)/../../../../Common) -$(call import-add-path,$(LOCAL_PATH)) $(call import-module,ndk_helper) $(call import-module,jui_helper) -$(call import-module,gpg-cpp-sdk/android) $(call import-module,android/native_app_glue) $(call import-module,android/cpufeatures) diff --git a/samples-android/Teapot/build.gradle b/samples-android/Teapot/build.gradle index eaacc0f..452fe2e 100644 --- a/samples-android/Teapot/build.gradle +++ b/samples-android/Teapot/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'com.android.model.application' +apply plugin: 'com.android.application' // Depend on another project that downloads and unzips the C++ SDK. evaluationDependsOn(':Common/gpg-sdk') @@ -12,80 +12,31 @@ tasks.whenTaskAdded { task -> } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" - -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } - } - } android { - compileSdkVersion=23 - buildToolsVersion="23.0.2" - - defaultConfig.with { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { // // REPLACE THE APPLICATION ID with your bundle ID // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 + ndk { + abiFilters 'x86', 'armeabi-v7a' } } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/cpufeatures" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - srcDir '../Common/ndk_helper' - srcDir '../Common/jui_helper' - } - } - } - } - android.ndk { - platformVersion = 11 - moduleName = "NativeGameActivity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a","arm64-v8a", "x86"]) - cppFlags.addAll(["-std=c++11", - "-I${file("../Common/ndk_helper")}".toString(), - "-I${file("../Common/jui_helper")}".toString() ]) - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") - } + + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } - android.buildTypes { - release { - minifyEnabled = false - proguardFiles.add(file('proguard-android.txt')) - } } } + dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-nearby:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/Teapot/src/main/AndroidManifest.xml b/samples-android/Teapot/src/main/AndroidManifest.xml index 9ef0fef..b80045a 100644 --- a/samples-android/Teapot/src/main/AndroidManifest.xml +++ b/samples-android/Teapot/src/main/AndroidManifest.xml @@ -3,11 +3,7 @@ android:versionCode="1" android:versionName="1.0" > - - - + } } -def gpg_cpp_path = file(project(':Common/gpg-sdk').projectDir).absolutePath + "/gpg-cpp-sdk/android" -// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] -// used to set stl and location of libgpg.a -def stlportType = "c++" -def stllinkType = "static" - -model { - repositories { - libs(PrebuiltLibraries) { - gpg { - headers.srcDir "${gpg_cpp_path}/include" - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("${gpg_cpp_path}/lib/${stlportType}/${targetPlatform.getName()}/libgpg.a") - } - } - } - } - - android { - compileSdkVersion = 23 - buildToolsVersion = "23.0.2" - - defaultConfig.with { +android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { // // REPLACE THE APPLICATION ID with your bundle ID // - applicationId="com.google.example.games.ReplaceMe" - minSdkVersion.apiLevel = 11 - targetSdkVersion.apiLevel = 23 - } + applicationId "com.google.example.games.ReplaceMe" + minSdkVersion 14 + targetSdkVersion 23 - } - android.sources { - main { - jni { - dependencies { - library "gpg" linkage "static" - project ":Common/cpufeatures" linkage "static" - project ":Common/native_app_glue" linkage "static" - } - source { - srcDir 'src/main/jni' - srcDir '../Common/ndk_helper' - srcDir '../Common/jui_helper' - } - } + ndk { + abiFilters 'x86', 'armeabi-v7a' } - } - android.ndk { - platformVersion = 11 - moduleName = "TrivialQuestNativeActivity" - stl = "${stlportType}_${stllinkType}" - ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) - abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"]) - cppFlags.addAll(["-std=c++11", - "-I${file("../Common/ndk_helper")}".toString(), - "-I${file("../Common/jui_helper")}".toString() ]) - } - android.abis { - create("armeabi-v7a") { - cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) - ldLibs.add("m_hard") - ldFlags.add("-Wl,--no-warn-mismatch") } + + externalNativeBuild { + ndkBuild { + path 'src/main/jni/Android.mk' } - android.buildTypes { - release { - minifyEnabled = false - proguardFiles.add(file('proguard-android.txt')) - } } } dependencies { - compile 'com.google.android.gms:play-services-games:8.4.0' - compile 'com.google.android.gms:play-services-nearby:8.4.0' + compile 'com.google.android.gms:play-services-games:10.0.0' + compile 'com.google.android.gms:play-services-nearby:10.0.0' compile 'com.android.support:support-v4:23.1.1' } diff --git a/samples-android/TrivialQuestNative/src/main/jni/Android.mk b/samples-android/TrivialQuestNative/src/main/jni/Android.mk index 0d7fb9e..6fb92ac 100644 --- a/samples-android/TrivialQuestNative/src/main/jni/Android.mk +++ b/samples-android/TrivialQuestNative/src/main/jni/Android.mk @@ -27,9 +27,10 @@ endif include $(BUILD_SHARED_LIBRARY) +include $(LOCAL_PATH)/../../../../Common/gpg-sdk/gpg-cpp-sdk/android/Android.mk + $(call import-add-path,$(LOCAL_PATH)/../../../../Common) $(call import-module,ndk_helper) $(call import-module,jui_helper) -$(call import-module,gpg-cpp-sdk/android) $(call import-module,android/native_app_glue) $(call import-module,android/cpufeatures) diff --git a/samples-android/build.gradle b/samples-android/build.gradle index 07826f7..bd08299 100644 --- a/samples-android/build.gradle +++ b/samples-android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle-experimental:0.7.0' + classpath 'com.android.tools.build:gradle:2.2.3' } } @@ -13,3 +13,5 @@ allprojects { jcenter() } } + +// GPG SDK requires r10e or eariler. diff --git a/samples-android/gradle/wrapper/gradle-wrapper.properties b/samples-android/gradle/wrapper/gradle-wrapper.properties index d570517..c5654ab 100644 --- a/samples-android/gradle/wrapper/gradle-wrapper.properties +++ b/samples-android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Tue Dec 06 09:12:50 PST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/samples-android/settings.gradle b/samples-android/settings.gradle index 8167c80..2ef200f 100644 --- a/samples-android/settings.gradle +++ b/samples-android/settings.gradle @@ -1,9 +1,8 @@ -include ':ButtonClicker', +include ':Common/gpg-sdk', + ':ButtonClicker', ':CollectAllTheStarsNative', ':Minimalist', ':TbmpSkeletonNative', ':Teapot', - ':TrivialQuestNative', - ':Common/cpufeatures', - ':Common/native_app_glue', - ':Common/gpg-sdk' + ':TrivialQuestNative' +