1*bcb5dc79SHONG Yifanload("//lib:unittest.bzl", "TOOLCHAIN_TYPE", "unittest_toolchain") 2*bcb5dc79SHONG Yifan 3*bcb5dc79SHONG Yifanpackage(default_applicable_licenses = ["//:license"]) 4*bcb5dc79SHONG Yifan 5*bcb5dc79SHONG Yifanlicenses(["notice"]) 6*bcb5dc79SHONG Yifan 7*bcb5dc79SHONG Yifantoolchain_type( 8*bcb5dc79SHONG Yifan name = "toolchain_type", 9*bcb5dc79SHONG Yifan visibility = ["//visibility:public"], 10*bcb5dc79SHONG Yifan) 11*bcb5dc79SHONG Yifan 12*bcb5dc79SHONG Yifanunittest_toolchain( 13*bcb5dc79SHONG Yifan name = "cmd", 14*bcb5dc79SHONG Yifan escape_chars_with = {"%": "%"}, 15*bcb5dc79SHONG Yifan failure_templ = """@echo off 16*bcb5dc79SHONG Yifanecho %s 17*bcb5dc79SHONG Yifanexit /b 1 18*bcb5dc79SHONG Yifan""", 19*bcb5dc79SHONG Yifan file_ext = ".bat", 20*bcb5dc79SHONG Yifan join_on = "\necho ", 21*bcb5dc79SHONG Yifan success_templ = "@exit /b 0", 22*bcb5dc79SHONG Yifan visibility = ["//visibility:public"], 23*bcb5dc79SHONG Yifan) 24*bcb5dc79SHONG Yifan 25*bcb5dc79SHONG Yifantoolchain( 26*bcb5dc79SHONG Yifan name = "cmd_toolchain", 27*bcb5dc79SHONG Yifan exec_compatible_with = [ 28*bcb5dc79SHONG Yifan "@platforms//os:windows", 29*bcb5dc79SHONG Yifan ], 30*bcb5dc79SHONG Yifan toolchain = ":cmd", 31*bcb5dc79SHONG Yifan toolchain_type = TOOLCHAIN_TYPE, 32*bcb5dc79SHONG Yifan) 33*bcb5dc79SHONG Yifan 34*bcb5dc79SHONG Yifanunittest_toolchain( 35*bcb5dc79SHONG Yifan name = "bash", 36*bcb5dc79SHONG Yifan escape_other_chars_with = "\\", 37*bcb5dc79SHONG Yifan failure_templ = """#!/bin/sh 38*bcb5dc79SHONG Yifanecho %s 39*bcb5dc79SHONG Yifanexit 1 40*bcb5dc79SHONG Yifan""", 41*bcb5dc79SHONG Yifan file_ext = ".sh", 42*bcb5dc79SHONG Yifan join_on = "\necho ", 43*bcb5dc79SHONG Yifan success_templ = "#!/bin/sh\nexit 0", 44*bcb5dc79SHONG Yifan visibility = ["//visibility:public"], 45*bcb5dc79SHONG Yifan) 46*bcb5dc79SHONG Yifan 47*bcb5dc79SHONG Yifantoolchain( 48*bcb5dc79SHONG Yifan name = "bash_toolchain", 49*bcb5dc79SHONG Yifan toolchain = ":bash", 50*bcb5dc79SHONG Yifan toolchain_type = TOOLCHAIN_TYPE, 51*bcb5dc79SHONG Yifan) 52*bcb5dc79SHONG Yifan 53*bcb5dc79SHONG Yifanfilegroup( 54*bcb5dc79SHONG Yifan name = "test_deps", 55*bcb5dc79SHONG Yifan testonly = True, 56*bcb5dc79SHONG Yifan srcs = [ 57*bcb5dc79SHONG Yifan "BUILD", 58*bcb5dc79SHONG Yifan ], 59*bcb5dc79SHONG Yifan visibility = ["//:__subpackages__"], 60*bcb5dc79SHONG Yifan) 61*bcb5dc79SHONG Yifan 62*bcb5dc79SHONG Yifan# The files needed for distribution 63*bcb5dc79SHONG Yifanfilegroup( 64*bcb5dc79SHONG Yifan name = "distribution", 65*bcb5dc79SHONG Yifan srcs = ["BUILD"], 66*bcb5dc79SHONG Yifan visibility = [ 67*bcb5dc79SHONG Yifan "//:__pkg__", 68*bcb5dc79SHONG Yifan ], 69*bcb5dc79SHONG Yifan) 70