Move compliance commands into subdirectories
Move each compliance command into its own directory to avoid Go tooling considering all the files to be a single package and complaining about conflicting global names. Test: go test ./... Change-Id: I3db6310e7368bcc7fe6a3704b40a84078ed44209
This commit is contained in:
@@ -19,58 +19,58 @@ package {
|
|||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "bom",
|
name: "bom",
|
||||||
srcs: ["cmd/bom.go"],
|
srcs: ["cmd/bom/bom.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/bom_test.go"],
|
testSrcs: ["cmd/bom/bom_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "checkshare",
|
name: "checkshare",
|
||||||
srcs: ["cmd/checkshare.go"],
|
srcs: ["cmd/checkshare/checkshare.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/checkshare_test.go"],
|
testSrcs: ["cmd/checkshare/checkshare_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "listshare",
|
name: "listshare",
|
||||||
srcs: ["cmd/listshare.go"],
|
srcs: ["cmd/listshare/listshare.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/listshare_test.go"],
|
testSrcs: ["cmd/listshare/listshare_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "dumpgraph",
|
name: "dumpgraph",
|
||||||
srcs: ["cmd/dumpgraph.go"],
|
srcs: ["cmd/dumpgraph/dumpgraph.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/dumpgraph_test.go"],
|
testSrcs: ["cmd/dumpgraph/dumpgraph_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "dumpresolutions",
|
name: "dumpresolutions",
|
||||||
srcs: ["cmd/dumpresolutions.go"],
|
srcs: ["cmd/dumpresolutions/dumpresolutions.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/dumpresolutions_test.go"],
|
testSrcs: ["cmd/dumpresolutions/dumpresolutions_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "htmlnotice",
|
name: "htmlnotice",
|
||||||
srcs: ["cmd/htmlnotice.go"],
|
srcs: ["cmd/htmlnotice/htmlnotice.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/htmlnotice_test.go"],
|
testSrcs: ["cmd/htmlnotice/htmlnotice_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "shippedlibs",
|
name: "shippedlibs",
|
||||||
srcs: ["cmd/shippedlibs.go"],
|
srcs: ["cmd/shippedlibs/shippedlibs.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/shippedlibs_test.go"],
|
testSrcs: ["cmd/shippedlibs/shippedlibs_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint_go_binary {
|
blueprint_go_binary {
|
||||||
name: "textnotice",
|
name: "textnotice",
|
||||||
srcs: ["cmd/textnotice.go"],
|
srcs: ["cmd/textnotice/textnotice.go"],
|
||||||
deps: ["compliance-module"],
|
deps: ["compliance-module"],
|
||||||
testSrcs: ["cmd/textnotice_test.go"],
|
testSrcs: ["cmd/textnotice/textnotice_test.go"],
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap_go_package {
|
bootstrap_go_package {
|
||||||
|
@@ -17,11 +17,22 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
@@ -17,10 +17,21 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
type outcome struct {
|
type outcome struct {
|
||||||
target string
|
target string
|
||||||
privacyCondition string
|
privacyCondition string
|
@@ -17,10 +17,21 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test_plaintext(t *testing.T) {
|
func Test_plaintext(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
@@ -17,12 +17,23 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"android/soong/tools/compliance"
|
"android/soong/tools/compliance"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test_plaintext(t *testing.T) {
|
func Test_plaintext(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
@@ -39,6 +39,16 @@ var (
|
|||||||
libReference = regexp.MustCompile(`^\s*<li><a href="#[^"]{32}">(.*)</a>\s*$`)
|
libReference = regexp.MustCompile(`^\s*<li><a href="#[^"]{32}">(.*)</a>\s*$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
@@ -16,10 +16,22 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
type projectShare struct {
|
type projectShare struct {
|
||||||
project string
|
project string
|
@@ -17,11 +17,22 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
@@ -28,6 +28,16 @@ var (
|
|||||||
horizontalRule = regexp.MustCompile("^===[=]*===$")
|
horizontalRule = regexp.MustCompile("^===[=]*===$")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Change into the parent directory before running the tests
|
||||||
|
// so they can find the testdata directory.
|
||||||
|
if err := os.Chdir(".."); err != nil {
|
||||||
|
fmt.Printf("failed to change to testdata directory: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
condition string
|
condition string
|
Reference in New Issue
Block a user