Commit Graph

9 Commits

Author SHA1 Message Date
Colin Cross d11fcda940 Convert Visit*Deps from blueprint.Module to android.Module
Also adds checks that the dependencies are android.Modules and
are not disabled.

Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
2017-10-24 13:01:03 -07:00
Colin Cross 74d73e2bfb Rename java_prebuilt_library to java_import
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.

Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
2017-08-11 15:24:11 -07:00
Colin Cross 5ea9bcc50b Fix java prebuilts
The java prebuilt tests weren't registering the prebuilts mutators,
which hid an issue where prebuilts modules weren't getting renamed
to avoid collisions with source modules of the same name, which
ended up causing the prebuilt module to try to add a dependency
on itself.

Test: java_test.go
Change-Id: I3327d27533591cb08a4b8b8b5e1668a6f72be8df
2017-07-31 23:50:01 -07:00
Colin Cross cec8171420 Add integration testing infrastructure
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.

Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
    config := android.TestConfig(buildDir)
    ctx := android.NewTestContext()
    ctx.RegisterModuleType(...)
    ctx.MockFileSystem(...)
    ctx.ParseBlueprintsFile("Android.bp")
    ctx.PrepareBuildActions(config)
    ctx.Register()
    // Get the Inputs value passed to the javac rule for the foo module
    inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs

Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
2017-07-14 14:19:51 -07:00
Colin Cross c3e7fa65b4 Fix installing prebuilts with no source module
Prebuilts that were not overriding a source module would never
get UsePrebuilt set, which would cause SkipInstall() to be called,
and prevent the module from being exported to make.

Test: prebuilt_test.go
Change-Id: Ib09300efff26f09245331e9919ae2db82b0c3625
2017-03-17 14:06:25 -07:00
Nan Zhang 2502e12ba9 Fixed the issue of dependencyTag in prebuilt.go
Directly using blueprint.BaseDependencyTag might cause issues because
if other modules also use blueprint.BaseDependencyTag, the
different type of modules will be mixed when fetched based on Tag.

Test: m -j out/soong/build.ninja
Change-Id: I290ca2eea063e5daa4f572985b105b958fa1d0fd
2017-03-09 18:50:31 -08:00
Colin Cross a2f296f054 Fall back to prebuilts if source modules are disabled
In lieu of having an environment variable to override prebuilts
preferences (for now), fall back to prebuilts whenever the source
module is disabled.  Complicated source modules (like LLVM) that
already have Go logic can then use an environment variariable to
disable their source module whenever they want to use prebuilts.

Computes UsePrebuilt once using information from both the source
and prebuilt modules, and stores the result in the prebuilt module.

Test: m -j libLLVM
Test: m -j libLLVM FORCE_BUILD_LLVM_COMPONENTS=true
Change-Id: Ib0819a03e9492e55f55de3402e05b3a043644a39
2016-11-30 13:09:45 -08:00
Colin Cross 0f3c72fa17 Disable installing unused prebuilts
If the source module is being used instead of the prebuilt module,
disable installing the prebuilt module.

Test: m -j checkbuild
Change-Id: I55e77021b0f9572b0737d960cba89274f696775d
2016-11-29 15:29:34 -08:00
Colin Cross ce75d2c6a2 Initial prebuilt support
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts.  Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.

Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
2016-10-13 14:52:47 -07:00