Skip to content
Merged
Show file tree
Hide file tree
Changes from 178 commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
f380815
Gather artifacts after build.
jonsimantov Oct 9, 2020
ecac6e1
Remove tabs.
jonsimantov Oct 9, 2020
1a816bf
Fix step name.
jonsimantov Oct 9, 2020
aa0c2e4
Add job dependency.
jonsimantov Oct 9, 2020
cefe7fb
Fix Android tgz filename and untar files.
jonsimantov Oct 9, 2020
693d594
Fix tar path.
jonsimantov Oct 9, 2020
bee9a22
Don't make tar files with symlinks.
jonsimantov Oct 9, 2020
ca560d7
added support for x86 and win md/mt
vimanyu Oct 3, 2020
e98c033
fixed typo
vimanyu Oct 3, 2020
3dbe908
handling cmake configure for x86 on windows
vimanyu Oct 3, 2020
7b2154f
Print useful info after vcpkg step
vimanyu Oct 6, 2020
c73b015
added function to retreive path to vcpkg cmake toolchain file
vimanyu Oct 6, 2020
6373df6
changing default for crt_linkage
vimanyu Oct 6, 2020
932bcec
addressed code review notes
vimanyu Oct 6, 2020
7c3790e
addressed PR comments
vimanyu Oct 7, 2020
c65d2bc
Print library files on all platforms.
jonsimantov Oct 9, 2020
2b6ea29
Fix tabs.
jonsimantov Oct 9, 2020
83503a2
Add a build option to create ios libs instead of frameworks,
jonsimantov Oct 15, 2020
ba5d961
Add STL build implementation.
jonsimantov Oct 15, 2020
ed0cf9e
Fix stl specification.
jonsimantov Oct 15, 2020
35747f6
Fix workflow file.
jonsimantov Oct 15, 2020
39705ea
Add support for building libraries (instead of frameworks) to Mac des…
jonsimantov Oct 15, 2020
6944f97
Fix workflow matrix specification.
jonsimantov Oct 15, 2020
6c4f253
Fix workflow matrix specification.
jonsimantov Oct 15, 2020
bf8e035
Merge branch 'feature/js-packaging2' of https://github.com/firebase/f…
jonsimantov Oct 16, 2020
09496fb
Merge branch 'dev' into feature/js-packaging2
jonsimantov Oct 16, 2020
473a0d2
Update packaging to use new version of iOS build script.
jonsimantov Oct 16, 2020
e1aad28
Merge branch 'dev' into feature/js-packaging2
jonsimantov Oct 16, 2020
aa8be25
Add package script that takes frameworks built by the iOS build step …
jonsimantov Oct 17, 2020
71258db
Add packaging script to place readme and other files into the built SDK.
jonsimantov Oct 17, 2020
624797e
Small fixes in the packaging script, added skeleton of Android script.
jonsimantov Oct 17, 2020
4aa5106
Copy Android libraries into the correct place when packaging.
jonsimantov Oct 17, 2020
0bb5dff
Add iOS, Android, and general files to packaging step.
jonsimantov Oct 17, 2020
2bdc204
Fix desktop packaging step (still placeholder)
jonsimantov Oct 17, 2020
de25921
Removed unneeded packaging desktop step and fix a few issues with mer…
jonsimantov Oct 17, 2020
a18e042
Rename jobs and fix a typo in Android job.
jonsimantov Oct 17, 2020
cdecdc9
Fix Android build to use build instead of .externalNativeBuild direct…
jonsimantov Oct 17, 2020
aed27de
Fix tarfile path.
jonsimantov Oct 17, 2020
b6605bd
Fix package merging step shell commands.
jonsimantov Oct 17, 2020
b645c06
Change final SDK to be packaged as a folder, not a tarball.
jonsimantov Oct 17, 2020
f7231f6
Add initial version of desktop packaging script - linux x64 only.
jonsimantov Oct 17, 2020
9667e13
Add desktop (Linux) 64-bit to packaging step.
jonsimantov Oct 17, 2020
7bbc909
Only do debug builds on Windows.
jonsimantov Oct 17, 2020
216dce6
Exclude debug builds on mac/linux.
jonsimantov Oct 17, 2020
df91f4f
Add compatibility with Windows library names.
jonsimantov Oct 17, 2020
658276a
Fix packaging tools tgz path.
jonsimantov Oct 17, 2020
99064d5
Fix merge_libraries.py path.
jonsimantov Oct 17, 2020
d4dc048
Set up python on desktop packaging runner
jonsimantov Oct 18, 2020
25455e1
Updated desktop packaging script to use proper command-line options.
jonsimantov Oct 18, 2020
30dbb58
Fix prereqs script path.
jonsimantov Oct 18, 2020
cd757fc
Made -p <platform> required for packaging script.
jonsimantov Oct 18, 2020
0859a5e
Switch workflow to read tarfiles, also fix prereqs script.
jonsimantov Oct 18, 2020
81a4505
Properly determine build variant based on artifact filename.
jonsimantov Oct 18, 2020
f215b10
Add x86 and /MD /MT builds to desktop script.
jonsimantov Oct 18, 2020
ec1c3ea
Add missing msbuild
jonsimantov Oct 18, 2020
87b0918
Fix matrix specifier for linkage
jonsimantov Oct 18, 2020
b3f6f5c
Try to get exclusions working.
jonsimantov Oct 18, 2020
cc7c2b4
Redo inclusions/exclusions to fix matrix error
jonsimantov Oct 18, 2020
3d2c30a
Add full list to inclusions.
jonsimantov Oct 18, 2020
1e956b3
Restore matrix to before.
jonsimantov Oct 18, 2020
df8ec8e
Matrix test
jonsimantov Oct 18, 2020
3e1b3e0
Matrix attempt
jonsimantov Oct 18, 2020
9903e09
Matrix attempt again
jonsimantov Oct 18, 2020
b347093
Try to fix exclusions again
jonsimantov Oct 18, 2020
595a18a
Add additional CPU variants.
jonsimantov Oct 18, 2020
2db6e12
Omit python x86 version - not needed.
jonsimantov Oct 18, 2020
d085a62
Add additional variants to get_variant.sh script, handles mobile now …
jonsimantov Oct 18, 2020
2abc151
Since iOS and Android sometimes build multiple architectures in a sin…
jonsimantov Oct 18, 2020
8df1f10
Add error checking for cmake builds, and move packaging step to mac.
jonsimantov Oct 18, 2020
3a82edb
Make sure packaging script uses python 3.
jonsimantov Oct 18, 2020
7bc4f0c
Fix desktop prereqs in packaging step.
jonsimantov Oct 18, 2020
fd20576
Turn off strict C++ mode when running merge_libraries on Windows.
jonsimantov Oct 18, 2020
50d1753
Add workaround for absl not building.
jonsimantov Oct 18, 2020
33e0006
Work around a Firestore 32-bit building issue.
jonsimantov Oct 18, 2020
04b46b8
Ensure output of cmake commands if it fails.
jonsimantov Oct 18, 2020
fc10256
Fix python exception
jonsimantov Oct 18, 2020
6c2dbc6
Ignore error in running cmake.
jonsimantov Oct 18, 2020
9f4ced8
On android, disable fail-fast for matrix.
jonsimantov Oct 18, 2020
d865fd2
Install protobuf compiler if needed.
jonsimantov Oct 18, 2020
f3e6280
Fix output format
jonsimantov Oct 18, 2020
2df1042
Force apt to accept all prompts.
jonsimantov Oct 18, 2020
bed7c81
Fix library searching in packaging step.
jonsimantov Oct 18, 2020
58669ed
Fix indent
jonsimantov Oct 18, 2020
311010d
Add packaging step for windows and mac (no lipo/frameworks yet)
jonsimantov Oct 18, 2020
64a2f23
Remove extraneous echo.
jonsimantov Oct 18, 2020
39e41bd
Combine stderr and stdout in command output.
jonsimantov Oct 18, 2020
3682c1a
Fix a bug in merge_libraries that was including objc symbols in the r…
jonsimantov Oct 18, 2020
fb8b1b1
Fix subprocess.call error
jonsimantov Oct 18, 2020
7397156
Fix vcpkg triplet specifications, and look for libssl and libcrypto i…
jonsimantov Oct 18, 2020
5ee4866
Fix include spec
jonsimantov Oct 18, 2020
9935079
Remove bad commas
jonsimantov Oct 18, 2020
c04a5bb
Fixed cp command to be compatible with Windows
jonsimantov Oct 18, 2020
89e5e9e
Include debug vcpkg libs if building debug mode.
jonsimantov Oct 18, 2020
4a76afb
Fix path.
jonsimantov Oct 18, 2020
e85f109
Remove shell scripting code from windows
jonsimantov Oct 18, 2020
5ec4526
Move preservation of vcpkg libs to the build script instead of the gi…
jonsimantov Oct 18, 2020
8c85a74
Fix bad linux x86 vcpkg triplet
jonsimantov Oct 19, 2020
75d356e
Fix (?) vcpkg triplet for linux x86.
jonsimantov Oct 19, 2020
d4c7cd2
Fix (??) vcpkg triplets, since a workflow matrix include was wrong fo…
jonsimantov Oct 19, 2020
c8f18e9
Rename x86-linux-dynamic to x86-linux.
jonsimantov Oct 19, 2020
39c26ba
Temporarily remove the vcpkg-built libraries.
jonsimantov Oct 19, 2020
91144bd
Don't copy vcpkg files if missing. Print all files for debugging.
jonsimantov Oct 19, 2020
13f9620
Change x86-linux to x86-linux-dynamic vcpkg triplet again.
jonsimantov Oct 19, 2020
4e8f4dd
Added vcpkg files for other configs.
jonsimantov Oct 19, 2020
7b94264
Merge branch 'feature/js-packaging2' of https://github.com/firebase/f…
jonsimantov Oct 19, 2020
ffda090
Remove '-dynamic' name from x86 version of vcpkg linux triplet.
jonsimantov Oct 19, 2020
0d24234
Put Linux x86 vcpkg triplet back to -dynamic.
jonsimantov Oct 19, 2020
e03d6a8
Rather then spamming logs, put a text file in the artifact with the
jonsimantov Oct 19, 2020
c11358f
Remove tab
jonsimantov Oct 19, 2020
71343f8
Fix additional files like readme being put in the wrong directory.
jonsimantov Oct 19, 2020
2a0235e
Revert "Feature/support non standard vcpkg configs"
vimanyu Oct 13, 2020
d12ca1a
Support Windows debug library filenames.
jonsimantov Oct 19, 2020
f289fe0
Fix find command on windows.
jonsimantov Oct 19, 2020
c6bbf98
Remove references to crt_linkage for now.
jonsimantov Oct 19, 2020
16c520d
Remove crt_linkage from desktop build call.
jonsimantov Oct 19, 2020
b09dcbb
Fix merge step copying files incorrectly.
jonsimantov Oct 19, 2020
ca3786f
Fix filename scanning for Windows packaging.
jonsimantov Oct 19, 2020
17672b9
Add missing release/debug flag to desktop build. Also more fixes for …
jonsimantov Oct 19, 2020
74028c1
Add curl retry options.
jonsimantov Oct 19, 2020
4d9f304
Add retry for curl in Android prereqs script.
jonsimantov Oct 19, 2020
5e38d2f
Fix nostrict_cpp flag for windows packaging.
jonsimantov Oct 19, 2020
f46b2c7
Fixed an issue with binutils not automatically recognizing Windows
jonsimantov Oct 19, 2020
d2a9e07
Split Windows packaging into 4 runners.
jonsimantov Oct 19, 2020
eb8b8b6
Fix indent on matrix includes
jonsimantov Oct 20, 2020
f2821f7
Fixed includes again.
jonsimantov Oct 20, 2020
5748bcb
Fix includes AGAIN
jonsimantov Oct 20, 2020
d04aedf
Fix matrix for packaging to work properly with Windows.
jonsimantov Oct 20, 2020
bd77146
Split windows packaging even further, into 8 steps.
jonsimantov Oct 20, 2020
1fa3242
Fix Windows release library paths.
jonsimantov Oct 20, 2020
32e875b
Attempt to start packaging Windows builds immediately after the corre…
jonsimantov Oct 20, 2020
cc5ae65
Revert "Attempt to start packaging Windows builds immediately after t…
jonsimantov Oct 20, 2020
4c95393
Rename artifact names to match job names.
jonsimantov Oct 20, 2020
bb3a000
Cleaned up workflow names a bit.
jonsimantov Oct 20, 2020
65fbbc4
Fix last step of packaging.
jonsimantov Oct 20, 2020
1bef523
Add a script to finish packing Darwin libraries into universal librar…
jonsimantov Oct 20, 2020
063898d
Fix final package path creation.
jonsimantov Oct 20, 2020
36acdab
Fix call to darwin packaging, and re-enable build tests to get Firest…
jonsimantov Oct 20, 2020
c2dedcd
Merge branch 'feature/js-packaging2' of https://github.com/firebase/f…
jonsimantov Oct 20, 2020
e130552
Added better retry logic for curl, and also for android build which i…
jonsimantov Oct 20, 2020
67f0f6d
Add missing 'done' for retry for loop.
jonsimantov Oct 20, 2020
b55bc3f
Increase retry wait to 1 minute.
jonsimantov Oct 20, 2020
909eba9
Retry downloading NDK more times and wait longer between attempts.
jonsimantov Oct 20, 2020
5b8b367
Clean up retry logic.
jonsimantov Oct 20, 2020
a8a1bcf
Add log of built libraries and package contents, so we can better see…
jonsimantov Oct 20, 2020
438d374
Update workflow to build 2 versions of tools (linux and mac; only dar…
jonsimantov Oct 20, 2020
0451926
Fix malformed yml file
jonsimantov Oct 20, 2020
68683cf
Fix call to artifact deleter.
jonsimantov Oct 20, 2020
87ee30c
Remove bad compiler flag from windows firestore builds.
jonsimantov Oct 20, 2020
42b94ed
Add blank field to packaging matrix.
jonsimantov Oct 20, 2020
cf1099b
Fix matrix fields to be list.
jonsimantov Oct 20, 2020
ad36e2f
...and again.
jonsimantov Oct 20, 2020
818f8c4
Change packaging to use host OS directly via uname.
jonsimantov Oct 20, 2020
fdbbb25
Temporarily remove everything else to check the test matrix.
jonsimantov Oct 20, 2020
f2cb27b
matrix test
jonsimantov Oct 20, 2020
1547f95
figure out which has the blank runs_on
jonsimantov Oct 20, 2020
e1f8850
add packaging back in with correct matrix.
jonsimantov Oct 20, 2020
748efbd
Add missing "jobs" field.
jonsimantov Oct 20, 2020
22208e0
Fix packaging flags.
jonsimantov Oct 21, 2020
5630734
Fix Windows packaging to also consider *.res files inside .lib archiv…
jonsimantov Oct 21, 2020
34570af
Hide 'google' namespace, which protobuf in grpc in firestore uses.
jonsimantov Oct 21, 2020
3af1cae
Switch to a different artifact deleter.
jonsimantov Oct 21, 2020
8d0b9af
Remove tabs.
jonsimantov Oct 21, 2020
a4bcc54
Remove bad flag
jonsimantov Oct 21, 2020
e5f422e
Fix indentation.
jonsimantov Oct 21, 2020
6bf5280
Remove extraneous firebase_app.framework from ios build.
jonsimantov Oct 21, 2020
c487170
Merge branch 'feature/js-packaging2' of https://github.com/firebase/f…
jonsimantov Oct 21, 2020
0295aea
Merge branch 'dev' into feature/js-packaging2
jonsimantov Oct 26, 2020
5368c8f
Add packaging config so we can choose which Firebase C++ products are…
jonsimantov Oct 26, 2020
6539222
Add additional parameters for packaging step.
jonsimantov Oct 26, 2020
d9e1a84
Modify parameter text
jonsimantov Oct 26, 2020
04488be
Change parameter descriptions again.
jonsimantov Oct 26, 2020
d70762d
Shorten parameter names even more.
jonsimantov Oct 26, 2020
81ceb57
Add option for downloading built SDK.
jonsimantov Oct 26, 2020
a2eedff
Added verification for version number to match regex.
jonsimantov Oct 26, 2020
b389a33
Fix integration test job to work even if only one of its parents succ…
jonsimantov Oct 26, 2020
c9276ca
Fix syntax
jonsimantov Oct 26, 2020
3b91fe8
Change integration tests to try running always.
jonsimantov Oct 26, 2020
b22bc81
Add source checkout to integration test step.
jonsimantov Oct 26, 2020
74fad76
Reworded lipo comment.
jonsimantov Oct 26, 2020
35ffc2f
Rename linkage variable to msvc_crt_linkage for clarity.
jonsimantov Oct 26, 2020
c367e1f
Make sure STL variant specified in package script is valid.
jonsimantov Oct 26, 2020
1793d2c
Fix bug in darwin finishing script.
jonsimantov Oct 26, 2020
38c28e4
Add comments around curl / gradle retries, explaining why.
jonsimantov Oct 26, 2020
da71f55
Updated TARGET_FORMAT cmake option to FIREBASE_XCODE_TARGET_FORMAT an…
jonsimantov Oct 26, 2020
da0afa7
Fix whitespace.
jonsimantov Oct 26, 2020
cee79e1
Fix build error with --config option missing.
jonsimantov Oct 26, 2020
7c68e03
Add workflow parameter for running tests against a previous run's bui…
jonsimantov Oct 27, 2020
d60d003
Small change to Android script to not print the path unnecessarily.
jonsimantov Oct 27, 2020
a4ad766
Fix conditionals for downloadPreviousRun parameter.
jonsimantov Oct 27, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
416 changes: 375 additions & 41 deletions .github/workflows/cpp-packaging.yml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ option(FIREBASE_CPP_BUILD_PACKAGE
option(FIREBASE_CPP_USE_PRIOR_GRADLE_BUILD
"When building with Gradle, use the previously built libraries." OFF)

set(FIREBASE_ANDROID_STL "" CACHE STRING "STL implementation to use.")
if (NOT FIREBASE_ANDROID_STL STREQUAL "")
set(ANDROID_STL ${FIREBASE_ANDROID_STL})
endif()

# Define this directory to be the root of the C++ SDK, which the libraries can
# then refer to.
set(FIREBASE_CPP_SDK_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
Expand Down
10 changes: 7 additions & 3 deletions admob/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ elseif(IOS)
# accomplish that.
symlink_pod_headers(firebase_admob Google-Mobile-Ads-SDK GoogleMobileAds)

set_target_properties(firebase_admob PROPERTIES
FRAMEWORK TRUE
)
set(TARGET_FORMAT "frameworks" CACHE STRING
"Format to output, 'frameworks' or 'libraries'")
if (TARGET_FORMAT STREQUAL "frameworks")
set_target_properties(firebase_admob PROPERTIES
FRAMEWORK TRUE
)
endif()
endif()

cpp_pack_library(firebase_admob "")
Expand Down
12 changes: 9 additions & 3 deletions admob/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ allprojects {

apply plugin: 'com.android.library'

ext {
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
Expand Down Expand Up @@ -67,8 +72,9 @@ android {
// Only include needed project.
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
'-DFIREBASE_INCLUDE_ADMOB=ON'
}
'-DFIREBASE_INCLUDE_ADMOB=ON',
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
}
}
}

Expand All @@ -85,4 +91,4 @@ apply from: "$rootDir/android_build_files/generate_proguard.gradle"
project.afterEvaluate {
generateProguardFile('admob')
setupDexDependencies(':admob:admob_resources')
}
}
10 changes: 7 additions & 3 deletions analytics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ elseif(IOS)
FirebaseAnalytics
)

