blob: d9a02664b89c77f7a438ac53dfb7a595bfcc2dbd [file] [log] [blame]
Yigit Boyar88c16ce2017-02-08 16:06:14 -08001/*
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 Boyar88c16ce2017-02-08 16:06:14 -080016
Aurimas Liutikas76542da2017-06-29 17:00:29 -070017// upload anchor for subprojects to upload their artifacts to the local repo.
Yigit Boyar88c16ce2017-02-08 16:06:14 -080018task(mainUpload)
19
Aurimas Liutikas76542da2017-06-29 17:00:29 -070020task createArchive(type : Zip) {
Yigit Boyar78e026c2017-03-06 16:19:15 -080021 description "Creates a maven repository that includes just the libraries compiled in this" +
22 " project, without any history from prebuilts."
Yigit Boyaref300662017-05-01 11:52:07 -070023 from rootProject.ext.artifactoryRepoOut
Yigit Boyar78e026c2017-03-06 16:19:15 -080024 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 Liutikas76542da2017-06-29 17:00:29 -070030// anchor for prepare repo. This is post unzip.
31task prepareRepo() {
Yigit Boyar78e026c2017-03-06 16:19:15 -080032 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 Boyaref300662017-05-01 11:52:07 -070037 rootProject.ext.artifactoryRepoOut.deleteDir()
38 rootProject.ext.artifactoryRepoOut.mkdirs()
Yigit Boyar78e026c2017-03-06 16:19:15 -080039 }
40}