|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion 26
|
|
|
|
ndkVersion "25.1.8937393"
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "io.grpc.android.cpp.helloworldexample"
|
|
|
|
minSdkVersion 21
|
|
|
|
// noinspection ExpiredTargetSDKVersion
|
|
|
|
targetSdkVersion 26
|
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
// The paths to the protoc and grpc_cpp_plugin binaries on the host system (codegen
|
|
|
|
// is not cross-compiled to Android)
|
|
|
|
def protoc = project.hasProperty('protoc') ?
|
|
|
|
project.property('protoc') : '/usr/local/bin/protoc'
|
|
|
|
def grpc_cpp_plugin = project.hasProperty('grpc_cpp_plugin') ?
|
|
|
|
project.property('grpc_cpp_plugin') : '/usr/local/bin/grpc_cpp_plugin'
|
|
|
|
|
|
|
|
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'
|
|
|
|
arguments '-Dhelloworld_PROTOBUF_PROTOC_EXECUTABLE=' + protoc
|
|
|
|
arguments '-Dhelloworld_GRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin
|
[protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.
This is best reviewed commit-by-commit, I tried to group changes in
logical areas.
Notable changes:
- the upgrade of third_party/protobuf submodule, the bazel protobuf
dependency itself
- upgrade of UPB dependency to 22.x (in the past, we used to always
upgrade upb to "main", but upb now has release branch as well). UPB
needs to be upgraded atomically with protobuf since there's a de-facto
circular dependency (new protobuf depends on new upb, which depends on
new protobuf for codegen).
- some protobuf and upb bazel rules are now aliases, so `
extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py`
had to be modified to be able to follow aliases and reach the actual
aliased targets.
- some protobuf public headers were renamed, so especially
`src/compiler` needed to be updated to use the new headers.
- protobuf and upb now both depend on utf8_range project, so since we
bundle upb with grpc in some languages, we now have to bundle utf8_range
as well (hence changes in build for python, PHP, objC, cmake etc).
- protoc now depends on absl and utf8_range (previously protobuf had
absl dependency, but not for the codegen part), so python's
make_grpcio_tools.py required partial rewrite to be able to handle those
dependencies in the grpcio_tools build.
- many updates and fixes required for C++ distribtests (currently they
all pass, but we'll probably need to follow up, make protobuf's and
grpc's handling of dependencies more aligned and revisit the
distribtests)
- bunch of other changes mostly due to overhaul of protobuf's and upb's
internal build layout.
TODOs:
- [DONE] make sure IWYU and clang_tidy_code pass
- create a list of followups (e.g. work to reenable the few tests I had
to disable and to remove workaround I had to use)
- [DONE in cl/523706129] figure out problem(s) with internal import
---------
Co-authored-by: Craig Tiller <ctiller@google.com>
2 years ago
|
|
|
arguments '-Dprotobuf_INSTALL=OFF'
|
|
|
|
arguments '-Dutf8_range_ENABLE_INSTALL=OFF'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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'
|
|
|
|
}
|