Skip to content

Commit 46192c9

Browse files
Remove WORKSPACE support (#3289)
WORKSPACE is gone in Bazel 9, and was formally deprecated in Bazel 8. We're preparing the rules for its removal across all supported versions. ref bazelbuild/apple_support#487 ref bazelbuild/rules_swift#1613 ref bazelbuild/rules_apple#2814 --------- Signed-off-by: Aaron Sky <aaronsky@skyaaron.com> Co-authored-by: Brentley Jones <github@brentleyjones.com>
1 parent 6aab40a commit 46192c9

File tree

25 files changed

+65
-432
lines changed

25 files changed

+65
-432
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ to guide contributors with an implementation through discussions if needed.
2626

2727
You can test your changes in the example projects by generating their
2828
projects with `bazel run //examples/cc:xcodeproj`. You might need to `cd`
29-
into the directory if the example app is in a separate `WORKSPACE` with
29+
into the directory if the example app is in a separate `MODULE.bazel` with
3030
`cd examples/integration; bazel run //:xcodeproj`.
3131

3232
You can run the internal tests as well:

MODULE.bazel

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bazel_dep(
1111
version = "2.2.0",
1212
repo_name = "build_bazel_apple_support",
1313
)
14-
bazel_dep(name = "bazel_features", version = "1.36.0")
14+
bazel_dep(name = "bazel_features", version = "1.42.1")
1515
bazel_dep(name = "bazel_skylib", version = "1.9.0")
1616
bazel_dep(name = "rules_cc", version = "0.2.17")
1717
bazel_dep(
@@ -26,12 +26,15 @@ bazel_dep(
2626
)
2727
bazel_dep(name = "rules_python", version = "1.7.0")
2828

29-
internal = use_extension("//xcodeproj:extensions.bzl", "internal")
30-
use_repo(internal, "rules_xcodeproj_generated")
31-
32-
non_module_deps = use_extension("//xcodeproj:extensions.bzl", "non_module_deps")
29+
repos = use_extension("//xcodeproj:extensions.bzl", "rules_repos")
3330
use_repo(
34-
non_module_deps,
31+
repos,
32+
"com_github_apple_swift_argument_parser",
33+
"com_github_apple_swift_collections",
34+
"com_github_michaeleisel_jjliso8601dateformatter",
35+
"com_github_michaeleisel_zippyjson",
36+
"com_github_michaeleisel_zippyjsoncfamily",
37+
"rules_xcodeproj_generated",
3538
"rules_xcodeproj_index_import",
3639
"rules_xcodeproj_legacy_index_import",
3740
)
@@ -67,22 +70,9 @@ apple_cc_configure = use_extension(
6770
)
6871
use_repo(apple_cc_configure, "local_config_apple_cc")
6972

73+
dev_repos = use_extension("//xcodeproj:extensions.bzl", "rules_dev_repos", dev_dependency = True)
7074
use_repo(
71-
non_module_deps,
72-
"com_github_apple_swift_argument_parser",
73-
"com_github_apple_swift_collections",
74-
"com_github_michaeleisel_jjliso8601dateformatter",
75-
"com_github_michaeleisel_zippyjson",
76-
"com_github_michaeleisel_zippyjsoncfamily",
77-
)
78-
79-
dev_non_module_deps = use_extension(
80-
"//xcodeproj:dev_extensions.bzl",
81-
"dev_non_module_deps",
82-
dev_dependency = True,
83-
)
84-
use_repo(
85-
dev_non_module_deps,
75+
dev_repos,
8676
"com_github_pointfreeco_swift_custom_dump",
8777
"com_github_pointfreeco_xctest_dynamic_overlay",
8878
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ones we’ve officially tested with.
9696

9797
From the
9898
[release you wish to use](https://github.com/MobileNativeFoundation/rules_xcodeproj/releases),
99-
copy the Bzlmod or WORKSPACE snippet into your repository.
99+
copy the Bzlmod snippet into your repository.
100100
If you want to manually build a release archive, you can use this command:
101101
`bazel build //distribution:release`.
102102

WORKSPACE.bzlmod

Whitespace-only changes.

buildbuddy.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ x_templates:
1414
- &arm64
1515
arch: "arm64"
1616

17-
- &bazel_in_repo_version
18-
# No change, uses `.bazelversion`, just used to make it clear
17+
- &bazel_in_repo_version # No change, uses `.bazelversion`, just used to make it clear
1918
env: {}
2019
- &bazel_previous_lts
2120
env:
@@ -48,9 +47,6 @@ x_templates:
4847
- &generate_integration "--output_base=bazel-output-base run --config=workflows //:xcodeproj"
4948
- &build_all "--output_base=bazel-output-base build --config=workflows //..."
5049
- &test_all "--output_base=bazel-output-base test --config=workflows //..."
51-
- &nobzlmod_build_all "--output_base=bazel-output-base build --config=workflows --config=nobzlmod //..."
52-
- &nobzlmod_test_all "--output_base=bazel-output-base test --config=workflows --config=nobzlmod //..."
53-
- &nobzlmod_generate_integration "--output_base=bazel-output-base run --config=workflows --config=nobzlmod //:xcodeproj"
5450

5551
actions:
5652
- name: Buildifier Lint

distribution/expanded_pkg.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _impl(ctx):
1616
set -euo pipefail
1717
1818
tar -xf "$1" -C "$2"
19-
touch "$2/WORKSPACE"
19+
touch "$2/MODULE.bazel"
2020
""",
2121
)
2222

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,12 @@
1-
## What’s Changed
2-
3-
* [User facing changelog](https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/main/CHANGELOG.md#%CURRENT_TAG%)
4-
* Full changelog: https://github.com/MobileNativeFoundation/rules_xcodeproj/compare/%PREVIOUS_TAG%...%CURRENT_TAG%
5-
6-
## Bzlmod Snippet
1+
## `MODULE.bazel` Snippet
72

83
```starlark
94
bazel_dep(name = "rules_xcodeproj", version = "%CURRENT_TAG%")
105
```
116

12-
`release.tar.gz`’s `integrity`: `%INTEGRITY%`
13-
14-
## Workspace Snippet
15-
16-
Please use the release asset (`release.tar.gz`) from your Bazel `WORKSPACE` instead of GitHub's source asset to reduce download size and improve reproducibility.
17-
18-
```starlark
19-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
20-
21-
http_archive(
22-
name = "rules_xcodeproj",
23-
integrity = "%INTEGRITY%",
24-
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/%CURRENT_TAG%/release.tar.gz",
25-
)
26-
27-
load(
28-
"@rules_xcodeproj//xcodeproj:repositories.bzl",
29-
"xcodeproj_rules_dependencies",
30-
)
31-
32-
xcodeproj_rules_dependencies()
33-
34-
load("@bazel_features//:deps.bzl", "bazel_features_deps")
35-
36-
bazel_features_deps()
37-
38-
load(
39-
"@build_bazel_rules_apple//apple:repositories.bzl",
40-
"apple_rules_dependencies",
41-
)
42-
43-
apple_rules_dependencies()
44-
45-
load(
46-
"@build_bazel_rules_swift//swift:repositories.bzl",
47-
"swift_rules_dependencies",
48-
)
49-
50-
swift_rules_dependencies()
51-
52-
load(
53-
"@build_bazel_rules_swift//swift:extras.bzl",
54-
"swift_rules_extra_dependencies",
55-
)
56-
57-
swift_rules_extra_dependencies()
7+
## What’s Changed
588

59-
load(
60-
"@build_bazel_apple_support//lib:repositories.bzl",
61-
"apple_support_dependencies",
62-
)
9+
* [User facing changelog](https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/main/CHANGELOG.md#%CURRENT_TAG%)
10+
* Full changelog: https://github.com/MobileNativeFoundation/rules_xcodeproj/compare/%PREVIOUS_TAG%...%CURRENT_TAG%
6311

64-
apple_support_dependencies()
65-
```
12+
`release.tar.gz`’s `integrity`: `%INTEGRITY%`

examples/integration/.bazelrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import %workspace%/../../shared.bazelrc
33

44
build --experimental_cc_implementation_deps
55

6-
# Until we fix our examples for Bazel 8
7-
common --enable_workspace
8-
96
# Exercise the extra flags feature
107

118
build:rules_xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags='--verbose_failures'

examples/integration/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ string_flag(
2727

2828
# Example of xcodeproj cache warming
2929
#
30-
# 1. Register a single macOS execution platform in `WORKSPACE`:
30+
# 1. Register a single macOS execution platform in `MODULE.bazel`:
3131
#
3232
# register_execution_platforms("@build_bazel_apple_support//platforms:macos_x86_64")
3333
#

WORKSPACE renamed to examples/integration/CommandLine/external/MODULE.bazel

File renamed without changes.

0 commit comments

Comments
 (0)