Move filesystem into Config
The filesystem object was available through ModuleContext.Fs(), but gives too much access to the filesystem without enforicing correct dependencies. In order to support sandboxing the soong_build process move the filesystem into the Config. The next change will make it private. Bug: 146437378 Test: all Soong tests Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
This commit is contained in:
@@ -868,7 +868,7 @@ func TestVisibility(t *testing.T) {
|
||||
func testVisibility(buildDir string, fs map[string][]byte) (*TestContext, []error) {
|
||||
|
||||
// Create a new config per test as visibility information is stored in the config.
|
||||
config := TestArchConfig(buildDir, nil)
|
||||
config := TestArchConfig(buildDir, nil, "", fs)
|
||||
|
||||
ctx := NewTestArchContext()
|
||||
ctx.RegisterModuleType("package", PackageFactory)
|
||||
@@ -879,9 +879,7 @@ func testVisibility(buildDir string, fs map[string][]byte) (*TestContext, []erro
|
||||
ctx.PreArchMutators(RegisterDefaultsPreArchMutators)
|
||||
ctx.PreArchMutators(RegisterVisibilityRuleGatherer)
|
||||
ctx.PostDepsMutators(RegisterVisibilityRuleEnforcer)
|
||||
ctx.Register()
|
||||
|
||||
ctx.MockFileSystem(fs)
|
||||
ctx.Register(config)
|
||||
|
||||
_, errs := ctx.ParseBlueprintsFiles(".")
|
||||
if len(errs) > 0 {
|
||||
|
Reference in New Issue
Block a user