-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Brentley Jones <[email protected]>
- Loading branch information
1 parent
39205cb
commit 92b71eb
Showing
22 changed files
with
2,421 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_universal_binary") | ||
load( | ||
"@build_bazel_rules_apple//apple:macos.bzl", | ||
"macos_command_line_application", | ||
"macos_unit_test", | ||
) | ||
load( | ||
"@build_bazel_rules_swift//swift:swift.bzl", | ||
"swift_binary", | ||
"swift_library", | ||
) | ||
|
||
exports_files(["README.md"]) | ||
|
||
# Generator | ||
|
||
swift_library( | ||
name = "target_build_settings.library", | ||
srcs = glob(["src/**/*.swift"]), | ||
module_name = "target_build_settings", | ||
deps = [ | ||
"//tools/generators/lib/PBXProj", | ||
"//tools/lib/ToolCommon", | ||
"@com_github_apple_swift_collections//:OrderedCollections", | ||
], | ||
) | ||
|
||
# This target exists to keep configurations the same between the generator | ||
# and the tests, which makes the Xcode development experience better. If we used | ||
# `swift_binary` or `apple_universal_binary` in `xcodeproj`, then the | ||
# `macos_unit_test` transition (which is used to be able to set a minimum os | ||
# version on the tests) will create slightly different configurations for our | ||
# `swift_library`s. Maybe https://github.com/bazelbuild/bazel/issues/6526 will | ||
# fix that for us. | ||
macos_command_line_application( | ||
name = "target_build_settings", | ||
minimum_os_version = "13.0", | ||
visibility = ["//visibility:public"], | ||
deps = [":target_build_settings.library"], | ||
) | ||
|
||
swift_binary( | ||
name = "target_build_settings_binary", | ||
deps = [":target_build_settings.library"], | ||
) | ||
|
||
apple_universal_binary( | ||
name = "universal_target_build_settings", | ||
binary = ":target_build_settings_binary", | ||
forced_cpus = [ | ||
"x86_64", | ||
"arm64", | ||
], | ||
minimum_os_version = "13.0", | ||
platform_type = "macos", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# Tests | ||
|
||
swift_library( | ||
name = "target_build_settings_tests.library", | ||
testonly = True, | ||
srcs = glob(["test/**/*.swift"]), | ||
module_name = "target_build_settings_tests", | ||
deps = [ | ||
":target_build_settings.library", | ||
"@com_github_pointfreeco_swift_custom_dump//:CustomDump", | ||
], | ||
) | ||
|
||
macos_unit_test( | ||
name = "target_build_settings_tests", | ||
minimum_os_version = "13.0", | ||
visibility = [ | ||
"//test:__subpackages__", | ||
"@rules_xcodeproj//xcodeproj:generated", | ||
], | ||
deps = [ | ||
":target_build_settings_tests.library", | ||
], | ||
) | ||
|
||
# Release | ||
|
||
filegroup( | ||
name = "release_files", | ||
srcs = [ | ||
"BUILD.release.bazel", | ||
":universal_target_build_settings", | ||
], | ||
tags = ["manual"], | ||
visibility = ["//:__subpackages__"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
load("@bazel_skylib//rules:native_binary.bzl", "native_binary") | ||
|
||
native_binary( | ||
name = "universal_target_build_settings", | ||
src = "prebuilt_universal_target_build_settings", | ||
out = "universal_target_build_settings", | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.