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:
Colin Cross
2019-12-13 20:41:13 -08:00
parent 572aeed6a4
commit 98be1bb00f
42 changed files with 765 additions and 793 deletions

View File

@@ -198,18 +198,11 @@ func TestProductVariables(t *testing.T) {
name: "baz",
}
`
mockFS := map[string][]byte{
"Android.bp": []byte(bp),
}
ctx.MockFileSystem(mockFS)
ctx.Register()
config := TestConfig(buildDir, nil)
config := TestConfig(buildDir, nil, bp, nil)
config.TestProductVariables.Eng = proptools.BoolPtr(true)
ctx.Register(config)
_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
FailIfErrored(t, errs)
_, errs = ctx.PrepareBuildActions(config)