Yigit Boyar | 88c16ce | 2017-02-08 16:06:14 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | */ |
Yigit Boyar | 88c16ce | 2017-02-08 16:06:14 -0800 | [diff] [blame] | 16 | |
Aurimas Liutikas | 76542da | 2017-06-29 17:00:29 -0700 | [diff] [blame] | 17 | // upload anchor for subprojects to upload their artifacts to the local repo. |
Yigit Boyar | 88c16ce | 2017-02-08 16:06:14 -0800 | [diff] [blame] | 18 | task(mainUpload) |
| 19 | |
Aurimas Liutikas | 76542da | 2017-06-29 17:00:29 -0700 | [diff] [blame] | 20 | task createArchive(type : Zip) { |
Yigit Boyar | 78e026c | 2017-03-06 16:19:15 -0800 | [diff] [blame] | 21 | description "Creates a maven repository that includes just the libraries compiled in this" + |
| 22 | " project, without any history from prebuilts." |
Yigit Boyar | ef30066 | 2017-05-01 11:52:07 -0700 | [diff] [blame] | 23 | from rootProject.ext.artifactoryRepoOut |
Yigit Boyar | 78e026c | 2017-03-06 16:19:15 -0800 | [diff] [blame] | 24 | destinationDir rootProject.ext.distDir |
| 25 | into 'm2repository' |
| 26 | baseName = String.format("top-of-tree-m2repository-%s", project.ext.buildNumber) |
| 27 | dependsOn mainUpload |
| 28 | } |
| 29 | |
Aurimas Liutikas | 76542da | 2017-06-29 17:00:29 -0700 | [diff] [blame] | 30 | // anchor for prepare repo. This is post unzip. |
| 31 | task prepareRepo() { |
Yigit Boyar | 78e026c | 2017-03-06 16:19:15 -0800 | [diff] [blame] | 32 | description "This task clears the repo folder to ensure that we run a fresh build every" + |
| 33 | " time we create arhives. Otherwise, snapshots will accumulate in the builds folder." |
| 34 | doFirst { |
| 35 | rootProject.ext.supportRepoOut.deleteDir() |
| 36 | rootProject.ext.supportRepoOut.mkdirs() |
Yigit Boyar | ef30066 | 2017-05-01 11:52:07 -0700 | [diff] [blame] | 37 | rootProject.ext.artifactoryRepoOut.deleteDir() |
| 38 | rootProject.ext.artifactoryRepoOut.mkdirs() |
Yigit Boyar | 78e026c | 2017-03-06 16:19:15 -0800 | [diff] [blame] | 39 | } |
| 40 | } |