Loading bp2build/build_conversion.go +22 −9 Original line number Diff line number Diff line Loading @@ -394,7 +394,18 @@ func prettyPrint(propertyValue reflect.Value, indent int) (string, error) { return "", nil } ret = "[\n" if propertyValue.Len() == 1 { // Single-line list for list with only 1 element ret += "[" indexedValue, err := prettyPrint(propertyValue.Index(0), indent) if err != nil { return "", err } ret += indexedValue ret += "]" } else { // otherwise, use a multiline list. ret += "[\n" for i := 0; i < propertyValue.Len(); i++ { indexedValue, err := prettyPrint(propertyValue.Index(i), indent+1) if err != nil { Loading @@ -409,6 +420,8 @@ func prettyPrint(propertyValue reflect.Value, indent int) (string, error) { } ret += makeIndent(indent) ret += "]" } case reflect.Struct: // Special cases where the bp2build sends additional information to the codegenerator // by wrapping the attributes in a custom struct type. Loading bp2build/build_conversion_test.go +43 −113 Original line number Diff line number Diff line Loading @@ -27,9 +27,7 @@ func TestGenerateSoongModuleTargets(t *testing.T) { expectedBazelTarget string }{ { bp: `custom { name: "foo", } bp: `custom { name: "foo" } `, expectedBazelTarget: `soong_module( name = "foo", Loading Loading @@ -85,9 +83,7 @@ func TestGenerateSoongModuleTargets(t *testing.T) { soong_module_variant = "", soong_module_deps = [ ], required = [ "bar", ], required = ["bar"], )`, }, { Loading Loading @@ -116,12 +112,10 @@ func TestGenerateSoongModuleTargets(t *testing.T) { targets: ["goal_foo"], tag: ".foo", }, dists: [ { dists: [{ targets: ["goal_bar"], tag: ".bar", }, ], }], } `, expectedBazelTarget: `soong_module( Loading @@ -133,18 +127,12 @@ func TestGenerateSoongModuleTargets(t *testing.T) { ], dist = { "tag": ".foo", "targets": [ "goal_foo", ], "targets": ["goal_foo"], }, dists = [ { dists = [{ "tag": ".bar", "targets": [ "goal_bar", ], }, ], "targets": ["goal_bar"], }], )`, }, { Loading @@ -169,19 +157,13 @@ func TestGenerateSoongModuleTargets(t *testing.T) { soong_module_variant = "", soong_module_deps = [ ], dists = [ { dists = [{ "tag": ".tag", "targets": [ "my_goal", ], }, ], "targets": ["my_goal"], }], owner = "custom_owner", ramdisk = True, required = [ "bar", ], required = ["bar"], target_required = [ "qux", "bazqux", Loading Loading @@ -553,9 +535,7 @@ genrule { }`, expectedBazelTargets: []string{`filegroup( name = "fg_foo", srcs = [ "b", ], srcs = ["b"], )`, }, }, Loading Loading @@ -671,25 +651,15 @@ genrule { `genrule( name = "foo", cmd = "$(location :foo.tool) --genDir=$(GENDIR) arg $(SRCS) $(OUTS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ ":foo.tool", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [":foo.tool"], )`, `genrule( name = "foo.tool", cmd = "cp $(SRCS) $(OUTS)", outs = [ "foo_tool.out", ], srcs = [ "foo_tool.in", ], outs = ["foo_tool.out"], srcs = ["foo_tool.in"], )`, }, }, Loading Loading @@ -718,15 +688,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations :foo.tools) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ ":foo.tools", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [":foo.tools"], )`, `genrule( name = "foo.tools", Loading @@ -735,9 +699,7 @@ genrule { "foo_tool.out", "foo_tool2.out", ], srcs = [ "foo_tool.in", ], srcs = ["foo_tool.in"], )`, }, }, Loading @@ -758,15 +720,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ "//other:foo.tool", ], outs = ["foo.out"], srcs = ["foo.in"], tools = ["//other:foo.tool"], )`, }, fs: otherGenruleBp, Loading @@ -788,15 +744,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(location //other:other.tool)", outs = [ "foo.out", ], srcs = [ "//other:other.tool", ], tools = [ "//other:foo.tool", ], outs = ["foo.out"], srcs = ["//other:other.tool"], tools = ["//other:foo.tool"], )`, }, fs: otherGenruleBp, Loading @@ -818,12 +768,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(location //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [ "//other:foo.tool", "//other:other.tool", Loading @@ -849,12 +795,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [ "//other:foo.tool", "//other:other.tool", Loading @@ -879,12 +821,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "cp $(SRCS) $(OUTS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], )`, }, }, Loading Loading @@ -988,12 +926,8 @@ genrule { expectedBazelTarget: `genrule( name = "gen", cmd = "do-something $(SRCS) $(OUTS)", outs = [ "out", ], srcs = [ "in1", ], outs = ["out"], srcs = ["in1"], )`, description: "genrule applies properties from a genrule_defaults dependency if not specified", }, Loading Loading @@ -1062,12 +996,8 @@ genrule { expectedBazelTarget: `genrule( name = "gen", cmd = "cp $(SRCS) $(OUTS)", outs = [ "out", ], srcs = [ "in1", ], outs = ["out"], srcs = ["in1"], )`, description: "genrule applies properties from list of genrule_defaults", }, Loading bp2build/cc_library_conversion_test.go +16 −48 Original line number Diff line number Diff line Loading @@ -109,12 +109,8 @@ cc_library { `, expectedBazelTargets: []string{`cc_library( name = "foo-lib", copts = [ "-Wall", ], deps = [ ":some-headers", ], copts = ["-Wall"], deps = [":some-headers"], hdrs = [ "header.h", "header.hh", Loading @@ -127,40 +123,20 @@ cc_library { "header.h.generic", "foo-dir/a.h", ], includes = [ "foo-dir", ], linkopts = [ "-Wl,--exclude-libs=bar.a", ] + select({ "//build/bazel/platforms/arch:x86": [ "-Wl,--exclude-libs=baz.a", ], "//build/bazel/platforms/arch:x86_64": [ "-Wl,--exclude-libs=qux.a", ], includes = ["foo-dir"], linkopts = ["-Wl,--exclude-libs=bar.a"] + select({ "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"], "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"], "//conditions:default": [], }), srcs = [ "impl.cpp", ] + select({ "//build/bazel/platforms/arch:x86": [ "x86.cpp", ], "//build/bazel/platforms/arch:x86_64": [ "x86_64.cpp", ], srcs = ["impl.cpp"] + select({ "//build/bazel/platforms/arch:x86": ["x86.cpp"], "//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"], "//conditions:default": [], }) + select({ "//build/bazel/platforms/os:android": [ "android.cpp", ], "//build/bazel/platforms/os:darwin": [ "darwin.cpp", ], "//build/bazel/platforms/os:linux": [ "linux.cpp", ], "//build/bazel/platforms/os:android": ["android.cpp"], "//build/bazel/platforms/os:darwin": ["darwin.cpp"], "//build/bazel/platforms/os:linux": ["linux.cpp"], "//conditions:default": [], }), )`}, Loading Loading @@ -215,9 +191,7 @@ cc_library { "-Wunused", "-Werror", ], deps = [ ":libc_headers", ], deps = [":libc_headers"], hdrs = [ "linked_list.h", "linker.h", Loading @@ -232,17 +206,11 @@ cc_library { "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a", "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a", ] + select({ "//build/bazel/platforms/arch:x86": [ "-Wl,--exclude-libs=libgcc_eh.a", ], "//build/bazel/platforms/arch:x86_64": [ "-Wl,--exclude-libs=libgcc_eh.a", ], "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"], "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"], "//conditions:default": [], }), srcs = [ "ld_android.cpp", ], srcs = ["ld_android.cpp"], )`}, }, } Loading bp2build/cc_library_headers_conversion_test.go +15 −45 Original line number Diff line number Diff line Loading @@ -141,30 +141,18 @@ cc_library_headers { "dir-2/dir2a.h", "dir-2/dir2b.h", ] + select({ "//build/bazel/platforms/arch:arm64": [ "arch_arm64_exported_include_dir/a.h", ], "//build/bazel/platforms/arch:x86": [ "arch_x86_exported_include_dir/b.h", ], "//build/bazel/platforms/arch:x86_64": [ "arch_x86_64_exported_include_dir/c.h", ], "//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir/a.h"], "//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir/b.h"], "//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir/c.h"], "//conditions:default": [], }), includes = [ "dir-1", "dir-2", ] + select({ "//build/bazel/platforms/arch:arm64": [ "arch_arm64_exported_include_dir", ], "//build/bazel/platforms/arch:x86": [ "arch_x86_exported_include_dir", ], "//build/bazel/platforms/arch:x86_64": [ "arch_x86_64_exported_include_dir", ], "//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir"], "//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir"], "//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"], "//conditions:default": [], }), )`, `cc_library_headers( Loading @@ -173,18 +161,14 @@ cc_library_headers { "lib-1/lib1a.h", "lib-1/lib1b.h", ], includes = [ "lib-1", ], includes = ["lib-1"], )`, `cc_library_headers( name = "lib-2", hdrs = [ "lib-2/lib2a.h", "lib-2/lib2b.h", ], includes = [ "lib-2", ], includes = ["lib-2"], )`}, }, { Loading Loading @@ -223,27 +207,13 @@ cc_library_headers { name = "darwin-lib", )`, `cc_library_headers( name = "foo_headers", deps = [ ":base-lib", ] + select({ "//build/bazel/platforms/os:android": [ ":android-lib", ], "//build/bazel/platforms/os:darwin": [ ":darwin-lib", ], "//build/bazel/platforms/os:fuchsia": [ ":fuchsia-lib", ], "//build/bazel/platforms/os:linux": [ ":linux-lib", ], "//build/bazel/platforms/os:linux_bionic": [ ":linux_bionic-lib", ], "//build/bazel/platforms/os:windows": [ ":windows-lib", ], deps = [":base-lib"] + select({ "//build/bazel/platforms/os:android": [":android-lib"], "//build/bazel/platforms/os:darwin": [":darwin-lib"], "//build/bazel/platforms/os:fuchsia": [":fuchsia-lib"], "//build/bazel/platforms/os:linux": [":linux-lib"], "//build/bazel/platforms/os:linux_bionic": [":linux_bionic-lib"], "//build/bazel/platforms/os:windows": [":windows-lib"], "//conditions:default": [], }), )`, `cc_library_headers( Loading bp2build/cc_library_static_conversion_test.go +4 −12 Original line number Diff line number Diff line Loading @@ -231,9 +231,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "static_lib_1.cc", Loading @@ -246,9 +244,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "static_lib_2.cc", Loading @@ -261,9 +257,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "whole_static_lib_1.cc", Loading @@ -276,9 +270,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "whole_static_lib_2.cc", Loading Loading
bp2build/build_conversion.go +22 −9 Original line number Diff line number Diff line Loading @@ -394,7 +394,18 @@ func prettyPrint(propertyValue reflect.Value, indent int) (string, error) { return "", nil } ret = "[\n" if propertyValue.Len() == 1 { // Single-line list for list with only 1 element ret += "[" indexedValue, err := prettyPrint(propertyValue.Index(0), indent) if err != nil { return "", err } ret += indexedValue ret += "]" } else { // otherwise, use a multiline list. ret += "[\n" for i := 0; i < propertyValue.Len(); i++ { indexedValue, err := prettyPrint(propertyValue.Index(i), indent+1) if err != nil { Loading @@ -409,6 +420,8 @@ func prettyPrint(propertyValue reflect.Value, indent int) (string, error) { } ret += makeIndent(indent) ret += "]" } case reflect.Struct: // Special cases where the bp2build sends additional information to the codegenerator // by wrapping the attributes in a custom struct type. Loading
bp2build/build_conversion_test.go +43 −113 Original line number Diff line number Diff line Loading @@ -27,9 +27,7 @@ func TestGenerateSoongModuleTargets(t *testing.T) { expectedBazelTarget string }{ { bp: `custom { name: "foo", } bp: `custom { name: "foo" } `, expectedBazelTarget: `soong_module( name = "foo", Loading Loading @@ -85,9 +83,7 @@ func TestGenerateSoongModuleTargets(t *testing.T) { soong_module_variant = "", soong_module_deps = [ ], required = [ "bar", ], required = ["bar"], )`, }, { Loading Loading @@ -116,12 +112,10 @@ func TestGenerateSoongModuleTargets(t *testing.T) { targets: ["goal_foo"], tag: ".foo", }, dists: [ { dists: [{ targets: ["goal_bar"], tag: ".bar", }, ], }], } `, expectedBazelTarget: `soong_module( Loading @@ -133,18 +127,12 @@ func TestGenerateSoongModuleTargets(t *testing.T) { ], dist = { "tag": ".foo", "targets": [ "goal_foo", ], "targets": ["goal_foo"], }, dists = [ { dists = [{ "tag": ".bar", "targets": [ "goal_bar", ], }, ], "targets": ["goal_bar"], }], )`, }, { Loading @@ -169,19 +157,13 @@ func TestGenerateSoongModuleTargets(t *testing.T) { soong_module_variant = "", soong_module_deps = [ ], dists = [ { dists = [{ "tag": ".tag", "targets": [ "my_goal", ], }, ], "targets": ["my_goal"], }], owner = "custom_owner", ramdisk = True, required = [ "bar", ], required = ["bar"], target_required = [ "qux", "bazqux", Loading Loading @@ -553,9 +535,7 @@ genrule { }`, expectedBazelTargets: []string{`filegroup( name = "fg_foo", srcs = [ "b", ], srcs = ["b"], )`, }, }, Loading Loading @@ -671,25 +651,15 @@ genrule { `genrule( name = "foo", cmd = "$(location :foo.tool) --genDir=$(GENDIR) arg $(SRCS) $(OUTS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ ":foo.tool", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [":foo.tool"], )`, `genrule( name = "foo.tool", cmd = "cp $(SRCS) $(OUTS)", outs = [ "foo_tool.out", ], srcs = [ "foo_tool.in", ], outs = ["foo_tool.out"], srcs = ["foo_tool.in"], )`, }, }, Loading Loading @@ -718,15 +688,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations :foo.tools) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ ":foo.tools", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [":foo.tools"], )`, `genrule( name = "foo.tools", Loading @@ -735,9 +699,7 @@ genrule { "foo_tool.out", "foo_tool2.out", ], srcs = [ "foo_tool.in", ], srcs = ["foo_tool.in"], )`, }, }, Loading @@ -758,15 +720,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], tools = [ "//other:foo.tool", ], outs = ["foo.out"], srcs = ["foo.in"], tools = ["//other:foo.tool"], )`, }, fs: otherGenruleBp, Loading @@ -788,15 +744,9 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(location //other:other.tool)", outs = [ "foo.out", ], srcs = [ "//other:other.tool", ], tools = [ "//other:foo.tool", ], outs = ["foo.out"], srcs = ["//other:other.tool"], tools = ["//other:foo.tool"], )`, }, fs: otherGenruleBp, Loading @@ -818,12 +768,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(location //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [ "//other:foo.tool", "//other:other.tool", Loading @@ -849,12 +795,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "$(locations //other:foo.tool) -s $(OUTS) $(SRCS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], tools = [ "//other:foo.tool", "//other:other.tool", Loading @@ -879,12 +821,8 @@ genrule { expectedBazelTargets: []string{`genrule( name = "foo", cmd = "cp $(SRCS) $(OUTS)", outs = [ "foo.out", ], srcs = [ "foo.in", ], outs = ["foo.out"], srcs = ["foo.in"], )`, }, }, Loading Loading @@ -988,12 +926,8 @@ genrule { expectedBazelTarget: `genrule( name = "gen", cmd = "do-something $(SRCS) $(OUTS)", outs = [ "out", ], srcs = [ "in1", ], outs = ["out"], srcs = ["in1"], )`, description: "genrule applies properties from a genrule_defaults dependency if not specified", }, Loading Loading @@ -1062,12 +996,8 @@ genrule { expectedBazelTarget: `genrule( name = "gen", cmd = "cp $(SRCS) $(OUTS)", outs = [ "out", ], srcs = [ "in1", ], outs = ["out"], srcs = ["in1"], )`, description: "genrule applies properties from list of genrule_defaults", }, Loading
bp2build/cc_library_conversion_test.go +16 −48 Original line number Diff line number Diff line Loading @@ -109,12 +109,8 @@ cc_library { `, expectedBazelTargets: []string{`cc_library( name = "foo-lib", copts = [ "-Wall", ], deps = [ ":some-headers", ], copts = ["-Wall"], deps = [":some-headers"], hdrs = [ "header.h", "header.hh", Loading @@ -127,40 +123,20 @@ cc_library { "header.h.generic", "foo-dir/a.h", ], includes = [ "foo-dir", ], linkopts = [ "-Wl,--exclude-libs=bar.a", ] + select({ "//build/bazel/platforms/arch:x86": [ "-Wl,--exclude-libs=baz.a", ], "//build/bazel/platforms/arch:x86_64": [ "-Wl,--exclude-libs=qux.a", ], includes = ["foo-dir"], linkopts = ["-Wl,--exclude-libs=bar.a"] + select({ "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"], "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"], "//conditions:default": [], }), srcs = [ "impl.cpp", ] + select({ "//build/bazel/platforms/arch:x86": [ "x86.cpp", ], "//build/bazel/platforms/arch:x86_64": [ "x86_64.cpp", ], srcs = ["impl.cpp"] + select({ "//build/bazel/platforms/arch:x86": ["x86.cpp"], "//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"], "//conditions:default": [], }) + select({ "//build/bazel/platforms/os:android": [ "android.cpp", ], "//build/bazel/platforms/os:darwin": [ "darwin.cpp", ], "//build/bazel/platforms/os:linux": [ "linux.cpp", ], "//build/bazel/platforms/os:android": ["android.cpp"], "//build/bazel/platforms/os:darwin": ["darwin.cpp"], "//build/bazel/platforms/os:linux": ["linux.cpp"], "//conditions:default": [], }), )`}, Loading Loading @@ -215,9 +191,7 @@ cc_library { "-Wunused", "-Werror", ], deps = [ ":libc_headers", ], deps = [":libc_headers"], hdrs = [ "linked_list.h", "linker.h", Loading @@ -232,17 +206,11 @@ cc_library { "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a", "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a", ] + select({ "//build/bazel/platforms/arch:x86": [ "-Wl,--exclude-libs=libgcc_eh.a", ], "//build/bazel/platforms/arch:x86_64": [ "-Wl,--exclude-libs=libgcc_eh.a", ], "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"], "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"], "//conditions:default": [], }), srcs = [ "ld_android.cpp", ], srcs = ["ld_android.cpp"], )`}, }, } Loading
bp2build/cc_library_headers_conversion_test.go +15 −45 Original line number Diff line number Diff line Loading @@ -141,30 +141,18 @@ cc_library_headers { "dir-2/dir2a.h", "dir-2/dir2b.h", ] + select({ "//build/bazel/platforms/arch:arm64": [ "arch_arm64_exported_include_dir/a.h", ], "//build/bazel/platforms/arch:x86": [ "arch_x86_exported_include_dir/b.h", ], "//build/bazel/platforms/arch:x86_64": [ "arch_x86_64_exported_include_dir/c.h", ], "//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir/a.h"], "//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir/b.h"], "//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir/c.h"], "//conditions:default": [], }), includes = [ "dir-1", "dir-2", ] + select({ "//build/bazel/platforms/arch:arm64": [ "arch_arm64_exported_include_dir", ], "//build/bazel/platforms/arch:x86": [ "arch_x86_exported_include_dir", ], "//build/bazel/platforms/arch:x86_64": [ "arch_x86_64_exported_include_dir", ], "//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir"], "//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir"], "//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"], "//conditions:default": [], }), )`, `cc_library_headers( Loading @@ -173,18 +161,14 @@ cc_library_headers { "lib-1/lib1a.h", "lib-1/lib1b.h", ], includes = [ "lib-1", ], includes = ["lib-1"], )`, `cc_library_headers( name = "lib-2", hdrs = [ "lib-2/lib2a.h", "lib-2/lib2b.h", ], includes = [ "lib-2", ], includes = ["lib-2"], )`}, }, { Loading Loading @@ -223,27 +207,13 @@ cc_library_headers { name = "darwin-lib", )`, `cc_library_headers( name = "foo_headers", deps = [ ":base-lib", ] + select({ "//build/bazel/platforms/os:android": [ ":android-lib", ], "//build/bazel/platforms/os:darwin": [ ":darwin-lib", ], "//build/bazel/platforms/os:fuchsia": [ ":fuchsia-lib", ], "//build/bazel/platforms/os:linux": [ ":linux-lib", ], "//build/bazel/platforms/os:linux_bionic": [ ":linux_bionic-lib", ], "//build/bazel/platforms/os:windows": [ ":windows-lib", ], deps = [":base-lib"] + select({ "//build/bazel/platforms/os:android": [":android-lib"], "//build/bazel/platforms/os:darwin": [":darwin-lib"], "//build/bazel/platforms/os:fuchsia": [":fuchsia-lib"], "//build/bazel/platforms/os:linux": [":linux-lib"], "//build/bazel/platforms/os:linux_bionic": [":linux_bionic-lib"], "//build/bazel/platforms/os:windows": [":windows-lib"], "//conditions:default": [], }), )`, `cc_library_headers( Loading
bp2build/cc_library_static_conversion_test.go +4 −12 Original line number Diff line number Diff line Loading @@ -231,9 +231,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "static_lib_1.cc", Loading @@ -246,9 +244,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "static_lib_2.cc", Loading @@ -261,9 +257,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "whole_static_lib_1.cc", Loading @@ -276,9 +270,7 @@ cc_library_static { "implicit_include_1.h", "implicit_include_2.h", ], includes = [ ".", ], includes = ["."], linkstatic = True, srcs = [ "whole_static_lib_2.cc", Loading