Skip to content

Commit 65e16b5

Browse files
authored
Remove gnustl support and update NDK (#889)
* Initial removal of GNUSTL, doesn't change directory. * Change NDK we build with to r21e. * Change cached NDK from r16b to r21e. * Change all NDK cache paths from r16b to r21e to reflect updated version.
1 parent cb4f636 commit 65e16b5

File tree

23 files changed

+82
-192
lines changed

23 files changed

+82
-192
lines changed

.github/workflows/android.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@ jobs:
9292
id: cache_ndk
9393
uses: actions/cache@v2
9494
with:
95-
path: /tmp/android-ndk-r16b
96-
key: android-ndk-${{ matrix.os }}-r16b
95+
path: /tmp/android-ndk-r21e
96+
key: android-ndk-${{ matrix.os }}-r21e
9797

9898
- name: Check cached NDK
9999
shell: bash
100100
if: steps.cache_ndk.outputs.cache-hit != 'true'
101101
run: |
102102
# If the NDK failed to download from the cache, but there is a
103-
# /tmp/android-ndk-r16b directory, it's incomplete, so remove it.
104-
if [[ -d "/tmp/android-ndk-r16b" ]]; then
103+
# /tmp/android-ndk-r21e directory, it's incomplete, so remove it.
104+
if [[ -d "/tmp/android-ndk-r21e" ]]; then
105105
echo "Removing incomplete download of NDK"
106-
rm -rf /tmp/android-ndk-r16b
106+
rm -rf /tmp/android-ndk-r21e
107107
fi
108108
109109
- name: Update homebrew (avoid bintray errors)

.github/workflows/cpp-packaging.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,11 @@ jobs:
237237
path: firebase-cpp-sdk-ios-tvos-package.tgz
238238

239239
build_and_package_android:
240-
name: build-and-package-android-${{matrix.stl}}
240+
name: build-and-package-android
241241
runs-on: ubuntu-latest
242242
if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }}
243243
strategy:
244244
fail-fast: false
245-
matrix:
246-
stl: ["c++", "gnustl"]
247245
steps:
248246
- name: fetch SDK
249247
uses: actions/checkout@v2.3.1
@@ -261,18 +259,18 @@ jobs:
261259
id: cache_ndk
262260
uses: actions/cache@v2
263261
with:
264-
path: /tmp/android-ndk-r16b
265-
key: android-ndk-${{ matrix.os }}-r16b
262+
path: /tmp/android-ndk-r21e
263+
key: android-ndk-${{ runner.os }}-r21e
266264

267265
- name: install prerequisites
268266
run: sdk-src/build_scripts/android/install_prereqs.sh
269267

270268
- name: build sdk
271269
run: |
272-
sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android-${{ matrix.stl }}-build sdk-src ${{ matrix.stl }}
273-
sdk-src/build_scripts/android/package.sh firebase-cpp-sdk-android-${{ matrix.stl }}-build firebase-cpp-sdk-android-${{ matrix.stl }}-package ${{ matrix.stl }}
274-
cd firebase-cpp-sdk-android-${{ matrix.stl }}-package
275-
tar -czhf ../firebase-cpp-sdk-android-${{ matrix.stl}}-package.tgz .
270+
sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android-build sdk-src
271+
sdk-src/build_scripts/android/package.sh firebase-cpp-sdk-android-build firebase-cpp-sdk-android-package
272+
cd firebase-cpp-sdk-android-package
273+
tar -czhf ../firebase-cpp-sdk-android-package.tgz .
276274
277275
- name: Print built libraries
278276
shell: bash
@@ -292,8 +290,8 @@ jobs:
292290
- name: upload artifacts
293291
uses: actions/upload-artifact@v2.2.2
294292
with:
295-
name: firebase-cpp-sdk-android-${{ matrix.stl }}-package
296-
path: firebase-cpp-sdk-android-${{ matrix.stl }}-package.tgz
293+
name: firebase-cpp-sdk-android-package
294+
path: firebase-cpp-sdk-android-package.tgz
297295

298296
build_desktop:
299297
name: build-${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ jobs:
433433
id: cache_ndk
434434
uses: actions/cache@v2
435435
with:
436-
path: /tmp/android-ndk-r16b
437-
key: android-ndk-${{ matrix.os }}-r16b
436+
path: /tmp/android-ndk-r21e
437+
key: android-ndk-${{ matrix.os }}-r21e
438438
- name: Setup python
439439
uses: actions/setup-python@v2
440440
with:

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ option(FIREBASE_GITHUB_ACTION_BUILD
8181
option(FIREBASE_QUICK_TEST
8282
"Enable quick tests will skip tests which requires access to the SECRET" OFF)
8383

84-
set(FIREBASE_ANDROID_STL "" CACHE STRING "STL implementation to use.")
85-
if (NOT FIREBASE_ANDROID_STL STREQUAL "")
86-
set(ANDROID_STL ${FIREBASE_ANDROID_STL})
87-
endif()
88-
8984
set(FIREBASE_PYTHON_EXECUTABLE "python" CACHE FILEPATH
9085
"The Python interpreter to use, such as one from a venv")
9186

admob/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33-
ext {
34-
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35-
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36-
}
37-
3833
android {
3934
compileSdkVersion 28
4035
buildToolsVersion '28.0.3'
@@ -71,8 +66,7 @@ android {
7166
// Only include needed project.
7267
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
7368
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
74-
'-DFIREBASE_INCLUDE_ADMOB=ON',
75-
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
69+
'-DFIREBASE_INCLUDE_ADMOB=ON'
7670
}
7771
}
7872
}

analytics/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33-
ext {
34-
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35-
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36-
}
37-
3833
android {
3934
compileSdkVersion 28
4035
buildToolsVersion '28.0.3'
@@ -71,8 +66,7 @@ android {
7166
// Only include needed project.
7267
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
7368
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
74-
'-DFIREBASE_INCLUDE_ANALYTICS=ON',
75-
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
69+
'-DFIREBASE_INCLUDE_ANALYTICS=ON'
7670
}
7771
}
7872
}

