Loading tools/compliance/cmd/sbom/sbom.go +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import ( "github.com/google/blueprint/deptools" "github.com/spdx/tools-golang/builder/builder2v2" "github.com/spdx/tools-golang/json" spdx_json "github.com/spdx/tools-golang/json" "github.com/spdx/tools-golang/spdx/common" spdx "github.com/spdx/tools-golang/spdx/v2_2" "github.com/spdx/tools-golang/spdxlib" Loading Loading @@ -274,7 +274,7 @@ func getProjectMetadata(_ *context, pmix *projectmetadata.Index, tn *compliance.TargetNode) (*projectmetadata.ProjectMetadata, error) { pms, err := pmix.MetadataForProjects(tn.Projects()...) if err != nil { return nil, fmt.Errorf("Unable to read projects for %q: %w\n", tn, err) return nil, fmt.Errorf("Unable to read projects for %q: %w\n", tn.Name(), err) } if len(pms) == 0 { return nil, nil Loading tools/compliance/cmd/sbom/sbom_test.go +3 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import ( "time" "android/soong/tools/compliance" "github.com/spdx/tools-golang/builder/builder2v2" "github.com/spdx/tools-golang/spdx/common" spdx "github.com/spdx/tools-golang/spdx/v2_2" Loading Loading @@ -2375,8 +2376,8 @@ func validate(doc *spdx.Document) error { if doc.DocumentName == "" { return fmt.Errorf("DocumentName: got nothing, want Document Name") } if fmt.Sprintf("%v", doc.CreationInfo.Creators[1].Creator) != "Google LLC" { return fmt.Errorf("Creator: got %v, want 'Google LLC'") if c := fmt.Sprintf("%v", doc.CreationInfo.Creators[1].Creator); c != "Google LLC" { return fmt.Errorf("Creator: got %v, want 'Google LLC'", c) } _, err := time.Parse(time.RFC3339, doc.CreationInfo.Created) if err != nil { Loading tools/compliance/go.mod +3 −0 Original line number Diff line number Diff line Loading @@ -7,8 +7,11 @@ replace google.golang.org/protobuf v0.0.0 => ../../../../external/golang-protobu require ( android/soong v0.0.0 github.com/google/blueprint v0.0.0 github.com/spdx/tools-golang v0.0.0 ) replace github.com/spdx/tools-golang v0.0.0 => ../../../../external/spdx-tools require golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect replace android/soong v0.0.0 => ../../../soong Loading Loading
tools/compliance/cmd/sbom/sbom.go +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import ( "github.com/google/blueprint/deptools" "github.com/spdx/tools-golang/builder/builder2v2" "github.com/spdx/tools-golang/json" spdx_json "github.com/spdx/tools-golang/json" "github.com/spdx/tools-golang/spdx/common" spdx "github.com/spdx/tools-golang/spdx/v2_2" "github.com/spdx/tools-golang/spdxlib" Loading Loading @@ -274,7 +274,7 @@ func getProjectMetadata(_ *context, pmix *projectmetadata.Index, tn *compliance.TargetNode) (*projectmetadata.ProjectMetadata, error) { pms, err := pmix.MetadataForProjects(tn.Projects()...) if err != nil { return nil, fmt.Errorf("Unable to read projects for %q: %w\n", tn, err) return nil, fmt.Errorf("Unable to read projects for %q: %w\n", tn.Name(), err) } if len(pms) == 0 { return nil, nil Loading
tools/compliance/cmd/sbom/sbom_test.go +3 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import ( "time" "android/soong/tools/compliance" "github.com/spdx/tools-golang/builder/builder2v2" "github.com/spdx/tools-golang/spdx/common" spdx "github.com/spdx/tools-golang/spdx/v2_2" Loading Loading @@ -2375,8 +2376,8 @@ func validate(doc *spdx.Document) error { if doc.DocumentName == "" { return fmt.Errorf("DocumentName: got nothing, want Document Name") } if fmt.Sprintf("%v", doc.CreationInfo.Creators[1].Creator) != "Google LLC" { return fmt.Errorf("Creator: got %v, want 'Google LLC'") if c := fmt.Sprintf("%v", doc.CreationInfo.Creators[1].Creator); c != "Google LLC" { return fmt.Errorf("Creator: got %v, want 'Google LLC'", c) } _, err := time.Parse(time.RFC3339, doc.CreationInfo.Created) if err != nil { Loading
tools/compliance/go.mod +3 −0 Original line number Diff line number Diff line Loading @@ -7,8 +7,11 @@ replace google.golang.org/protobuf v0.0.0 => ../../../../external/golang-protobu require ( android/soong v0.0.0 github.com/google/blueprint v0.0.0 github.com/spdx/tools-golang v0.0.0 ) replace github.com/spdx/tools-golang v0.0.0 => ../../../../external/spdx-tools require golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect replace android/soong v0.0.0 => ../../../soong Loading