Skip to content

Commit

Permalink
android build
Browse files Browse the repository at this point in the history
  • Loading branch information
hyp committed May 17, 2024
1 parent a37ec70 commit 6c46445
Showing 1 changed file with 89 additions and 1 deletion.
90 changes: 89 additions & 1 deletion .github/workflows/bcny-firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
jobs:
windows:
runs-on: windows-latest
if: false

strategy:
fail-fast: false
fail-fast: true
matrix:
include:
- arch: 'amd64'
Expand Down Expand Up @@ -302,3 +303,90 @@ jobs:
$pkgs = Get-ChildItem -Path com.google.firebase.windows.${{ matrix.arch }}.*.nupkg
nuget push $pkgs[0].Name -Source ${env:NUGET_SOURCE_URL} -SkipDuplicate
shell: pwsh

android:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
include:
- arch: 'arm64-v8a'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: ${{ github.workspace }}/SourceCache/firebase-cpp-sdk
ref: refs/heads/compnerd/swift
repository: thebrowsercompany/firebase-cpp-sdk

- name: Install Ninja
run: sudo apt-get install -y ninja-build

#- name: Set up JDK
# uses: actions/setup-java@v2
# with:
# java-version: '11'
# distribution: 'adopt'

- name: Download Android NDK
run: |
NDK_VERSION="r21e"
NDK_FILE="android-ndk-${NDK_VERSION}-linux-x86_64.zip"
curl -L -o "${NDK_FILE}" "https://dl.google.com/android/repository/${NDK_FILE}"
unzip -q "${NDK_FILE}"
rm "${NDK_FILE}"
echo "NDK_ROOT=$(pwd)/android-ndk-${NDK_VERSION}" >> $GITHUB_ENV
echo "ANDROID_NDK_HOME=$(pwd)/android-ndk-${NDK_VERSION}" >> $GITHUB_ENV
- name: Install absl-py
run: pip install absl-py

- name: Build SDK
shell: bash
if: false
run: |
cd ${{ github.workspace }}/SourceCache/firebase-cpp-sdk
build_scripts/android/build.sh android_build .
- name: test
run: |
ls $NDK_ROOT
echo $NDK_ROOT
which cmake
which ninja
ls ${{ github.workspace }}/SourceCache/firebase-cpp-sdk
echo "doing"
export SRC=${{ github.workspace }}/SourceCache/firebase-cpp-sdk
export DST=${{ github.workspace }}/SourceCache/firebase-cpp-sdk
function cmake_build {
arch=$1
module=$2
extra_params=$3
src_dir=$SRC
dst_dir=$DST
ndk_dir="$NDK_ROOT"
config_command="cmake \
-H$src_dir \
-B$dst_dir/$module/.externalNativeBuild/cmake/release/$arch \
-DANDROID_ABI=$arch \
-DANDROID_PLATFORM=android-19 \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$dst_dir/$module/build/intermediates/cmake/release/obj/$arch \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_NDK=$ndk_dir \
-DCMAKE_TOOLCHAIN_FILE=$ndk_dir/build/cmake/android.toolchain.cmake \
-GNinja \
-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF \
$extra_params"
echo "Configuring $module..."
eval "$config_command"
build_command="cmake --build $dst_dir/$module/.externalNativeBuild/cmake/release/$arch"
echo "Building $module..."
eval "$build_command"
}
arch="arm64-v8a"
cd ${{ github.workspace }}/SourceCache/firebase-cpp-sdk
./gradlew :app:invites_resources:generateDexJarRelease
#cmake_build $arch "app" ""
# cmake_build $arch "storage" "-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON -DFIREBASE_INCLUDE_STORAGE=ON"

0 comments on commit 6c46445

Please sign in to comment.