All Projects → dipien → bye-bye-jetifier

dipien / bye-bye-jetifier

Licence: Apache-2.0 license
Gradle Plugin to verify if you can keep Android Jetifier disabled

Programming Languages

kotlin
9241 projects
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to bye-bye-jetifier

RePluginX
🔥 Supports AndroidX and Android-Support
Stars: ✭ 32 (-81.5%)
Mutual labels:  android-support, androidx
recast
🦸‍♂️ Recast migrates your old extensions to AndroidX, making them compatible with the latest version of Kodular.
Stars: ✭ 13 (-92.49%)
Mutual labels:  androidx, jetifier
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (-38.15%)
Mutual labels:  gradle-plugin
licenser
A simple license header manager for Gradle
Stars: ✭ 32 (-81.5%)
Mutual labels:  gradle-plugin
RapidMavenPushPlugin
A Gradle plugin : Upload Artifacts to Multi Maven Repository
Stars: ✭ 21 (-87.86%)
Mutual labels:  gradle-plugin
gradle-scalafmt
Gradle plugin for scalafmt
Stars: ✭ 25 (-85.55%)
Mutual labels:  gradle-plugin
Biometric-Authentication-Android
A sample implementation of AndroidX biometrics API using Kotlin. Authenticate using biometrics or PIN/Password if biometrics isn't available on device. Fully implemented in Jetpack compose using Material 3 dynamic theming and also has a separate implementation in xml with MDC 3.
Stars: ✭ 29 (-83.24%)
Mutual labels:  androidx
graphql-java-codegen-gradle-plugin
Gradle plugin for graphql-java-codegen
Stars: ✭ 19 (-89.02%)
Mutual labels:  gradle-plugin
gradle-marytts-voicebuilding-plugin
A replacement for the legacy VoiceImportTools in MaryTTS
Stars: ✭ 14 (-91.91%)
Mutual labels:  gradle-plugin
webdriver-binaries-gradle-plugin
A Gradle plugin that downloads and caches WebDriver binaries specific to the OS the build runs on
Stars: ✭ 31 (-82.08%)
Mutual labels:  gradle-plugin
xmake-gradle
A gradle plugin that integrates xmake seamlessly
Stars: ✭ 31 (-82.08%)
Mutual labels:  gradle-plugin
npm-publish
Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
Stars: ✭ 66 (-61.85%)
Mutual labels:  gradle-plugin
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (-68.79%)
Mutual labels:  gradle-plugin
gretty
Advanced gradle plugin for running web-apps on jetty and tomcat.
Stars: ✭ 116 (-32.95%)
Mutual labels:  gradle-plugin
aotc-gradle-plugin
Ahead-of-Time Compilation in Gradle projects.
Stars: ✭ 17 (-90.17%)
Mutual labels:  gradle-plugin
gradle-http-plugin
Gradle plugin providing support for using HttpBuilder-NG to make HTTP requests as Gradle Tasks.
Stars: ✭ 30 (-82.66%)
Mutual labels:  gradle-plugin
Melon
UNES, o aplicativo que cria notificações para as ações do Portal Sagres.
Stars: ✭ 41 (-76.3%)
Mutual labels:  androidx
scalatest-junit-runner
JUnit 5 runner for Scalatest
Stars: ✭ 30 (-82.66%)
Mutual labels:  gradle-plugin
hat-view
Allow to put "hat" on TextView. Inspired by Telegram appbar title with Santa Claus hat 🎅🏻
Stars: ✭ 51 (-70.52%)
Mutual labels:  androidx
gradle-versioner
Gradle Version Plugin. Generates semantic versions with git meta data per branch.
Stars: ✭ 25 (-85.55%)
Mutual labels:  gradle-plugin

Dipien

Bye Bye Jetifier Gradle Plugin

Gradle Plugin to verify if you can keep Android Jetifier disabled

You can read more details about this plugin on this article.

Features

This plugin verifies on each dependency JAR/AAR (and its transitives) if:

  • any class is using a support library import
  • any layout is referencing a support library class
  • the Android Manifest is referencing a support library class

It also verifies if any support library dependency is resolved on the project.

Why should I use this plugin instead of can-i-drop-jetifier?

The can-i-drop-jetifier plugin only checks for legacy support libraries on the dependencies graph. That's not enough to decide if you can drop Jetifier. Lots of libraries don't properly declare on their POMs the legacy support libraries they use as transitive dependencies. So, for those cases, can-i-drop-jetifier says that you can disable Jetifier. But, if you do that, then you are going to have runtime errors when the logic using the legacy support library is executed.

