Commit Graph

5 Commits

Author SHA1 Message Date
Jingwen Chen 8481186d56 Fix dist(s)-with-tag and add tests to prevent regression.
While AndroidMkEntries' DistFiles were populated from java_library
properly, there was a bug in the conditionals that dropped the tagged
DistFiles.

Fixes b/152834186
Fixes b/161339864

Test: soong tests, m sdk dist (creates out/dist/test.jar with
aosp/1363578)

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: Id895282256fd367b2f46dcb7a643465fa66c9456
2020-07-21 12:30:39 +00:00
Jingwen Chen 40fd90ae52 Support multiple dists per Android.bp module, and dist output selection.
This CL adds "dists" to the base property struct to support multiple
dist file configurations, and generic tag support to dist tagged outputs
of modules.

Fixes: b/152834186
Test: soong tests and `m sdk dist`

Change-Id: I80c86bc9b7b09e671f640a4480c45d438bdd9a2a
Signed-off-by: Jingwen Chen <jingwen@google.com>
2020-06-25 12:42:07 +00:00
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 12df5fb471 soong: Fix AndroidMk with *Required properties
java.Module is using "Custom" function to write Android.mk.
And if "hostdex" is set to "true", it writes "hostdex" module definition
as well as original module.

As of now, Required/Host_required/Target_required props are filled in
the AndroidMkEntries structure(aosp/939505). But these are not
passed to old AndroidMkData.Custom function.

So, if a java_library declares "hostdex:true" and "required:[...]"
together, "required" is not applied to the "hostdex" variant.

This change copies *Required props from AndroidMkEntries to
AndroidMkData before calling its Custom callback.

Test: m (runs soong unit tests)
Change-Id: I5f85714f721a2a0917ab18072dbea52294c770e7
2019-07-16 02:28:29 +09:00