Skip to content

Commit c7d527e

Browse files
author
Alex Ames
committed
Fixed issue with integration tests finding google-services.json
Changed the search paths for the google-services.json file in CMakeLists.txt files to use full paths instead of relative paths. According to the CMake documentation, the `if (EXISTS ...)` condition is only well defined for full paths. This might work on some platforms but it failed in my tests on Windows.
1 parent e478163 commit c7d527e

File tree

13 files changed

+26
-26
lines changed

13 files changed

+26
-26
lines changed

admob/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

analytics/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

app/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

auth/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

database/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

dynamic_links/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ else()
202202
# possible to create the default Firebase app.
203203
set(FOUND_JSON_FILE FALSE)
204204
foreach(config "google-services-desktop.json" "google-services.json")
205-
if (EXISTS ${config})
205+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
206206
add_custom_command(
207207
TARGET ${integration_test_target_name} POST_BUILD
208208
COMMAND ${CMAKE_COMMAND} -E copy
209-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
209+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
210210
set(FOUND_JSON_FILE TRUE)
211211
break()
212212
endif()

firestore/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ else()
202202
# possible to create the default Firebase app.
203203
set(FOUND_JSON_FILE FALSE)
204204
foreach(config "google-services-desktop.json" "google-services.json")
205-
if (EXISTS ${config})
205+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
206206
add_custom_command(
207207
TARGET ${integration_test_target_name} POST_BUILD
208208
COMMAND ${CMAKE_COMMAND} -E copy
209-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
209+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
210210
set(FOUND_JSON_FILE TRUE)
211211
break()
212212
endif()

functions/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

installations/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

instance_id/integration_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ else()
201201
# possible to create the default Firebase app.
202202
set(FOUND_JSON_FILE FALSE)
203203
foreach(config "google-services-desktop.json" "google-services.json")
204-
if (EXISTS ${config})
204+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${config}")
205205
add_custom_command(
206206
TARGET ${integration_test_target_name} POST_BUILD
207207
COMMAND ${CMAKE_COMMAND} -E copy
208-
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
208+
"${CMAKE_CURRENT_LIST_DIR}/${config}" $<TARGET_FILE_DIR:${integration_test_target_name}>)
209209
set(FOUND_JSON_FILE TRUE)
210210
break()
211211
endif()

0 commit comments

Comments
 (0)