Skip to content

Commit a11dece

Browse files
authored
Update the Swift Package version automatically (#1428)
* Update the Swift Package version automatically * Update update_versions.py
1 parent 97d77cf commit a11dece

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/update_versions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,21 @@ def update_android_deps():
178178
def update_unity_version(unity_sdk_version):
179179
version_cmake_path = os.path.join(os.getcwd(), "cmake", "firebase_unity_version.cmake")
180180
replacement = ""
181+
podversion = get_ios_pod_version_from_cpp()
182+
print(podversion)
181183
with open(version_cmake_path, "r") as f:
182184
datafile = f.readlines()
183185
for line in datafile:
184186
if "FIREBASE_UNITY_SDK_VERSION" in line:
185187
newline = "set(FIREBASE_UNITY_SDK_VERSION \"" + unity_sdk_version + "\""
186188
replacement = replacement + newline + "\n"
187-
elif "FIREBASE_IOS_POD_VERSION" in line:
188-
podversion = get_ios_pod_version_from_cpp()
189+
elif podversion and "FIREBASE_IOS_POD_VERSION" in line:
189190
newline = "set(FIREBASE_IOS_POD_VERSION \"" + podversion + "\""
190191
replacement = replacement + newline + "\n"
192+
elif podversion and "FIREBASE_SPM_VERSION" in line:
193+
# Reuse the Cocoapod version number, as they are typically the same
194+
newline = "set(FIREBASE_SPM_VERSION \"" + podversion + "\""
195+
replacement = replacement + newline + "\n"
191196
elif "FIREBASE_UNITY_JAR_RESOLVER_VERSION" in line:
192197
jar_version = get_latest_repo_tag('googlesamples/unity-jar-resolver')
193198
jar_version = jar_version.lstrip("v") # jar resolver need to strip "v" from the tag

0 commit comments

Comments
 (0)