Commit graph

4 commits

Author SHA1 Message Date
Colin Cross
98be1bb00f 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
2019-12-18 08:19:10 -08:00
Colin Cross
4b49b768a2 Make TestContext.RegisterModuleType take an android.ModuleFactory
Avoid having to pass ModuleFactoryAdaptor to every call to
RegisterModuleType in a test by wrapping RegisterModuleType.

Test: all soong tests
Change-Id: If8847d16487de0479cc3020b728256922b3cadba
2019-11-25 10:59:44 -08:00
Jooyung Han
d48f3c3885 soong: Add tests for depending on disabled module
This will check if direct deps of android.Module type is "Enabled()".
Previously, this is checked only if a module calls VisitDeps*()
functions in GenerateAndroidBuildActions().

Most modules call VisitDeps*() in GenerateAndroidBuildActions(),
but some modules don't. For example, "apex" module calls
WalkDepsBlueprint() or VisitDirectDepsBlueprint() since it
exceptionally depends on non-android.Module modules.

Therefore, when an apex module depends on disabled(enabled:false) module,
build fails with panic, which is fixed by this change.

Test: m # runs soong tests
Change-Id: I81c5c148bbd51a253d2904690eb76ae7b6df1a0f
2019-08-26 13:19:42 +00:00
Colin Cross
41955e8895 Support tagged module references
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output.  For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files.  Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).

Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
2019-06-04 10:22:51 -07:00