set_target_properties(firebase_analytics PROPERTIES
FRAMEWORK TRUE
)
set(TARGET_FORMAT "frameworks" CACHE STRING
"Format to output, 'frameworks' or 'libraries'")
if (TARGET_FORMAT STREQUAL "frameworks")
set_target_properties(firebase_analytics PROPERTIES
FRAMEWORK TRUE
)
endif()
endif()

if(FIREBASE_CPP_BUILD_TESTS)
Expand Down
10 changes: 8 additions & 2 deletions analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ allprojects {

apply plugin: 'com.android.library'

ext {
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
Expand Down Expand Up @@ -67,7 +72,8 @@ android {
// Only include needed project.
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
'-DFIREBASE_INCLUDE_ANALYTICS=ON'
'-DFIREBASE_INCLUDE_ANALYTICS=ON',
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
}
}
}
Expand All @@ -84,4 +90,4 @@ apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
apply from: "$rootDir/android_build_files/generate_proguard.gradle"
project.afterEvaluate {
generateProguardFile('analytics')
}
}
10 changes: 7 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,13 @@ endif()

if (IOS)
# IOS build framework
set_target_properties(firebase_app PROPERTIES
FRAMEWORK TRUE
)
set(TARGET_FORMAT "frameworks" CACHE STRING
"Format to output, 'frameworks' or 'libraries'")
if (TARGET_FORMAT STREQUAL "frameworks")
set_target_properties(firebase_app PROPERTIES
FRAMEWORK TRUE
)
endif()

