| 1 |
apply plugin: 'com.android.application' |
| 2 |
|
| 3 |
android { |
| 4 |
compileSdkVersion 26 |
| 5 |
defaultConfig { |
| 6 |
applicationId "io.grpc.android.cpp.helloworldexample" |
| 7 |
minSdkVersion 21 |
| 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++_static' |
| 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 '-Dhelloworld_PROTOBUF_PROTOC_EXECUTABLE=' + protoc |
| 29 |
arguments '-Dhelloworld_GRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin |
| 30 |
} |
| 31 |
} |
| 32 |
ndk.abiFilters 'x86' |
| 33 |
} |
| 34 |
buildTypes { |
| 35 |
debug { |
| 36 |
minifyEnabled false |
| 37 |
} |
| 38 |
release { |
| 39 |
minifyEnabled true |
| 40 |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 41 |
} |
| 42 |
} |
| 43 |
externalNativeBuild { |
| 44 |
cmake { |
| 45 |
path "CMakeLists.txt" |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
dependencies { |
| 51 |
implementation fileTree(dir: 'libs', include: ['*.jar']) |
| 52 |
implementation 'com.android.support:appcompat-v7:26.1.0' |
| 53 |
testImplementation 'junit:junit:4.12' |
| 54 |
androidTestImplementation 'com.android.support.test:runner:1.0.1' |
| 55 |
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' |
| 56 |
} |