Skip to content

Commit 6071a27

Browse files
authored
Merge pull request #346 from firebase/feature/fix-android-windows-builds
Feature/fix android windows builds
2 parents 7ab34b0 + c405c64 commit 6071a27

File tree

6 files changed

+36
-6
lines changed

6 files changed

+36
-6
lines changed

.github/workflows/android.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Add msbuild to PATH
7171
if: startsWith(matrix.os, 'windows')
7272
uses: microsoft/setup-msbuild@v1.0.2
73-
73+
7474
- name: Cache NDK
7575
id: cache_ndk
7676
uses: actions/cache@v2
@@ -83,6 +83,26 @@ jobs:
8383
run: |
8484
build_scripts/android/install_prereqs.sh
8585
86+
- name: Add strings.exe to PATH (Windows only)
87+
if: startsWith(matrix.os, 'windows')
88+
shell: bash
89+
run: |
90+
# strings.exe was installed in repo root by install_prereqs.sh.
91+
# There is another conflicting strings executable on Github runners.
92+
# "C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\strings.exe"
93+
# Make sure to prepend the one in our repo root to the path.
94+
echo "${{ github.workspace }}" >> $GITHUB_PATH
95+
96+
- name: Run strings.exe once to accept license(Windows only)
97+
if: startsWith(matrix.os, 'windows')
98+
shell: bash
99+
run: |
100+
# This invocation is just to accept the license. Otherwise the command
101+
# fails during build process. Also, running a command with just this
102+
# flag makes the process exit with code 127 and stops the workflow.
103+
# We ignore the error and continue with the rest of the steps.
104+
strings -accepteula || true
105+
86106
- name: Cache ccache files
87107
id: cache_ccache
88108
uses: actions/cache@v2

android_build_files/android_abis.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323
ndk {
2424
// Default list of ABIs available in up-to-date NDK.
2525
abiFilters "x86", "armeabi-v7a", "arm64-v8a", "x86_64"
26-
26+
2727
if (System.getenv("ANDROID_NDK_HOME").contains("r16b") ||
2828
System.getenv("ANDROID_NDK_HOME").contains("r11c")) {
2929
// Deprecated ABIs are added to the list when building using older NDKs only.

cmake/external_rules.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ function(download_external_sources)
6363

6464
execute_process(
6565
COMMAND
66-
${ENV_COMMAND} cmake
66+
${ENV_COMMAND} ${CMAKE_COMMAND}
67+
-G ${CMAKE_GENERATOR}
68+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
69+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
6770
-DCMAKE_INSTALL_PREFIX=${FIREBASE_INSTALL_DIR}
6871
-DFIREBASE_DOWNLOAD_DIR=${FIREBASE_DOWNLOAD_DIR}
6972
-DFIREBASE_EXTERNAL_PLATFORM=${external_platform}
@@ -88,7 +91,7 @@ function(download_external_sources)
8891
endif()
8992

9093
execute_process(
91-
COMMAND ${ENV_COMMAND} cmake --build . -- ${cmake_build_args}
94+
COMMAND ${ENV_COMMAND} ${CMAKE_COMMAND} --build . -- ${cmake_build_args}
9295
OUTPUT_FILE ${PROJECT_BINARY_DIR}/external/output_cmake_build.txt
9396
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external
9497
)

firestore/integration_test_internal/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ if(ANDROID)
170170
configure_file(abseil-cpp.cmake
171171
${CMAKE_CURRENT_LIST_DIR}/external/abseil-cpp/CMakeLists.txt COPYONLY)
172172
execute_process(COMMAND ${CMAKE_COMMAND} .
173+
-G ${CMAKE_GENERATOR}
174+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
175+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
173176
RESULT_VARIABLE result
174177
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/external/abseil-cpp )
175178
if(result)
@@ -211,6 +214,9 @@ if (NOT EXISTS ${GOOGLETEST_ROOT}/src/googletest/src/gtest-all.cc)
211214
configure_file(googletest.cmake
212215
${CMAKE_CURRENT_LIST_DIR}/external/googletest/CMakeLists.txt COPYONLY)
213216
execute_process(COMMAND ${CMAKE_COMMAND} .
217+
-G ${CMAKE_GENERATOR}
218+
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
219+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
214220
RESULT_VARIABLE result
215221
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/external/googletest )
216222
if(result)

firestore/integration_test_internal/abseil-cpp.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
cmake_minimum_required(VERSION 2.8)
1516
include(ExternalProject)
1617

1718
set(version 20200225)

scripts/gha/print_matrix_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585

8686
"android": {
8787
"matrix": {
88-
"os": ["ubuntu-latest", "macos-latest"],
88+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
8989
"architecture": ["x64"],
9090
"python_version": ["3.7"],
9191

9292
EXPANDED_KEY: {
93-
"os": ["ubuntu-latest", "macos-latest"]
93+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"]
9494
}
9595
}
9696
},

0 commit comments

Comments
 (0)