blob: 1a57b533137c01b80b483678217117121fcc2510 [file] [log] [blame]
/*
* 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")
task stripArchive(type: Zip) {
dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME]
from zipTree(project.tasks['createArchive'].archivePath)
destinationDir rootProject.buildDir
archiveName "stripped_archive.zip"
include "m2repository/androidx/activity/**",
"m2repository/androidx/annotation/**",
"m2repository/androidx/appcompat/**",
"m2repository/androidx/asynclayoutinflater/**",
"m2repository/androidx/browser/**",
"m2repository/androidx/car/**",
"m2repository/androidx/cardview/**",
"m2repository/androidx/collection/collection/**",
"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/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/recommendation/**",
"m2repository/androidx/recyclerview/**",
"m2repository/androidx/slice/slice-builders/**",
"m2repository/androidx/slice/slice-core/**",
"m2repository/androidx/slice/slice-view/**",
"m2repository/androidx/slidingpanelayout/**",
"m2repository/androidx/swiperefreshlayout/**",
"m2repository/androidx/textclassifier/**",
"m2repository/androidx/transition/**",
"m2repository/androidx/tvprovider/**",
"m2repository/androidx/vectordrawable/**",
"m2repository/androidx/versionedparcelable/**",
"m2repository/androidx/viewpager/**",
"m2repository/androidx/wear/**",
"m2repository/androidx/webkit/**"
}
task dejetifyArchive(type: Exec) {
description "Produces a zip of dejetified artifacts by running Dejetifier against refactored" +
" artifacts, for temporary usage by external clients that haven't upgraded to Jetpack" +
" yet."
dependsOn ':jetifier-standalone:installDist'
dependsOn project.tasks['stripArchive']
inputs.file project.tasks['stripArchive'].archivePath
outputs.file "${BuildServerConfigurationKt.getDistributionDirectory(rootProject).absolutePath}/top-of-tree-m2repository-dejetified-${BuildServerConfigurationKt.getBuildId()}.zip"
commandLine (
"${jetifierBin}",
"-i", "${inputs.files.singleFile}",
"-o", "${outputs.files.singleFile}",
"--log", "warning",
"--reversed",
"--rebuildTopOfTree"
)
}