1# Copyright (C) 2023 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("@bazel_skylib//lib:selects.bzl", "selects") 16load(":config_setting_boolean_algebra_test.bzl", "config_setting_boolean_algebra_test_suite") 17load(":schema_validation_test.bzl", "schema_validation_test_suite") 18 19config_setting_boolean_algebra_test_suite( 20 name = "config_setting_boolean_algebra_test_suite", 21) 22 23schema_validation_test_suite(name = "schema_validation_test_suite") 24 25# Stamp is a random flag that can only be 1 of 2 values, so it can be used to make 26# the always_on/off_config_settings. This concept is copied from skylib, but skylib 27# only actually made these always on/off config settings as part of the 28# config_setting_group macro. 29config_setting( 30 name = "stamp_binary_on_check", 31 values = {"stamp": "1"}, 32 # For some reason bazel requires this to be visible to where 33 # always_on_config_setting is used. 34 visibility = ["//visibility:public"], 35) 36 37config_setting( 38 name = "stamp_binary_off_check", 39 values = {"stamp": "0"}, 40 # For some reason bazel requires this to be visible to where 41 # always_on_config_setting is used. 42 visibility = ["//visibility:public"], 43) 44 45selects.config_setting_group( 46 name = "always_on_config_setting", 47 match_any = [ 48 ":stamp_binary_off_check", 49 ":stamp_binary_on_check", 50 ], 51 visibility = ["//visibility:public"], 52) 53 54selects.config_setting_group( 55 name = "always_off_config_setting", 56 match_all = [ 57 ":stamp_binary_off_check", 58 ":stamp_binary_on_check", 59 ], 60 visibility = ["//visibility:public"], 61) 62 63filegroup(name = "empty_filegroup") 64 65sh_binary( 66 name = "fail", 67 srcs = ["fail.sh"], 68) 69