| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | cda5499 | 2018-06-23 08:42:25 -0700 | [diff] [blame] | 16 | import androidx.build.Release |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 17 | def standaloneProject = project(":jetifier-standalone") |
| 18 | def jetifierBin = file("${standaloneProject.buildDir}/install/jetifier-standalone/bin/jetifier-standalone") |
| 19 | |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 20 | task stripArchive(type: Zip) { |
| Yigit Boyar | cda5499 | 2018-06-23 08:42:25 -0700 | [diff] [blame] | 21 | dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME] |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 22 | from zipTree(project.tasks['createArchive'].archivePath) |
| 23 | destinationDir rootProject.buildDir |
| 24 | archiveName "stripped_archive.zip" |
| 25 | include "m2repository/androidx/annotation/**", |
| 26 | "m2repository/androidx/appcompat/**", |
| 27 | "m2repository/androidx/asynclayoutinflater/**", |
| 28 | "m2repository/androidx/browser/**", |
| 29 | "m2repository/androidx/car/**", |
| 30 | "m2repository/androidx/cardview/**", |
| Aurimas Liutikas | bed97c4 | 2018-05-02 14:58:10 -0700 | [diff] [blame] | 31 | "m2repository/androidx/collection/collection/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 32 | "m2repository/androidx/coordinatorlayout/**", |
| Aurimas Liutikas | bed97c4 | 2018-05-02 14:58:10 -0700 | [diff] [blame] | 33 | "m2repository/androidx/core/core/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 34 | "m2repository/androidx/cursoradapter/**", |
| 35 | "m2repository/androidx/customview/**", |
| 36 | "m2repository/androidx/documentfile/**", |
| 37 | "m2repository/androidx/drawerlayout/**", |
| 38 | "m2repository/androidx/dynamicanimation/**", |
| 39 | "m2repository/androidx/emoji/**", |
| 40 | "m2repository/androidx/exifinterface/**", |
| Aurimas Liutikas | bed97c4 | 2018-05-02 14:58:10 -0700 | [diff] [blame] | 41 | "m2repository/androidx/fragment/fragment/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 42 | "m2repository/androidx/gridlayout/**", |
| 43 | "m2repository/androidx/heifwriter/**", |
| 44 | "m2repository/androidx/interpolator/**", |
| 45 | "m2repository/androidx/leanback/**", |
| 46 | "m2repository/androidx/legacy/**", |
| 47 | "m2repository/androidx/loader/**", |
| 48 | "m2repository/androidx/localbroadcastmanager/**", |
| Filip Pavlis | 6ff06f2 | 2018-05-29 18:53:08 +0100 | [diff] [blame] | 49 | "m2repository/androidx/media/media/**", |
| Alan Viverette | 838f78f | 2018-06-28 16:31:31 -0400 | [diff] [blame] | 50 | "m2repository/androidx/media2/media2/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 51 | "m2repository/androidx/mediarouter/**", |
| Aurimas Liutikas | bed97c4 | 2018-05-02 14:58:10 -0700 | [diff] [blame] | 52 | "m2repository/androidx/palette/palette/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 53 | "m2repository/androidx/percentlayout/**", |
| 54 | "m2repository/androidx/preference/**", |
| 55 | "m2repository/androidx/print/**", |
| 56 | "m2repository/androidx/recommendation/**", |
| 57 | "m2repository/androidx/recyclerview/**", |
| 58 | "m2repository/androidx/slice/**", |
| 59 | "m2repository/androidx/slidingpanelayout/**", |
| 60 | "m2repository/androidx/swiperefreshlayout/**", |
| 61 | "m2repository/androidx/transition/**", |
| 62 | "m2repository/androidx/tvprovider/**", |
| 63 | "m2repository/androidx/vectordrawable/**", |
| Jason Monk | 8de1fa3 | 2018-05-23 14:28:45 -0400 | [diff] [blame] | 64 | "m2repository/androidx/versionedparcelable/**", |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 65 | "m2repository/androidx/viewpager/**", |
| 66 | "m2repository/androidx/wear/**", |
| 67 | "m2repository/androidx/webkit/**" |
| 68 | } |
| 69 | |
| Filip Pavlis | 49f7010 | 2018-02-23 20:28:47 +0000 | [diff] [blame] | 70 | task dejetifyArchive(type: Exec) { |
| 71 | description "Produces a zip of dejetified artifacts by running Dejetifier against refactored" + |
| 72 | " artifacts, for temporary usage by external clients that haven't upgraded to Jetpack" + |
| 73 | " yet." |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 74 | |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 75 | dependsOn ':jetifier-standalone:installDist' |
| Aurimas Liutikas | 56d68fb | 2018-05-01 16:47:34 -0700 | [diff] [blame] | 76 | dependsOn project.tasks['stripArchive'] |
| 77 | inputs.file project.tasks['stripArchive'].archivePath |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 78 | |
| Jeff Gaston | 9e200ea | 2018-03-28 13:02:29 -0400 | [diff] [blame] | 79 | outputs.file "${rootProject.ext.distDir}/top-of-tree-m2repository-dejetified-${project.ext.buildNumber}.zip" |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 80 | |
| Filip Pavlis | 5b12e59 | 2018-05-23 13:28:51 +0100 | [diff] [blame] | 81 | commandLine ( |
| 82 | "${jetifierBin}", |
| 83 | "-i", "${inputs.files.singleFile}", |
| 84 | "-o", "${outputs.files.singleFile}", |
| 85 | "--versions", "inDev", |
| 86 | "--log", "warning", |
| 87 | "--reversed", |
| 88 | "--rebuildTopOfTree" |
| 89 | ) |
| Jeff Gaston | 5d480f8 | 2018-01-29 11:41:32 -0500 | [diff] [blame] | 90 | } |