aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/android/helloworld/app/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'examples/android/helloworld/app/build.gradle')
-rw-r--r--examples/android/helloworld/app/build.gradle53
1 files changed, 53 insertions, 0 deletions
diff --git a/examples/android/helloworld/app/build.gradle b/examples/android/helloworld/app/build.gradle
new file mode 100644
index 0000000000..c6ab7308ae
--- /dev/null
+++ b/examples/android/helloworld/app/build.gradle
@@ -0,0 +1,53 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ defaultConfig {
+ applicationId "io.grpc.android.cpp.helloworldexample"
+ minSdkVersion 14
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ externalNativeBuild {
+ cmake {
+ cppFlags "-std=c++14 -frtti -fexceptions"
+ arguments '-DANDROID_STL=c++_static'
+ arguments '-DRUN_HAVE_POSIX_REGEX=0'
+ arguments '-DRUN_HAVE_STD_REGEX=0'
+ arguments '-DRUN_HAVE_STEADY_CLOCK=0'
+ arguments '-Dprotobuf_BUILD_PROTOC_BINARIES=off'
+ arguments '-DgRPC_BUILD_CODEGEN=off'
+ // Set this to the path to the protoc binary on the host system (codegen is not
+ // cross-compiled to Android)
+ arguments '-Dhelloworld_PROTOBUF_PROTOC_EXECUTABLE=/usr/local/bin/protoc'
+ // Set this to the path to the gRPC C++ protoc plugin binary on the host system
+ // (codegen is not cross-compiled to Android)
+ arguments '-Dhelloworld_GRPC_CPP_PLUGIN_EXECUTABLE=/usr/local/bin/grpc_cpp_plugin'
+ }
+ }
+ ndk.abiFilters 'x86'
+ }
+ buildTypes {
+ debug {
+ minifyEnabled false
+ }
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path "CMakeLists.txt"
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+}