1a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam/**
2a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam * This self.gradle build file is only run when built in ub-setupwizard-* branches.
3a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam */
4a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam
5a211294e1caba648822d11f8935593b6ca2b9279Maurice Lamapply plugin: 'dist'
6a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam
7a211294e1caba648822d11f8935593b6ca2b9279Maurice Lamapply from: 'build.gradle'
8a211294e1caba648822d11f8935593b6ca2b9279Maurice Lamapply from: '../tools/gradle/docs.gradle'
9a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam
103885d8491a008281d18ddbbabc5b8e26848fadccMaurice Lamtask docs(dependsOn: 'javadocFullSupportRelease')
11a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam
123fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lamandroid.lintOptions {
133fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam    abortOnError true
14e23a451a802972ad3bf8c2cf3803f222f3c6ac51Maurice Lam    htmlReport true
15e23a451a802972ad3bf8c2cf3803f222f3c6ac51Maurice Lam    textOutput 'stderr'
16e23a451a802972ad3bf8c2cf3803f222f3c6ac51Maurice Lam    textReport true
17e23a451a802972ad3bf8c2cf3803f222f3c6ac51Maurice Lam    xmlReport false
183fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam}
193fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam
203fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam// Run lint for all variants
213fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lamandroid.libraryVariants.all { variant ->
223fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam    variant.assemble.dependsOn(tasks.findByName('lint'))
233fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam}
243fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lam
25a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam// Output all test APKs to the distribution folder
263fa6e08ea0e8b2a9deff3096893cfa49761e2ac7Maurice Lamdef distTask = tasks.findByName('dist')
27a211294e1caba648822d11f8935593b6ca2b9279Maurice Lamif (distTask) {
28a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam    android.testVariants.all { variant ->
29a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam        // Make the dist task depend on the test variant, so the test APK will be built
30a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam        distTask.dependsOn variant.assemble
31a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam        // TODO: remap the different test variants to different file names
32a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam    }
33a211294e1caba648822d11f8935593b6ca2b9279Maurice Lam}
34