gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/ilist/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance") 3 4 package( 5 default_applicable_licenses = ["//:license"], 6 licenses = ["notice"], 7 ) 8 9 go_library( 10 name = "ilist", 11 srcs = [ 12 "interface_list.go", 13 ], 14 visibility = ["//visibility:public"], 15 ) 16 17 go_template_instance( 18 name = "interface_list", 19 out = "interface_list.go", 20 package = "ilist", 21 template = ":generic_list", 22 types = {}, 23 ) 24 25 # This list is used for benchmarking. 26 go_template_instance( 27 name = "test_list", 28 out = "test_list.go", 29 package = "ilist", 30 prefix = "direct", 31 template = ":generic_list", 32 types = { 33 "Element": "*direct", 34 "Linker": "*direct", 35 }, 36 ) 37 38 go_test( 39 name = "list_test", 40 size = "small", 41 srcs = [ 42 "list_test.go", 43 "test_list.go", 44 ], 45 library = ":ilist", 46 ) 47 48 go_template( 49 name = "generic_list", 50 srcs = [ 51 "list.go", 52 ], 53 opt_types = [ 54 "Element", 55 "ElementMapper", 56 "Linker", 57 ], 58 visibility = ["//visibility:public"], 59 ) 60 61 go_template( 62 name = "generic_ring", 63 srcs = [ 64 "ring.go", 65 ], 66 opt_types = [ 67 "Container", 68 ], 69 visibility = ["//visibility:public"], 70 ) 71 72 go_template_instance( 73 name = "test_ring", 74 out = "test_ring.go", 75 package = "ring", 76 prefix = "test", 77 template = "//pkg/ilist:generic_ring", 78 types = { 79 "Container": "*testContainer", 80 }, 81 ) 82 83 go_library( 84 name = "ring", 85 srcs = [ 86 "interface_ring.go", 87 ], 88 visibility = ["//visibility:public"], 89 ) 90 91 go_template_instance( 92 name = "interface_ring", 93 out = "interface_ring.go", 94 package = "ring", 95 template = ":generic_ring", 96 types = {}, 97 ) 98 99 go_test( 100 name = "ring_test", 101 srcs = [ 102 "ring_test.go", 103 "test_ring.go", 104 ], 105 library = ":ring", 106 )