# framework header files
set(admob_HDRS
Expand Down
10 changes: 8 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ allprojects {

apply plugin: 'com.android.library'

ext {
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
Expand Down Expand Up @@ -63,7 +68,8 @@ android {
cmake {
targets 'firebase_app'
// Don't configure all the cmake subprojects.
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF'
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
}
}
}
Expand All @@ -80,4 +86,4 @@ project.afterEvaluate {
setupDexDependencies(':app:app_resources')
setupDexDependencies(':app:google_api_resources')
setupDexDependencies(':app:invites_resources')
}
}
10 changes: 7 additions & 3 deletions auth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ elseif(IOS)
FirebaseCore
FirebaseAuth
)
set_target_properties(firebase_auth PROPERTIES
FRAMEWORK TRUE
)
set(TARGET_FORMAT "frameworks" CACHE STRING
"Format to output, 'frameworks' or 'libraries'")
if (TARGET_FORMAT STREQUAL "frameworks")
set_target_properties(firebase_auth PROPERTIES
FRAMEWORK TRUE
)
endif()
endif()

if(FIREBASE_CPP_BUILD_TESTS)
Expand Down
10 changes: 8 additions & 2 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ allprojects {

apply plugin: 'com.android.library'

ext {
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
Expand Down Expand Up @@ -67,7 +72,8 @@ android {
// Only include needed project.
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
'-DFIREBASE_INCLUDE_AUTH=ON'
'-DFIREBASE_INCLUDE_AUTH=ON',
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
}
}
}
Expand All @@ -85,4 +91,4 @@ apply from: "$rootDir/android_build_files/generate_proguard.gradle"
project.afterEvaluate {
generateProguardFile('auth')
setupDexDependencies(':auth:auth_resources')
}
}
37 changes: 31 additions & 6 deletions build_scripts/android/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash -ex
#!/bin/bash -e

