Skip to content

Commit bfd1767

Browse files
authored
Add --test_env for build
This way we don't thrash the analysis cache when changing from build to test
1 parent 5aba1e5 commit bfd1767

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ common --incompatible_allow_tags_propagation
66

77
# Add the PATH to the test environment so that common macOS tools can be found
88
# during a test run.
9-
test --test_env=PATH
9+
build --test_env=PATH
1010

1111
# `bazel test` tries to build everything also by default, so skip that so the
1212
# *_library targets in examples/... aren't built (and fail since they are

apple/internal/apple_xcframework_import.bzl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,23 @@ def _get_xcframework_library_from_paths(*, target_triplet, xcframework):
183183
if not library_identifier:
184184
return None
185185

186+
def _matches_library(file):
187+
return library_identifier in file.short_path.split("/")
188+
186189
files = xcframework.files_by_category
187-
binaries = [f for f in files.binary_imports if library_identifier in f.short_path]
188-
framework_imports = [f for f in files.bundling_imports if library_identifier in f.short_path]
189-
headers = [f for f in files.header_imports if library_identifier in f.short_path]
190-
module_maps = [f for f in files.module_map_imports if library_identifier in f.short_path]
190+
binaries = [f for f in files.binary_imports if _matches_library(f)]
191+
framework_imports = [f for f in files.bundling_imports if _matches_library(f)]
192+
headers = [f for f in files.header_imports if _matches_library(f)]
193+
module_maps = [f for f in files.module_map_imports if _matches_library(f)]
191194
swiftmodules = [
192195
f
193196
for f in files.swift_module_imports
194-
if library_identifier in f.short_path and
197+
if _matches_library(f) and
195198
f.basename.startswith(target_triplet.architecture)
196199
]
197200

198201
framework_dirs = [f.dirname for f in binaries]
199-
framework_files = [f for f in xcframework.files if library_identifier in f.short_path]
202+
framework_files = [f for f in xcframework.files if _matches_library(f)]
200203

201204
includes = []
202205
framework_includes = []

0 commit comments

Comments
 (0)