[go: nahoru, domu]

Initial com.android.test module support in AndroidX plugin

Bug: 188699825
Test: ./gradlew benchmark:integ-tests:test-module-sample:cC

Add support for com.android.test modules in AndroidX plugin, which are
supported by AGP for the macrobenchmark usecase. This module structure
will allow us to depend on an existing app module, and mirror usage in
macrobenchmark docs and samples.

The implementation is based on Library module support, but with the
following features removed:

* Version/dependency controls
* Api tracking
* Publishing functionality
* Metadata packaging and related controls
* Library metrics
* Lint (there is no `:lint` task for test modules)

This CL contains a trivial sample test module, which builds and runs
successfully locally, and validates presence of the target apk. We can
validate using this sample before migrating macrobenchmarks to the new
structure.

To see intended macrobenchmark gradle structure, see docs:
https://developer.android.com/studio/profile/macrobenchmark#configuration

Change-Id: If57634fb0de22c5bfaab9eaa20afccd425ef76cb
diff --git a/settings.gradle b/settings.gradle
index 0ab046f..ae450ff 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -215,6 +215,7 @@
 includeProject(":benchmark:integration-tests:dry-run-benchmark", "benchmark/integration-tests/dry-run-benchmark", [BuildType.MAIN])
 includeProject(":benchmark:integration-tests:macrobenchmark", "benchmark/integration-tests/macrobenchmark", [BuildType.MAIN, BuildType.COMPOSE])
 includeProject(":benchmark:integration-tests:macrobenchmark-target", "benchmark/integration-tests/macrobenchmark-target", [BuildType.MAIN, BuildType.COMPOSE])
+includeProject(":benchmark:integration-tests:test-module-sample", "benchmark/integration-tests/test-module-sample", [BuildType.MAIN, BuildType.COMPOSE])
 includeProject(":benchmark:integration-tests:startup-benchmark", "benchmark/integration-tests/startup-benchmark", [BuildType.MAIN])
 includeProject(":biometric:biometric", "biometric/biometric", [BuildType.MAIN])
 includeProject(":biometric:biometric-ktx", "biometric/biometric-ktx", [BuildType.MAIN])