SetupWizardLibrary/library/build.gradle
Maurice Lam c16490a96e [SetupWizardLib] Make dist task depend on tests
Build the debug test APKs when building, which will then show up on
the build servers as setup-wizard-libTests.apk

Change-Id: I37b56fb456d61b4e878fe98b410eada1f5ac70b8
2015-06-29 11:55:08 -07:00

45 lines
1.6 KiB
Groovy

/**
* Build the file with local dependencies. This is typically the build file you want to use when
* building from the Android source tree. The difference between this and standalone.gradle is that
* this will build the dependencies like support libraries from source, whereas standalone.gradle
* will get it from maven central.
*
* For example, you can include the following in your settings.gradle file:
* include ':setup-wizard-lib'
* project(':setup-wizard-lib').projectDir = new File(PATH_TO_THIS_DIRECTORY)
*
* And then you can include the :setup-wizard-lib project as one of your dependencies
* dependencies {
* compile project(path: ':setup-wizard-lib', configuration: 'icsCompatRelease')
* }
*/
apply plugin: 'dist'
ext {
// For builds in the Android tree we want to build the dependencies from source for reproducible
// builds. To add a dependency, you want to specify something like this:
// ext {
// deps = ['project-name': project(':project-path')]
// }
//
// And then in rules.gradle you can reference the dependency by
// dependencies {
// compile deps['project-name']
// }
//
deps = ['support-appcompat-v7': project(':support-appcompat-v7')]
}
apply from: 'rules.gradle'
// Output all test APKs to the distribution folder
def distTask = tasks.findByName('dist');
if (distTask) {
android.testVariants.all { variant ->
// Make the dist task depend on the test variant, so the test APK will be built
distTask.dependsOn variant.assemble
// TODO: remap the different test variants to different file names
}
}