app/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33-
ext {
34-
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35-
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36-
}
37-
3833
android {
3934
compileSdkVersion 28
4035
buildToolsVersion '28.0.3'
@@ -67,8 +62,7 @@ android {
6762
cmake {
6863
targets 'firebase_app'
6964
// Don't configure all the cmake subprojects.
70-
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
71-
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
65+
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF'
7266
}
7367
}
7468
}

app/src/include/firebase/app.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ namespace internal {
5050
class AppInternal;
5151
} // namespace internal
5252

53-
#if FIREBASE_PLATFORM_ANDROID && defined(__GLIBCXX__)
54-
#warning \
55-
"Firebase support for gnustl is deprecated and will be removed in the next major release. Please use libc++ instead."
56-
#endif
57-
5853
/// @brief Reports whether a Firebase module initialized successfully.
5954
enum InitResult {
6055
/// The given library was successfully initialized.

auth/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33-
ext {
34-
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35-
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36-
}
37-
3833
android {
3934
compileSdkVersion 28
4035
buildToolsVersion '28.0.3'
@@ -71,8 +66,7 @@ android {
7166
// Only include needed project.
7267
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
7368
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
74-
'-DFIREBASE_INCLUDE_AUTH=ON',
75-
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
69+
'-DFIREBASE_INCLUDE_AUTH=ON'
7670
}
7771
}
7872
}

build_scripts/android/build.sh

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
buildpath=$1
66
sourcepath=$2
7-
stl=$3
87

98
if [[ -z "${buildpath}" || -z "${sourcepath}" ]]; then
10-
echo "Usage: $0 <build path> <source path> [c++|gnustl]"
9+
echo "Usage: $0 <build path> <source path> [c++]"
1110
exit 1
1211
fi
1312

@@ -16,14 +15,6 @@ if [[ ! -d "${sourcepath}" ]]; then
1615
exit 2
1716
fi
1817

19-
if [[ "${stl}" == "c++" || "${stl}" == "gnustl" ]]; then
20-
export FIREBASE_ANDROID_STL="${stl}"_static
21-
elif [[ ! -z "${stl}" ]]; then
22-
echo "Invalid STL specified."
23-
echo "Valid STLs are: 'c++' (default) or 'gnustl'"
24-
exit 2
25-
fi
26-
2718
origpath=$( pwd -P )
2819

2920
mkdir -p "${buildpath}"
@@ -36,21 +27,15 @@ absbuildpath=$( pwd -P )
3627
cd "${origpath}"
3728

3829
# If NDK_ROOT is not set or is the wrong version, use to the version in /tmp.
39-
if [[ -z "${NDK_ROOT}" || ! $(grep -q "Pkg\.Revision = 16\." "${NDK_ROOT}/source.properties") ]]; then
40-
if [[ ! -d /tmp/android-ndk-r16b ]]; then
41-
echo "Recommended NDK version r16b not present in /tmp."
42-
if [[ ! -z "${stl}" ]]; then
43-
echo "STL may only be specified if using the recommended NDK version."
44-
echo "Please run install_prereqs.sh script and try again."
45-
exit 2
46-
else
47-
echo "Please run install_prereqs.sh if you wish to use the recommended NDK version."
48-
echo "Continuing with default NDK..."
49-
sleep 2
50-
fi
30+
if [[ -z "${NDK_ROOT}" || ! $(grep -q "Pkg\.Revision = 21\." "${NDK_ROOT}/source.properties") ]]; then
31+
if [[ ! -d /tmp/android-ndk-r21e ]]; then
32+
echo "Recommended NDK version r21e not present in /tmp."
33+
echo "Please run install_prereqs.sh if you wish to use the recommended NDK version."
34+
echo "Continuing with default NDK..."
35+
sleep 2
5136
fi
52-
export NDK_ROOT=/tmp/android-ndk-r16b
53-
export ANDROID_NDK_HOME=/tmp/android-ndk-r16b
37+
export NDK_ROOT=/tmp/android-ndk-r21e
38+
export ANDROID_NDK_HOME=/tmp/android-ndk-r21e
5439
fi
5540
cd "${sourcepath}"
5641
set +e
@@ -72,16 +57,16 @@ set -e
7257
declare -a paths
7358
for lib in *; do
7459
if [[ -d "${lib}/build" ]]; then
75-
paths+=("${lib}/build")
60+
paths+=("${lib}/build")
7661
fi
7762
if [[ -d "${lib}/.externalNativeBuild" ]]; then
78-
paths+=("${lib}/.externalNativeBuild")
63+
paths+=("${lib}/.externalNativeBuild")
7964
fi
8065
if [[ -d "${lib}/${lib}_resources/build" ]]; then
81-
paths+=("${lib}/${lib}_resources/build")
66+
paths+=("${lib}/${lib}_resources/build")
8267
fi
8368
if [[ -d "${lib}/${lib}_java/build" ]]; then
84-
paths+=("${lib}/${lib}_java/build")
69+
paths+=("${lib}/${lib}_java/build")
8570
fi
8671
done
8772
set -x

0 commit comments

Comments
 (0)