blob: d3d77540a11b59641c6e4d51162b02916f3ea360 [file] [log] [blame]
Yigit Boyar2eb51992016-12-13 15:00:07 -08001/*
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 Liutikasb938b2e2017-07-24 14:47:17 -070016
Sergey Vasilinets22b62142017-11-22 20:32:27 -080017import android.support.DacOptions
Yigit Boyarc62cb532018-02-12 18:09:25 -080018import android.support.license.CheckExternalDependencyLicensesTask
Sergey Vasilinets16385352017-12-13 16:56:47 -080019apply from: "${ext.supportRootFolder}/buildSrc/init.gradle"
20init.setSdkInLocalPropertiesFile()
Yigit Boyar450ed382017-03-02 09:48:25 -080021
Yigit Boyar2eb51992016-12-13 15:00:07 -080022// repository creation task
Yigit Boyar450ed382017-03-02 09:48:25 -080023def buildServerAnchorTask = rootProject.tasks.create(name : "runBuildServerCompilationTasks",
24 description: "Anchor task for everything we want to run in build server.")
25
Sergey Vasilinets16385352017-12-13 16:56:47 -080026repos.addMavenRepositories(repositories)
27init.setupRepoOutAndBuildNumber()
28init.configureSubProjects()
29init.setupRelease()
30// always build offline docs for flatfoot specific builds.
31init.enableDoclavaAndJDiff(this, new DacOptions("android/arch", "ARCH_DATA"))
32rootProject.tasks["generateDocs"].exclude '**/R.java'
Yigit Boyare1bbf712017-03-08 13:52:37 -080033
34// flatfoot docs
35def zipFlatfootDocsTask = rootProject.tasks.create(name : "createFlatfootDocsArchive", type : Zip) {
36 from rootProject.docsDir
37 destinationDir distDir
Yigit Boyard3829822017-08-25 16:53:25 -070038 baseName = "flatfoot-docs"
Yigit Boyare1bbf712017-03-08 13:52:37 -080039}
40
41buildServerAnchorTask.dependsOn zipFlatfootDocsTask
Sergey Vasilinets6398b862017-07-13 17:56:01 -070042zipFlatfootDocsTask.dependsOn rootProject.tasks["generateDocs"]
Yigit Boyara9ac19d2017-09-20 16:11:49 -070043buildServerAnchorTask.dependsOn createDiffArchive
Yigit Boyar450ed382017-03-02 09:48:25 -080044buildServerAnchorTask.dependsOn createArchive
Yigit Boyarc62cb532018-02-12 18:09:25 -080045rootProject.tasks.whenTaskAdded { task ->
46 if (CheckExternalDependencyLicensesTask.ROOT_TASK_NAME.equals(task.name)) {
47 buildServerAnchorTask.dependsOn task
48 }
49}
Yigit Boyar450ed382017-03-02 09:48:25 -080050
Yigit Boyar2eb51992016-12-13 15:00:07 -080051subprojects {
Yigit Boyar54016462017-03-06 17:24:21 -080052 project.tasks.whenTaskAdded { task ->
53 if (task.name.startsWith("assembleAndroidTest")) {
54 buildServerAnchorTask.dependsOn task
55 }
Yigit Boyarfdb1d972017-03-10 16:24:16 -080056 if (task.name.startsWith("assembleDebug")) {
57 buildServerAnchorTask.dependsOn task
58 }
Yigit Boyar54016462017-03-06 17:24:21 -080059 }
Yigit Boyar2eb51992016-12-13 15:00:07 -080060}