Skip to content

Commit

Permalink
chore(deps): update dependency google/googlesignin-ios to from: "7.1.…
Browse files Browse the repository at this point in the history
…0" (#984)

- Upgrade GoogleSignin
- To allow an ObjC module to @import a Swift module, we include the Swift modulemap in the swift_library_group. This renders passing the depender's source type to deps_indexes.labels_for_module() obsolete.
  • Loading branch information
1 parent 93b7443 commit 8bf2fc1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 35 deletions.
16 changes: 8 additions & 8 deletions examples/resources_example/swift/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/openid/AppAuth-iOS.git",
"state" : {
"revision" : "71cde449f13d453227e687458144bde372d30fc7",
"version" : "1.6.2"
"revision" : "7e2c09cbeb3bb799f26c268dbedb26325ea722a9",
"version" : "1.7.3"
}
},
{
"identity" : "googlesignin-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleSignIn-iOS",
"state" : {
"revision" : "7932d33686c1dc4d7df7a919aae47361d1cdfda4",
"version" : "7.0.0"
"revision" : "a7965d134c5d3567026c523e0a8a583f73b62b0d",
"version" : "7.1.0"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
"version" : "3.1.1"
"revision" : "9534039303015a84837090d20fa21cae6e5eadb6",
"version" : "3.3.2"
}
},
{
"identity" : "gtmappauth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GTMAppAuth.git",
"state" : {
"revision" : "cee3c709307912d040bd1e06ca919875a92339c6",
"version" : "2.0.0"
"revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a",
"version" : "4.1.1"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/resources_example/swift/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let package = Package(
.package(path: "../third_party/app_lovin_sdk"),
.package(path: "../third_party/package_with_resources"),
.package(url: "https://github.com/SDWebImage/SDWebImageSwiftUI.git", from: "3.0.2"),
.package(url: "https://github.com/google/GoogleSignIn-iOS", from: "7.0.0"),
.package(url: "https://github.com/google/GoogleSignIn-iOS", from: "7.1.0"),
.package(
url: "https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk",
from: "18.4.2"
Expand Down
19 changes: 10 additions & 9 deletions examples/resources_example/swift_deps_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@
{
"name": "GTMAppAuth",
"c99name": "GTMAppAuth",
"src_type": "objc",
"src_type": "swift",
"label": "@swiftpkg_gtmappauth//:GTMAppAuth.rspm",
"modulemap_label": "@swiftpkg_gtmappauth//:GTMAppAuth.rspm_modulemap",
"package_identity": "gtmappauth",
"product_memberships": [
"GTMAppAuth"
Expand Down Expand Up @@ -336,36 +337,36 @@
"name": "swiftpkg_appauth_ios",
"identity": "appauth-ios",
"remote": {
"commit": "71cde449f13d453227e687458144bde372d30fc7",
"commit": "7e2c09cbeb3bb799f26c268dbedb26325ea722a9",
"remote": "https://github.com/openid/AppAuth-iOS.git",
"version": "1.6.2"
"version": "1.7.3"
}
},
{
"name": "swiftpkg_googlesignin_ios",
"identity": "googlesignin-ios",
"remote": {
"commit": "7932d33686c1dc4d7df7a919aae47361d1cdfda4",
"commit": "a7965d134c5d3567026c523e0a8a583f73b62b0d",
"remote": "https://github.com/google/GoogleSignIn-iOS",
"version": "7.0.0"
"version": "7.1.0"
}
},
{
"name": "swiftpkg_gtm_session_fetcher",
"identity": "gtm-session-fetcher",
"remote": {
"commit": "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
"commit": "9534039303015a84837090d20fa21cae6e5eadb6",
"remote": "https://github.com/google/gtm-session-fetcher.git",
"version": "3.1.1"
"version": "3.3.2"
}
},
{
"name": "swiftpkg_gtmappauth",
"identity": "gtmappauth",
"remote": {
"commit": "cee3c709307912d040bd1e06ca919875a92339c6",
"commit": "5d7d66f647400952b1758b230e019b07c0b4b22a",
"remote": "https://github.com/google/GTMAppAuth.git",
"version": "2.0.0"
"version": "4.1.1"
}
},
{
Expand Down
7 changes: 2 additions & 5 deletions swiftpkg/internal/deps_indexes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,12 @@ def _modulemap_label_for_module(module):
package = module.label.package,
)

def _labels_for_module(module, depender_src_type):
def _labels_for_module(module):
"""Returns the dep labels that should be used for a module.
Args:
module: The dependent module (`struct` as returned by
`dep_indexes.new_module`).
depender_src_type: The source type for the target (`string` value from
`src_types`) that will depend on the module.
Returns:
A `list` of Bazel label `struct` values as returned by `bazel_labels.new`,
Expand All @@ -222,8 +220,7 @@ def _labels_for_module(module, depender_src_type):
# See `swiftpkg_build_files.bzl` for more information.
labels.append(_modulemap_label_for_module(module))

elif (depender_src_type == src_types.objc and
module.src_type == src_types.swift and
elif (module.src_type == src_types.swift and
module.modulemap_label != None):
# If an Objc module wants to @import a Swift module, it will need the
# modulemap target.
Expand Down
2 changes: 1 addition & 1 deletion swiftpkg/internal/pkginfo_target_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Unrecognized target dependency while generating a Bazel dependency label.\
labels = [product.label]
elif module:
labels = (
deps_indexes.labels_for_module(module, depender_module.src_type)
deps_indexes.labels_for_module(module)
)
else:
labels = []
Expand Down
5 changes: 3 additions & 2 deletions swiftpkg/internal/swiftpkg_build_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load(":bazel_apple_platforms.bzl", "bazel_apple_platforms")
load(":build_decls.bzl", "build_decls")
load(":build_files.bzl", "build_files")
load(":bzl_selects.bzl", "bzl_selects")
load(":deps_indexes.bzl", "deps_indexes", "src_types")
load(":deps_indexes.bzl", "deps_indexes")
load(":load_statements.bzl", "load_statements")
load(":pkginfo_target_deps.bzl", "pkginfo_target_deps")
load(":pkginfo_targets.bzl", "pkginfo_targets")
Expand Down Expand Up @@ -717,13 +717,14 @@ def _library_product_build_file(deps_index_ctx, product):
for tname in product.targets
]
label_infos = lists.flatten([
deps_indexes.labels_for_module(module, src_types.swift)
deps_indexes.labels_for_module(module)
for module in modules
])
target_labels = [
bazel_labels.normalize(label_info)
for label_info in label_infos
]

if len(target_labels) == 0:
fail("No targets specified for a library product. name:", product.name)
return build_files.new(
Expand Down
10 changes: 1 addition & 9 deletions swiftpkg/tests/deps_indexes_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ def _labels_for_module_test(ctx):
struct(
msg = "Swift depend upon Swift",
dep_module = "@example_cool_repo//:Foo",
depender_module = "@example_cool_repo//:Bar",
exp = [
bazel_labels.parse("@example_cool_repo//:Foo"),
],
),
struct(
msg = "Swift library depends upon Objc library",
dep_module = "@example_cool_repo//:ObjcLibrary",
depender_module = "@example_cool_repo//:Bar",
exp = [
bazel_labels.parse("@example_cool_repo//:ObjcLibrary"),
bazel_labels.parse("@example_cool_repo//:ObjcLibrary_modulemap"),
Expand All @@ -180,16 +178,13 @@ def _labels_for_module_test(ctx):
struct(
msg = "Objc library depends upon Swift library without modulemap",
dep_module = "@example_cool_repo//:Foo",
depender_module = "@example_cool_repo//:ObjcLibrary",
exp = [
bazel_labels.parse("@example_cool_repo//:Foo"),
# bazel_labels.parse("@example_cool_repo//:Foo_modulemap"),
],
),
struct(
msg = "Objc library depends upon Swift library with modulemap",
dep_module = "@example_another_repo//Sources/Foo",
depender_module = "@example_cool_repo//:ObjcLibrary",
exp = [
bazel_labels.parse("@example_another_repo//Sources/Foo"),
bazel_labels.parse("@example_another_repo//Sources/Foo:Foo_modulemap"),
Expand All @@ -198,12 +193,9 @@ def _labels_for_module_test(ctx):
]
for t in tests:
module = deps_indexes.get_module(_deps_index, t.dep_module)
depender = deps_indexes.get_module(_deps_index, t.depender_module)
if module == None:
fail("The module is `None` for {}.".format(t.label))
if depender == None:
fail("The depender module is `None` for {}.".format(t.depender_label))
actual = deps_indexes.labels_for_module(module, depender.src_type)
actual = deps_indexes.labels_for_module(module)
asserts.equals(env, t.exp, actual, t.msg)

return unittest.end(env)
Expand Down

0 comments on commit 8bf2fc1

Please sign in to comment.