Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Aurimas Liutikas | b938b2e | 2017-07-24 14:47:17 -0700 | [diff] [blame] | 16 | |
Sergey Vasilinets | 22b6214 | 2017-11-22 20:32:27 -0800 | [diff] [blame] | 17 | import android.support.DacOptions |
Yigit Boyar | c62cb53 | 2018-02-12 18:09:25 -0800 | [diff] [blame] | 18 | import android.support.license.CheckExternalDependencyLicensesTask |
Sergey Vasilinets | 1638535 | 2017-12-13 16:56:47 -0800 | [diff] [blame] | 19 | apply from: "${ext.supportRootFolder}/buildSrc/init.gradle" |
| 20 | init.setSdkInLocalPropertiesFile() |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 21 | |
Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 22 | // repository creation task |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 23 | def buildServerAnchorTask = rootProject.tasks.create(name : "runBuildServerCompilationTasks", |
| 24 | description: "Anchor task for everything we want to run in build server.") |
| 25 | |
Sergey Vasilinets | 1638535 | 2017-12-13 16:56:47 -0800 | [diff] [blame] | 26 | repos.addMavenRepositories(repositories) |
| 27 | init.setupRepoOutAndBuildNumber() |
| 28 | init.configureSubProjects() |
| 29 | init.setupRelease() |
| 30 | // always build offline docs for flatfoot specific builds. |
| 31 | init.enableDoclavaAndJDiff(this, new DacOptions("android/arch", "ARCH_DATA")) |
| 32 | rootProject.tasks["generateDocs"].exclude '**/R.java' |
Yigit Boyar | e1bbf71 | 2017-03-08 13:52:37 -0800 | [diff] [blame] | 33 | |
| 34 | // flatfoot docs |
| 35 | def zipFlatfootDocsTask = rootProject.tasks.create(name : "createFlatfootDocsArchive", type : Zip) { |
| 36 | from rootProject.docsDir |
| 37 | destinationDir distDir |
Yigit Boyar | d382982 | 2017-08-25 16:53:25 -0700 | [diff] [blame] | 38 | baseName = "flatfoot-docs" |
Yigit Boyar | e1bbf71 | 2017-03-08 13:52:37 -0800 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | buildServerAnchorTask.dependsOn zipFlatfootDocsTask |
Sergey Vasilinets | 6398b86 | 2017-07-13 17:56:01 -0700 | [diff] [blame] | 42 | zipFlatfootDocsTask.dependsOn rootProject.tasks["generateDocs"] |
Yigit Boyar | a9ac19d | 2017-09-20 16:11:49 -0700 | [diff] [blame] | 43 | buildServerAnchorTask.dependsOn createDiffArchive |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 44 | buildServerAnchorTask.dependsOn createArchive |
Yigit Boyar | c62cb53 | 2018-02-12 18:09:25 -0800 | [diff] [blame] | 45 | rootProject.tasks.whenTaskAdded { task -> |
| 46 | if (CheckExternalDependencyLicensesTask.ROOT_TASK_NAME.equals(task.name)) { |
| 47 | buildServerAnchorTask.dependsOn task |
| 48 | } |
| 49 | } |
Yigit Boyar | 450ed38 | 2017-03-02 09:48:25 -0800 | [diff] [blame] | 50 | |
Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 51 | subprojects { |
Yigit Boyar | 5401646 | 2017-03-06 17:24:21 -0800 | [diff] [blame] | 52 | project.tasks.whenTaskAdded { task -> |
| 53 | if (task.name.startsWith("assembleAndroidTest")) { |
| 54 | buildServerAnchorTask.dependsOn task |
| 55 | } |
Yigit Boyar | fdb1d97 | 2017-03-10 16:24:16 -0800 | [diff] [blame] | 56 | if (task.name.startsWith("assembleDebug")) { |
| 57 | buildServerAnchorTask.dependsOn task |
| 58 | } |
Yigit Boyar | 5401646 | 2017-03-06 17:24:21 -0800 | [diff] [blame] | 59 | } |
Yigit Boyar | 2eb5199 | 2016-12-13 15:00:07 -0800 | [diff] [blame] | 60 | } |