| /* |
| * Copyright (C) 2018 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| import androidx.build.BuildServerConfigurationKt |
| import androidx.build.Release |
| def standaloneProject = project(":jetifier-standalone") |
| def jetifierBin = file("${standaloneProject.buildDir}/install/jetifier-standalone/bin/jetifier-standalone") |
| |
| def archivesToDejetify = [ |
| "m2repository/androidx/activity/**", |
| "m2repository/androidx/annotation/**", |
| "m2repository/androidx/appcompat/**", |
| "m2repository/androidx/arch/**", |
| "m2repository/androidx/arch/core/**", |
| "m2repository/androidx/asynclayoutinflater/**", |
| "m2repository/androidx/biometric/**", |
| "m2repository/androidx/browser/**", |
| "m2repository/androidx/car/**", |
| "m2repository/androidx/cardview/**", |
| "m2repository/androidx/collection/collection/**", |
| "m2repository/androidx/contentpager/**", |
| "m2repository/androidx/coordinatorlayout/**", |
| "m2repository/androidx/core/core/**", |
| "m2repository/androidx/cursoradapter/**", |
| "m2repository/androidx/customview/**", |
| "m2repository/androidx/documentfile/**", |
| "m2repository/androidx/drawerlayout/**", |
| "m2repository/androidx/dynamicanimation/**", |
| "m2repository/androidx/emoji/**", |
| "m2repository/androidx/exifinterface/**", |
| "m2repository/androidx/fragment/fragment/**", |
| "m2repository/androidx/gridlayout/**", |
| "m2repository/androidx/heifwriter/**", |
| "m2repository/androidx/interpolator/**", |
| "m2repository/androidx/leanback/**", |
| "m2repository/androidx/legacy/**", |
| "m2repository/androidx/lifecycle/**", |
| "m2repository/androidx/loader/**", |
| "m2repository/androidx/localbroadcastmanager/**", |
| "m2repository/androidx/media/media/**", |
| "m2repository/androidx/mediarouter/**", |
| "m2repository/androidx/palette/palette/**", |
| "m2repository/androidx/percentlayout/**", |
| "m2repository/androidx/preference/preference/**", |
| "m2repository/androidx/print/**", |
| "m2repository/androidx/paging/**", |
| "m2repository/androidx/room/**", |
| "m2repository/androidx/recommendation/**", |
| "m2repository/androidx/recyclerview/**", |
| "m2repository/androidx/remotecallback/**", |
| "m2repository/androidx/savedstate/**", |
| "m2repository/androidx/slice/slice-builders/**", |
| "m2repository/androidx/slice/slice-core/**", |
| "m2repository/androidx/slice/slice-view/**", |
| "m2repository/androidx/slidingpanelayout/**", |
| "m2repository/androidx/swiperefreshlayout/**", |
| "m2repository/androidx/sqlite/**", |
| "m2repository/androidx/textclassifier/**", |
| "m2repository/androidx/transition/**", |
| "m2repository/androidx/tvprovider/**", |
| "m2repository/androidx/vectordrawable/**", |
| "m2repository/androidx/versionedparcelable/**", |
| "m2repository/androidx/viewpager/**", |
| "m2repository/androidx/viewpager2/**", |
| "m2repository/androidx/wear/**", |
| "m2repository/androidx/media2/**", |
| "m2repository/androidx/concurrent/**", |
| "m2repository/androidx/sharetarget/**" |
| ] |
| |
| task stripArchiveForPartialDejetification(type: Zip) { |
| dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME] |
| from zipTree(project.tasks['createArchive'].archivePath) |
| destinationDir rootProject.buildDir |
| archiveName "stripped_archive_partial.zip" |
| include archivesToDejetify |
| doLast { |
| if (archivePath.exists()) { |
| project.logger.info("stripArchiveForPartialDejetification sees that " + archivePath + " exists") |
| } else { |
| throw new Exception("stripArchiveForPartialDejetification sees that " + archivePath + " does not exist!?") |
| } |
| } |
| } |
| |
| task partiallyDejetifyArchive(type: Exec) { |
| description "Produces a zip of partially dejetified artifacts by running Dejetifier against refactored" + |
| " artifacts, for temporary migration purposes." |
| |
| dependsOn ':jetifier-standalone:installDist' |
| dependsOn project.tasks['stripArchiveForPartialDejetification'] |
| inputs.file project.tasks['stripArchiveForPartialDejetification'].archivePath |
| |
| outputs.file "${BuildServerConfigurationKt.getDistributionDirectory(rootProject).absolutePath}/top-of-tree-m2repository-partially-dejetified-${BuildServerConfigurationKt.getBuildId()}.zip" |
| |
| commandLine ( |
| "${jetifierBin}", |
| "-i", "${inputs.files.singleFile}", |
| "-o", "${outputs.files.singleFile}", |
| "-c", "${standaloneProject.projectDir.getParentFile()}/migration.config", |
| "--log", "warning", |
| "--reversed", |
| "--rebuildTopOfTree" |
| ) |
| } |