Support OUT_DIR for license graph.
Bug: 226066987 Test: OUT_DIR=/tmp/outdir m all listshare checkshare htmlnotice rtrace dumpgraph dumpresolutions compliancenotice_bom compliancenotice_shippedlibs Test: OUT_DIR=/tmp/outdir m /tmp/outdir/target/product/bonito/obj/NOTICE.xml.gz Test: m all listshare checkshare htmlnotice rtrace dumpgraph dumpresolutions compliancenotice_bom compliancenotice_shippedlibs Test: m out/target/product/bonito/obj/NOTICE.xml.gz Change-Id: I6282c647a389c5935d5ce7c79193f86d32c76365
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -31,6 +32,22 @@ var (
|
||||
ConcurrentReaders = 5
|
||||
)
|
||||
|
||||
type globalFS struct{}
|
||||
|
||||
func (s globalFS) Open(name string) (fs.File, error) {
|
||||
return os.Open(name)
|
||||
}
|
||||
|
||||
var FS globalFS
|
||||
|
||||
// GetFS returns a filesystem for accessing files under the OUT_DIR environment variable.
|
||||
func GetFS(outDir string) fs.FS {
|
||||
if len(outDir) > 0 {
|
||||
return os.DirFS(outDir)
|
||||
}
|
||||
return os.DirFS(".")
|
||||
}
|
||||
|
||||
// result describes the outcome of reading and parsing a single license metadata file.
|
||||
type result struct {
|
||||
// file identifies the path to the license metadata file
|
||||
|
Reference in New Issue
Block a user