Give compliance a pkgPath

Change the pkgPath of compliance to android/soong/tools/compliance
to distinguish it from the standard library.

Also add a go.mod file so that the Go tools can find the package.

Test: go test ./...
Change-Id: I061be2b91378db6508e9c88be2548648af8be4e7
This commit is contained in:
Colin Cross 2022-01-27 15:26:49 -08:00
parent 2c51bd1d49
commit 38a6193180
11 changed files with 37 additions and 10 deletions

View File

@ -113,5 +113,5 @@ bootstrap_go_package {
"golang-protobuf-encoding-prototext",
"license_metadata_proto",
],
pkgPath: "compliance",
pkgPath: "android/soong/tools/compliance",
}

View File

@ -16,7 +16,6 @@ package main
import (
"bytes"
"compliance"
"flag"
"fmt"
"io"
@ -24,6 +23,8 @@ import (
"os"
"path/filepath"
"strings"
"android/soong/tools/compliance"
)
var (

View File

@ -15,13 +15,14 @@
package main
import (
"compliance"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"sort"
"android/soong/tools/compliance"
)
func init() {

View File

@ -15,7 +15,6 @@
package main
import (
"compliance"
"flag"
"fmt"
"io"
@ -23,6 +22,8 @@ import (
"path/filepath"
"sort"
"strings"
"android/soong/tools/compliance"
)
var (

View File

@ -15,7 +15,6 @@
package main
import (
"compliance"
"flag"
"fmt"
"io"
@ -23,6 +22,8 @@ import (
"path/filepath"
"sort"
"strings"
"android/soong/tools/compliance"
)
var (

View File

@ -16,10 +16,11 @@ package main
import (
"bytes"
"compliance"
"fmt"
"strings"
"testing"
"android/soong/tools/compliance"
)
func Test_plaintext(t *testing.T) {

View File

@ -16,7 +16,6 @@ package main
import (
"bytes"
"compliance"
"flag"
"fmt"
"html"
@ -25,6 +24,8 @@ import (
"os"
"path/filepath"
"strings"
"android/soong/tools/compliance"
)
var (

View File

@ -15,7 +15,6 @@
package main
import (
"compliance"
"flag"
"fmt"
"io"
@ -23,6 +22,8 @@ import (
"path/filepath"
"sort"
"strings"
"android/soong/tools/compliance"
)
func init() {

View File

@ -16,13 +16,14 @@ package main
import (
"bytes"
"compliance"
"flag"
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
"android/soong/tools/compliance"
)
var (

View File

@ -16,7 +16,6 @@ package main
import (
"bytes"
"compliance"
"flag"
"fmt"
"io"
@ -24,6 +23,8 @@ import (
"os"
"path/filepath"
"strings"
"android/soong/tools/compliance"
)
var (

18
tools/compliance/go.mod Normal file
View File

@ -0,0 +1,18 @@
module android/soong/tools/compliance
require google.golang.org/protobuf v0.0.0
replace google.golang.org/protobuf v0.0.0 => ../../../../external/golang-protobuf
require android/soong v0.0.0
replace android/soong v0.0.0 => ../../../soong
// Indirect deps from golang-protobuf
exclude github.com/golang/protobuf v1.5.0
replace github.com/google/go-cmp v0.5.5 => ../../../../external/go-cmp
// Indirect dep from go-cmp
exclude golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go 1.18