• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1apply plugin: 'com.android.application'
2
3android {
4    compileSdkVersion 26
5    defaultConfig {
6        applicationId "io.grpc.android.interop.cpp"
7        minSdkVersion 14
8        targetSdkVersion 26
9        versionCode 1
10        versionName "1.0"
11        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12        externalNativeBuild {
13            cmake {
14                // The paths to the protoc and grpc_cpp_plugin binaries on the host system (codegen
15                // is not cross-compiled to Android)
16                def protoc = project.hasProperty('protoc') ?
17                        project.property('protoc') : '/usr/local/bin/protoc'
18                def grpc_cpp_plugin = project.hasProperty('grpc_cpp_plugin') ?
19                        project.property('grpc_cpp_plugin') : '/usr/local/bin/grpc_cpp_plugin'
20
21                cppFlags "-std=c++14 -frtti -fexceptions"
22                arguments '-DANDROID_STL=c++_shared'
23                arguments '-DRUN_HAVE_POSIX_REGEX=0'
24                arguments '-DRUN_HAVE_STD_REGEX=0'
25                arguments '-DRUN_HAVE_STEADY_CLOCK=0'
26                arguments '-Dprotobuf_BUILD_PROTOC_BINARIES=off'
27                arguments '-DgRPC_BUILD_CODEGEN=off'
28                arguments '-DPROTOBUF_PROTOC_EXECUTABLE=' + protoc
29                arguments '-DgRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin
30            }
31        }
32        ndk {
33            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
34        }
35    }
36    buildTypes {
37        debug {
38            minifyEnabled false
39        }
40        release {
41            minifyEnabled true
42            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
43        }
44    }
45    externalNativeBuild {
46        cmake {
47            path "CMakeLists.txt"
48        }
49    }
50}
51
52dependencies {
53    implementation fileTree(dir: 'libs', include: ['*.jar'])
54    implementation 'com.android.support:appcompat-v7:26.1.0'
55    testImplementation 'junit:junit:4.12'
56    androidTestImplementation 'com.android.support.test:runner:1.0.1'
57    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
58}
59