Introduce AndroidTest and UnitTest interfaces.

This change rework the inheritance hierarchy. In order
to reduce confusion, Variant is now the base only
for the actual build output (apk, aar). Variants
are components and tests are components too.

The new tree looks like this:
- Component
   - Variant
      - ApplicationVariant
      - LibraryVariant
      - ....
   - UnitTest
   - AndroidTest

The Properties tree looks the same.

This means the onVariants API only acts on
variants but not components. We will introduce
later a onComponents that requires Type filtering,
but onVariants can be specialized in each Extension
to default to the actual Variant that most users
will want to touch.
To offset the lack of tests in onVariants we give
access to them via the variant:

onVariants().withName("foo") {
    onProperties {
      // variant props here
    }
    unitTest {
        enabled = false
        onProperties {
          // test props here
        }
    }

    androidTest {
        enabled = false
    }
}

Because the root type is now Component[Properties],
this change also renames some classes for *Variant*
to *Component*

Bug: N/A
Test: existing tests
Change-Id: Ie56cf03779b414a8d869d0db9a3268c54268a522
127 files changed
tree: 9bd39685ba4f4c03dc6e539d44b1d110b515e6e5
  1. .idea/
  2. annotations/
  3. apkparser/
  4. app-inspection/
  5. apps/
  6. aspects_agent/
  7. bazel/
  8. build-system/
  9. chunkio/
  10. chunkio-processor/
  11. common/
  12. ddmlib/
  13. debug/
  14. deploy/
  15. device_validator/
  16. draw9patch/
  17. dynamic-layout-inspector/
  18. echo-sample/
  19. experimental/
  20. external-annotations/
  21. fakeadbserver/
  22. fakeandroid/
  23. files/
  24. flags/
  25. jaxb-inheritance-plugin/
  26. jobb/
  27. layoutinspector/
  28. layoutlib-api/
  29. legacy/
  30. lint/
  31. misc/
  32. ninepatch/
  33. perf-logger/
  34. perflib/
  35. pixelprobe/
  36. profiler/
  37. repository/
  38. sdk-common/
  39. sdklib/
  40. signflinger/
  41. templates/
  42. testing-infrastructure/
  43. testutils/
  44. third_party/
  45. tracer/
  46. transport/
  47. usb-devices/
  48. vector-drawable-tool/
  49. wizard/
  50. zipflinger/
  51. .gitignore
  52. adt.iml
  53. BUILD.bazel
  54. build.gradle
  55. changes.txt
  56. contributing.md
  57. navbar.md
  58. PREUPLOAD.cfg
  59. README.md
  60. source.md
  61. studio.md
README.md

tools/base

This project contains:

  • Common libraries that are shared between any of the IDE (Android Studio), the build system (The Android Gradle Plugin) and SDK components that will be released from studio-master-dev (e.g. the standalone SDK manager). This includes:
    • Instant-run-libraries
    • SDK management libraries
    • The manifest merger
    • Common libraries
    • Common test utilites
  • The build system
  • The new profiler