Bye bye Jetifier inspects each JAR/AAR, searching for legacy support libraries usages, so it will find more libraries than can-i-drop-jetifier, and you will avoid those runtime errors.

Setup

Add the following configuration to your root build.gradle, replacing X.Y.Z with the latest version

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("com.dipien:bye-bye-jetifier:X.Y.Z")
    }
}

apply plugin: "com.dipien.byebyejetifier"

Usage

To validate if your project dependencies (and its transitives) have any usage of the legacy android support library, you need to execute the following task:

./gradlew canISayByeByeJetifier -Pandroid.enableJetifier=false

If you have any legacy android support library usage, the task will fail and print a report with all the details. For example:

========================================
Project: app
========================================

Scanning com.squareup.rx.idler:rx2-idler:0.9.1
 Absolute path: ~/.gradle/caches/modules-2/files-2.1/com.squareup.rx.idler/rx2-idler/0.9.1/378e25e3c2f/rx2-idler-0.9.1.aar
 Graphs to this dependency:
 +---com.squareup.rx.idler:rx2-idler:0.9.1
 Issues found:
 * com/squareup/rx2/idler/DelegatingIdlingResourceScheduler.class -> android/support/test/espresso/IdlingResource$ResourceCallback
 * com/squareup/rx2/idler/DelegatingIdlingResourceScheduler.class -> android/support/test/espresso/IdlingResource
 * com/squareup/rx2/idler/IdlingResourceScheduler.class -> android/support/test/espresso/IdlingResource
 * com/squareup/rx2/idler/Rx2Idler$1.class -> android/support/test/espresso/IdlingResource
 * com/squareup/rx2/idler/Rx2Idler$1.class -> android/support/test/espresso/Espresso
 * pom -> com.android.support.test.espresso:espresso-core:2.2.2
 * pom -> com.android.support:support-annotations:25.4.0

Explicit declarations of legacy support dependencies on this project:
 * android.arch.core:common:1.1.1
 * android.arch.lifecycle:common:1.1.0

> Task :canISayByeByeJetifier FAILED

If you don't have any legacy android support library usages, the task will finish successfully, so it's safe to remove the android.enableJetifier flag from your gradle.properties.

Once you have disabled jetifier, you don't want to add a new support-library-dependent library by mistake when adding/upgrading a dependency on your project. To avoid that kind of issues, you can run the canISayByeByeJetifier task on your CI tool as part of the PR checks.

Advanced configuration

You can configure the plugin using the byeByeJetifier extension. These are the default values for each property:

byeByeJetifier {
    legacyGroupIdPrefixes = ["android.arch", "com.android.support"]
    excludedConfigurations = ["lintClassPath"]
    excludedFilesFromScanning = [
        // org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20
        "org/jetbrains/kotlin/load/java/JvmAnnotationNamesKt",

        // org.jetbrains.kotlin:kotlin-reflect:1.4.20
        "kotlin/reflect/jvm/internal/impl/load/java/JvmAnnotationNamesKt",

        // org.jetbrains.kotlin:kotlin-android-extensions:1.4.20
        "org/jetbrains/kotlin/android/synthetic/AndroidConst",
        "org/jetbrains/kotlin/android/synthetic/codegen/AndroidIrTransformer",
        "org/jetbrains/kotlin/android/synthetic/codegen/ResourcePropertyStackValue",

        // org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10
        "org/jetbrains/kotlin/com/intellij/codeInsight/NullableNotNullManager",
        
        // com.squareup.leakcanary:shark-android:2.5
        "shark/AndroidReferenceMatchers",

        // com.squareup.leakcanary:leakcanary-object-watcher-android-support-fragments:2.5
        "leakcanary/internal/AndroidSupportFragmentDestroyWatcher",
        
        // com.squareup.leakcanary:leakcanary-android:2.8.1
        "curtains/internal/WindowCallbackWrapper"
    ]
    excludedProjectsFromScanning = [] // Here you can define a list of Gradle project names to be excluded from the scanning analysis
    excludeSupportAnnotations = true
    verbose = false
}

Versioning

This project uses the Semantic Versioning guidelines for transparency into our release cycle.

Sponsor this project

Sponsor this open source project to help us get the funding we need to continue working on it.

Follow us

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].