-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cypress): use a toolchain instead of a select statements (WIP)
- Loading branch information
Daniel Muller
committed
May 25, 2021
1 parent
ec05f29
commit a049446
Showing
10 changed files
with
280 additions
and
48 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
21 changes: 0 additions & 21 deletions
21
packages/cypress/internal/_cypress_repository_build_TEMPLATE
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,83 @@ | ||
package(default_visibility = ["//visibility:private"]) | ||
|
||
platform( | ||
name = "darwin", | ||
constraint_values = [ | ||
"@platforms//os:osx", | ||
"@platforms//cpu:x86_64", | ||
], | ||
) | ||
|
||
platform( | ||
name = "linux", | ||
constraint_values = [ | ||
"@platforms//os:linux", | ||
"@platforms//cpu:x86_64", | ||
], | ||
) | ||
|
||
platform( | ||
name = "windows", | ||
constraint_values = [ | ||
"@platforms//os:windows", | ||
"@platforms//cpu:x86_64", | ||
], | ||
) | ||
|
||
# cypress toolchain type | ||
toolchain_type(name = "cypress_toolchain") | ||
|
||
# Allow targets to use a toolchains attribute, such as sh_binary and genrule | ||
# This way they can reference the cypress_PATH make variable. | ||
alias( | ||
name = "toolchain", | ||
actual = select({ | ||
"@bazel_tools//src/conditions:darwin": "@cypress_darwin_config//:toolchain", | ||
"@bazel_tools//src/conditions:linux": "@cypress_linux_config//:toolchain", | ||
"@bazel_tools//src/conditions:windows": "@cypress_windows_config//:toolchain", | ||
"//conditions:default": "@cypress_linux_config//:toolchain", | ||
}), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# Allow targets to declare a dependency on the cypress binary for the current host platform | ||
alias( | ||
name = "cypress_bin", | ||
actual = select({ | ||
"@bazel_tools//src/conditions:darwin": "@cypress_darwin//:cypress_bin", | ||
"@bazel_tools//src/conditions:linux": "@cypress_linux//:cypress_bin", | ||
"@bazel_tools//src/conditions:windows": "@cypress_windows//:cypress_bin", | ||
"//conditions:default": "@cypress_linux//:cypress_bin", | ||
}), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "cypress_linux_toolchain", | ||
target_compatible_with = [ | ||
"@platforms//os:linux", | ||
"@platforms//cpu:x86_64", | ||
], | ||
toolchain = "@cypress_linux_config//:toolchain", | ||
toolchain_type = ":cypress_toolchain", | ||
) | ||
|
||
toolchain( | ||
name = "cypress_darwin_toolchain", | ||
target_compatible_with = [ | ||
"@platforms//os:osx", | ||
"@platforms//cpu:x86_64", | ||
], | ||
toolchain = "@cypress_darwin_config//:toolchain", | ||
toolchain_type = ":cypress_toolchain", | ||
) | ||
|
||
toolchain( | ||
name = "cypress_windows_toolchain", | ||
target_compatible_with = [ | ||
"@platforms//os:windows", | ||
"@platforms//cpu:x86_64", | ||
], | ||
toolchain = "@cypress_windows_config//:toolchain", | ||
toolchain_type = ":cypress_toolchain", | ||
) |
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,25 @@ | ||
# Copyright 2021 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""This BUILD file is auto-generated from @TEMPLATED_cypress_workspace_name//internal:BUILD.bazel.tpl | ||
""" | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@TEMPLATED_cypress_workspace_name//internal/toolchain:cypress_toolchain.bzl", "cypress_toolchain") | ||
|
||
cypress_toolchain( | ||
name = "toolchain", | ||
%{TOOL_ATTRS} | ||
) |
Oops, something went wrong.