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
diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go
index 7ddf6eb..31db2df 100644
--- a/cc/prebuilt_test.go
+++ b/cc/prebuilt_test.go
@@ -68,9 +68,9 @@
"libe.a": nil,
}
- config := android.TestArchConfig(buildDir, nil)
+ config := TestConfig(buildDir, android.Android, nil, bp, fs)
- ctx := CreateTestContext(bp, fs, android.Android)
+ ctx := CreateTestContext()
ctx.RegisterModuleType("cc_prebuilt_library_shared", PrebuiltSharedLibraryFactory)
ctx.RegisterModuleType("cc_prebuilt_library_static", PrebuiltStaticLibraryFactory)
@@ -79,7 +79,7 @@
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PostDepsMutators(android.RegisterPrebuiltsPostDepsMutators)
- ctx.Register()
+ ctx.Register(config)
_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
android.FailIfErrored(t, errs)