buildpath=$1
sourcepath=$2
stl=$3

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

Expand All @@ -13,6 +14,16 @@ if [[ ! -d "${sourcepath}" ]]; then
exit 2
fi

if [[ "${stl}" == "c++" || "${stl}" == "gnustl" || "${stl}" == "stlport" ]]; then
export FIREBASE_ANDROID_STL="${stl}"_static
elif [[ ! -z "${stl}" ]]; then
echo "Invalid STL specified."
echo "Valid STLs are: 'c++' (default), 'gnustl', or 'stlport'"
exit 2
fi



mkdir -p "${buildpath}"
cd "${buildpath}"
if [[ -n $(ls) ]]; then
Expand All @@ -25,14 +36,28 @@ cd -
# If NDK_ROOT is not set or is the wrong version, use to the version in /tmp.
if [[ -z "${NDK_ROOT}" || ! $(grep -q "Pkg\.Revision = 16\." "${NDK_ROOT}/source.properties") ]]; then
if [[ ! -d /tmp/android-ndk-r16b ]]; then
echo "NDK r16b not present in /tmp, please run install_prereqs.sh script."
echo "Recommended NDK version r16b not present in /tmp."
if [[ ! -z "${stl}" ]]; then
echo "STL may only be specified if using the recommended NDK version."
echo "Please run install_prereqs.sh script and try again."
exit 2
else
echo "Please run install_prereqs.sh if you wish to use the recommended NDK version."
echo "Continuing with default NDK..."
sleep 2
fi
fi
export NDK_ROOT=/tmp/android-ndk-r16b
export ANDROID_NDK_HOME=/tmp/android-ndk-r16b
fi
set -ex
cd "${sourcepath}"
./gradlew assembleRelease
set +x
set +e
for retry in {1..10} error; do
if [[ $retry == "error" ]]; then exit 5; fi
./gradlew assembleRelease && break
sleep 300
done
set -e

