From 6c464453891a9141c096ecf91a9c185b75c1575f Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Thu, 16 May 2024 17:16:59 -0700 Subject: [PATCH] android build --- .github/workflows/bcny-firebase.yml | 90 ++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bcny-firebase.yml b/.github/workflows/bcny-firebase.yml index 6dcbf20121..449111f18f 100644 --- a/.github/workflows/bcny-firebase.yml +++ b/.github/workflows/bcny-firebase.yml @@ -6,9 +6,10 @@ on: jobs: windows: runs-on: windows-latest + if: false strategy: - fail-fast: false + fail-fast: true matrix: include: - arch: 'amd64' @@ -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"