From 15e2de522facabf6390b00623eaae6ee8e9b6dc1 Mon Sep 17 00:00:00 2001 From: Thiago Cruz Date: Fri, 28 Jul 2023 16:44:11 -0400 Subject: [PATCH 1/2] Set xccurrentversion owners --- rules/precompiled_apple_resource_bundle.bzl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/rules/precompiled_apple_resource_bundle.bzl b/rules/precompiled_apple_resource_bundle.bzl index 70f549138..1b13e1e30 100644 --- a/rules/precompiled_apple_resource_bundle.bzl +++ b/rules/precompiled_apple_resource_bundle.bzl @@ -198,7 +198,7 @@ def _precompiled_apple_resource_bundle_impl(ctx): # See https://github.com/bazel-ios/rules_ios/pull/747 for context xccurrentversions = [ - (None, None, depset([f])) + f for resource_files in ctx.attr.resources for f in resource_files.files.to_list() if f.extension == "xccurrentversion" @@ -206,12 +206,20 @@ def _precompiled_apple_resource_bundle_impl(ctx): return [ AppleResourceInfo( - datamodels = xccurrentversions, + datamodels = [ + (None, None, depset([f])) + for f in xccurrentversions + ], unowned_resources = depset(), - owners = depset([ - (output_bundle_dir.short_path, ctx.label), - (output_plist.short_path, ctx.label), - ]), + owners = depset( + [ + (output_bundle_dir.short_path, ctx.label), + (output_plist.short_path, ctx.label), + ] + [ + (f.short_path, ctx.label) + for f in xccurrentversions + ], + ), # This is a list of the resources to propagate without changing further # In this case the tuple parameters are: # 1. The final directory the resources should end up in, ex Foo.bundle From 94621fb0eeab1c4b2f01f30789c0127ea4729ccd Mon Sep 17 00:00:00 2001 From: Thiago Cruz Date: Fri, 28 Jul 2023 17:18:49 -0400 Subject: [PATCH 2/2] Better depset --- rules/precompiled_apple_resource_bundle.bzl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rules/precompiled_apple_resource_bundle.bzl b/rules/precompiled_apple_resource_bundle.bzl index 1b13e1e30..2bda179b3 100644 --- a/rules/precompiled_apple_resource_bundle.bzl +++ b/rules/precompiled_apple_resource_bundle.bzl @@ -207,8 +207,7 @@ def _precompiled_apple_resource_bundle_impl(ctx): return [ AppleResourceInfo( datamodels = [ - (None, None, depset([f])) - for f in xccurrentversions + (None, None, depset(xccurrentversions)), ], unowned_resources = depset(), owners = depset(