summaryrefslogtreecommitdiff
path: root/bp2build/conversion_test.go
diff options
context:
space:
mode:
author Jingwen Chen <jingwen@google.com> 2021-01-26 21:58:43 -0500
committer Jingwen Chen <jingwen@google.com> 2021-01-26 22:46:20 -0500
commit40067de675ed2d68860dd528f2c55951c02366ae (patch)
tree0067d7f50d154824280710a56d6563b1bcfac020 /bp2build/conversion_test.go
parenta42d6417b3cdef35b6c2f9e1aa9f6e8ab51c1499 (diff)
bp2build: support Starlark rules and load statements.
This CL adds support to bp2build for declaring the location of the Starlark rule definition when creating BazelTargetModules. This is needed for non-native rules that needs to be loaded from .bzl files somewhere in the tree. Since load statements are aggregated at the top of the BUILD file, away from the targets that actually use them, this CL also introduces an abstraction to group BazelTargets together and compute their load statements and target string representations separately, allowing load statements to be decoupled and written into a BUILD file before the targets themselves. Test: soong tests Test: TH Test: GENERATE_BAZEL_FILES=true m nothing && build/bazel/scripts/bp2build-sync.sh write && bazel cquery //bionic/... Fixes: 178531760 Test: TH Change-Id: Ie5f793a00006eb024eaef07ddd9fde7aaefc054e
Diffstat (limited to 'bp2build/conversion_test.go')
-rw-r--r--bp2build/conversion_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/bp2build/conversion_test.go b/bp2build/conversion_test.go
index 7f75b14f7..ec5f27e21 100644
--- a/bp2build/conversion_test.go
+++ b/bp2build/conversion_test.go
@@ -55,7 +55,7 @@ func sortFiles(files []BazelFile) {
}
func TestCreateBazelFiles_QueryView_AddsTopLevelFiles(t *testing.T) {
- files := CreateBazelFiles(map[string]RuleShim{}, map[string][]BazelTarget{}, QueryView)
+ files := CreateBazelFiles(map[string]RuleShim{}, map[string]BazelTargets{}, QueryView)
expectedFilePaths := []filepath{
{
dir: "",
@@ -85,7 +85,7 @@ func TestCreateBazelFiles_QueryView_AddsTopLevelFiles(t *testing.T) {
}
func TestCreateBazelFiles_Bp2Build_AddsTopLevelFiles(t *testing.T) {
- files := CreateBazelFiles(map[string]RuleShim{}, map[string][]BazelTarget{}, Bp2Build)
+ files := CreateBazelFiles(map[string]RuleShim{}, map[string]BazelTargets{}, Bp2Build)
expectedFilePaths := []filepath{
{
dir: "",