# Gradle puts the build output inside the source tree, in various
# "build" and ".externalNativeBuild" directories. Grab them and place
Expand Down
26 changes: 18 additions & 8 deletions build_scripts/android/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ elif [[ $(uname) == "Linux" ]]; then
else
platform=windows
# On Windows, we have an additional dependency for Strings
curl -LSs \ curl -LSs \
"https://download.sysinternals.com/files/Strings.zip" \
--output Strings.zip
set +e
for retry in {1..10} error; do
if [[ $retry == "error" ]]; then exit 5; fi
curl -LSs \
"https://download.sysinternals.com/files/Strings.zip" \
--output Strings.zip && break
sleep 300
done
set -e
unzip -q Strings.zip && rm -f Strings.zip
fi

Expand Down Expand Up @@ -61,12 +67,16 @@ if [[ -z "${NDK_ROOT}" || -z $(grep "Pkg\.Revision = 16\." "${NDK_ROOT}/source.p
echo "Error, could not run 'curl' to download NDK. Is it in your PATH?"
exit 1
fi
set -x
curl -LSs \
"https://dl.google.com/android/repository/android-ndk-r16b-${platform}-x86_64.zip" \
--output /tmp/android-ndk-r16b.zip
set +e
for retry in {1..10} error; do
if [[ $retry == "error" ]]; then exit 5; fi
curl -LSs \
"https://dl.google.com/android/repository/android-ndk-r16b-${platform}-x86_64.zip" \
--output /tmp/android-ndk-r16b.zip && break
sleep 300
done
set -e
(cd /tmp && unzip -q android-ndk-r16b.zip && rm -f android-ndk-r16b.zip)
set +x
echo "NDK r16b has been downloaded into /tmp/android-ndk-r16b"
fi
fi
51 changes: 51 additions & 0 deletions build_scripts/android/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash -e

builtpath=$1
packagepath=$2
stl=$3

if [[ -z "${builtpath}" || -z "${packagepath}" || -z "${stl}" ]]; then
echo "Usage: $0 <built Android SDK path> <path to put packaged files into> <STL variant>"
echo "STL variant is one of: c++ gnustl stlport"
exit 1
fi

if [[ ! -d "${builtpath}/app/build" ]]; then
echo "Built Android SDK not found at path '${builtpath}'."
exit 2
fi

root_dir=$(cd $(dirname $0)/../..; pwd -P)
. "${root_dir}/build_scripts/packaging.conf"
origpath=$( pwd -P )

mkdir -p "${packagepath}"
cd "${packagepath}"
destpath=$( pwd -P )
cd "${origpath}"

cd "${builtpath}"
sourcepath=$( pwd -P )
cd "${origpath}"

mkdir -p "${destpath}/libs/android"

# Copy each platform's libraries to the destination directory for this STL variant.
cd "${sourcepath}"
# Make sure we only copy the libraries in product_list (specified in packaging.conf)
for product in ${product_list[*]}; do
if [[ ! -d "${product}/build/intermediates/cmake/release/obj" ]]; then
continue
fi
dir="${product}/build/intermediates/cmake/release/obj"
for cpudir in "${dir}"/*; do
cpu=$(basename ${cpudir})
libsrc="${sourcepath}/${cpudir}/libfirebase_${product}.a"
libdest="${destpath}/libs/android/${cpu}/${stl}"
mkdir -p "${libdest}"
cp -f "${libsrc}" "${libdest}/"
done
# Copy the top-level Proguard files in as well.
cp -f "${sourcepath}/${product}/build/Release/${product}.pro" "${destpath}/libs/android/"
done
cd "${origpath}"
Loading