@@ -30,12 +30,15 @@ const (
3030 RulesGoStdlibLabel = "@io_bazel_rules_go//:stdlib"
3131)
3232
33+ var _defaultKinds = []string {"go_library" , "go_test" , "go_binary" }
34+
3335func (b * BazelJSONBuilder ) fileQuery (filename string ) string {
3436 if filepath .IsAbs (filename ) {
3537 fp , _ := filepath .Rel (b .bazel .WorkspaceRoot (), filename )
3638 filename = fp
3739 }
38- return fmt .Sprintf (`kind("go_library|go_test|go_binary", same_pkg_direct_rdeps("%s"))` , filename )
40+ kinds := append (_defaultKinds , additionalKinds ... )
41+ return fmt .Sprintf (`kind("%s", same_pkg_direct_rdeps("%s"))` , strings .Join (kinds , "|" ), filename )
3942}
4043
4144func (b * BazelJSONBuilder ) packageQuery (importPath string ) string {
@@ -120,7 +123,7 @@ func (b *BazelJSONBuilder) Build(ctx context.Context, mode LoadMode) ([]string,
120123 "--experimental_convenience_symlinks=ignore" ,
121124 "--ui_event_filters=-info,-stderr" ,
122125 "--noshow_progress" ,
123- "--aspects=" + rulesGoRepositoryName + "//go/tools/gopackagesdriver:aspect.bzl%go_pkg_info_aspect" ,
126+ "--aspects=" + customAspect ,
124127 "--output_groups=" + b .outputGroupsForMode (mode ),
125128 "--keep_going" , // Build all possible packages
126129 }, bazelFlags , bazelBuildFlags , labels )
0 commit comments