| /* |
| * Copyright (C) 2016 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| import android.support.DacOptions |
| import android.support.license.CheckExternalDependencyLicensesTask |
| apply from: "${ext.supportRootFolder}/buildSrc/init.gradle" |
| init.setSdkInLocalPropertiesFile() |
| |
| // repository creation task |
| def buildServerAnchorTask = rootProject.tasks.create(name : "runBuildServerCompilationTasks", |
| description: "Anchor task for everything we want to run in build server.") |
| |
| repos.addMavenRepositories(repositories) |
| init.setupRepoOutAndBuildNumber() |
| init.configureSubProjects() |
| init.setupRelease() |
| // always build offline docs for flatfoot specific builds. |
| init.enableDoclavaAndJDiff(this, new DacOptions("android/arch", "ARCH_DATA")) |
| rootProject.tasks["generateDocs"].exclude '**/R.java' |
| |
| // flatfoot docs |
| def zipFlatfootDocsTask = rootProject.tasks.create(name : "createFlatfootDocsArchive", type : Zip) { |
| from rootProject.docsDir |
| destinationDir distDir |
| baseName = "flatfoot-docs" |
| } |
| |
| buildServerAnchorTask.dependsOn zipFlatfootDocsTask |
| zipFlatfootDocsTask.dependsOn rootProject.tasks["generateDocs"] |
| buildServerAnchorTask.dependsOn createDiffArchive |
| buildServerAnchorTask.dependsOn createArchive |
| rootProject.tasks.whenTaskAdded { task -> |
| if (CheckExternalDependencyLicensesTask.ROOT_TASK_NAME.equals(task.name)) { |
| buildServerAnchorTask.dependsOn task |
| } |
| } |
| |
| subprojects { |
| project.tasks.whenTaskAdded { task -> |
| if (task.name.startsWith("assembleAndroidTest")) { |
| buildServerAnchorTask.dependsOn task |
| } |
| if (task.name.startsWith("assembleDebug")) { |
| buildServerAnchorTask.dependsOn task |
| } |
| } |
| } |