Coder Social home page Coder Social logo

john-y-pazekha / can-i-drop-jetifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plnice/can-i-drop-jetifier

0.0 0.0 0.0 202 KB

Gradle plugin that checks if there are dependencies using support library instead of AndroidX.

License: Apache License 2.0

Kotlin 100.00%

can-i-drop-jetifier's Introduction

Can I drop Jetifier?

Checks whether there are any dependencies using support library instead of AndroidX artifacts.

If you migrated to AndroidX, you probably have the Jetifier tool enabled that converts dependencies that still depend on old artifacts to operate on AndroidX classes. Since more and more libraries are migrated to AndroidX, at some point there will be no need to have this tool enabled. This plugin can be used to identify which of the libraries you are using need to be migrated to AndroidX or bumped if the new version is already there.

Setup

Build script snippet for plugins DSL for Gradle 2.1 and later:

plugins {
  id "com.github.plnice.canidropjetifier" version "0.5"
}

Build script snippet for use in older Gradle versions or where dynamic configuration is required:

buildscript {
  repositories {
    gradlePluginPortal()
  }
  dependencies {
    classpath "com.github.plnice:canidropjetifier:0.5"
  }
}

apply plugin: "com.github.plnice.canidropjetifier"

For multi-module projects, you can apply the plugin in the top-level build.gradle file. It will analyze all the modules found in the project.

Usage

The Jetifier tool must be temporarily disabled to make this plugin work correctly. It can be done when calling the plugin's task:

./gradlew -Pandroid.enableJetifier=false canIDropJetifier

Example output:

========================================
Project sample
========================================

Cannot drop Jetifier due to following module dependencies:

* sample-dependency (module)
  \-- com.android.support:cardview-v7:28.0.0
  \-- com.squareup.leakcanary:leakcanary-android:1.6.3
   \-- com.android.support:support-core-utils:26.0.0
  \-- com.squareup.leakcanary:leakcanary-android:1.6.3
   \-- com.squareup.leakcanary:leakcanary-analyzer:1.6.3
    \-- com.android.support:support-annotations:28.0.0

Cannot drop Jetifier due to following external dependencies:

* com.android.support:cardview-v7:28.0.0

* com.squareup.leakcanary:leakcanary-android:1.6.3
  \-- com.squareup.leakcanary:leakcanary-analyzer:1.6.3
   \-- com.android.support:support-annotations:28.0.0
  \-- com.android.support:support-core-utils:26.0.0

Configuration

canIDropJetifier {
  verbose = true // Default: false, set to true to print the dependencies tree down to the old artifact
  includeModules = false // Default: true, print out not only external (library) dependencies, but also module dependencies that use old artifacts
  analyzeOnlyAndroidModules = false // Default: true, analyze only modules that use com.android.application or com.android.library plugins
  configurationRegex = ".*RuntimeClasspath" // Performance optimization: checks only configurations that match provided regex
  parallelMode = true // Default: false, experimental: run analysis of modules in parallel
  parallelModePoolSize = 4 // Default: max available processors - 1, experimental: pool size for analysis in parallel
}

License

Copyright 2019 Miłosz Lewandowski

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.

can-i-drop-jetifier's People

Contributors

johnjohndoe avatar plnice avatar vanniktech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.