blob: d52a24734b2d2e2dcc43480de19b26ef11465339 [file] [log] [blame]
Jeff Gaston5d480f82018-01-29 11:41:32 -05001/*
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 Boyarcda54992018-06-23 08:42:25 -070016import androidx.build.Release
Jeff Gaston5d480f82018-01-29 11:41:32 -050017def standaloneProject = project(":jetifier-standalone")
18def jetifierBin = file("${standaloneProject.buildDir}/install/jetifier-standalone/bin/jetifier-standalone")
19
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070020task stripArchive(type: Zip) {
Yigit Boyarcda54992018-06-23 08:42:25 -070021 dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME]
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070022 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 Liutikasbed97c42018-05-02 14:58:10 -070031 "m2repository/androidx/collection/collection/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070032 "m2repository/androidx/coordinatorlayout/**",
Aurimas Liutikasbed97c42018-05-02 14:58:10 -070033 "m2repository/androidx/core/core/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070034 "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 Liutikasbed97c42018-05-02 14:58:10 -070041 "m2repository/androidx/fragment/fragment/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070042 "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 Pavlis6ff06f22018-05-29 18:53:08 +010049 "m2repository/androidx/media/media/**",
Alan Viverette838f78f2018-06-28 16:31:31 -040050 "m2repository/androidx/media2/media2/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070051 "m2repository/androidx/mediarouter/**",
Aurimas Liutikasbed97c42018-05-02 14:58:10 -070052 "m2repository/androidx/palette/palette/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070053 "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 Monk8de1fa32018-05-23 14:28:45 -040064 "m2repository/androidx/versionedparcelable/**",
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070065 "m2repository/androidx/viewpager/**",
66 "m2repository/androidx/wear/**",
67 "m2repository/androidx/webkit/**"
68}
69
Filip Pavlis49f70102018-02-23 20:28:47 +000070task 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 Gaston5d480f82018-01-29 11:41:32 -050074
Jeff Gaston5d480f82018-01-29 11:41:32 -050075 dependsOn ':jetifier-standalone:installDist'
Aurimas Liutikas56d68fb2018-05-01 16:47:34 -070076 dependsOn project.tasks['stripArchive']
77 inputs.file project.tasks['stripArchive'].archivePath
Jeff Gaston5d480f82018-01-29 11:41:32 -050078
Jeff Gaston9e200ea2018-03-28 13:02:29 -040079 outputs.file "${rootProject.ext.distDir}/top-of-tree-m2repository-dejetified-${project.ext.buildNumber}.zip"
Jeff Gaston5d480f82018-01-29 11:41:32 -050080
Filip Pavlis5b12e592018-05-23 13:28:51 +010081 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 Gaston5d480f82018-01-29 11:41:32 -050090}