-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add use_runfiles aspect_hint to include runfiles for specific cc_libr… (
#2479) Fixes #2477 Include all data from cc_libraries as runfiles or resources, depending on aspect_hints. Provide aspect_hints for resource collection for all resource targets (eg, swift_library, cc_library, etc) By default all data is now included from cc_libraries as runfiles and follows the expected runfiles folder structure, with files retaining their nested folders and being placed in /external/pkg_name/some/file.txt when included from a http_archive or local_repository. The default behavior for other resource collecting targets like swift_library has not changed, and will continue to collect and process data as resources. To allow modification of this default behavior, users may add aspect_hints to the target cc_library/swift_library/etc. There are three supported aspect_hints: @build_bazel_rules_apple//apple:use_runfiles @build_bazel_rules_apple//apple:use_resources @build_bazel_rules_apple//apple:suppress_resources ##### Example Here is an example of modifying the default behavior to bundle data.txt as a resource instead of a runfile. ``` cc_library( name = "libapp", srcs = ["main.cpp",], data = [":data.txt"], aspect_hints = ["@build_bazel_rules_apple//apple:use_runfiles"], ) macos_application( name = "app_macos", deps = [":libapp"], ) ``` data.txt is bundled in Contents/Resources/data.txt #### Note Hints apply only to the target and do not affect transitive deps, however if a target includes runfiles then all runfiles are bundled (including transitive runfiles) regardless of the hints applied to transitive targets. --------- Co-authored-by: Luis Padron <[email protected]>
- Loading branch information
1 parent
4b40a88
commit 91be02a
Showing
14 changed files
with
389 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.