Skip to content

emile2013/EasyMigrateAndroidX

Repository files navigation

EasyMigrateAndroidX

license Release Version

Help Android Program Migrate To AndroidX

Android Studio Migrate to Androidx make lots of source file not exactly right, result project compile error. With this repository can migrate to androidX quickly,without such issue.

Features

  • support java,xml,kt extension file content replace;
  • support gradle extension file content replace;

README 中文版

Getting Started

Edit root project build.gradle file, append plugin in buildscript classpath ,and do not forget add maven { url 'https://jitpack.io' } too.
buildscript {
    ext.easyandroidx_version='0.1.1'
    repositories {
        maven { url 'https://jitpack.io' } //add this line
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "com.github.emile2013:EasyMigrateAndroidX:$easyandroidx_version" //add this line
    }
}

allprojects {
    repositories {
      maven { url 'https://jitpack.io' }  //add this line
      google()
      mavenCentral()
      jcenter()
    }
}
App module build.gradle file add dependency
apply plugin: 'com.android.application'
apply plugin: 'com.github.emile2013.migrateandroidx' // add this line

tips: just add in one child module , no need add in all projects

Run task
./gradlew migrateAndroidX

Modify manually build.gradle [手动修改build.gradle]

You maybe need to add not declare dependency in build.gradle , so after running, modify the newest artifact for androidX

Tips

  • Repository do not support append comment in dependency declare line , such as :
    implementation("com.android.support:support-annotations:${rootProject.ext.google.support}"){ //do not add this comment
    }
  • androidX Prerequisites such as gradle version 4.6+,AGP 3.2.0+, and both of them are set to true in your gradle.properties file:
android.useAndroidX=true
android.enableJetifier=true

Reference

License

ResMonitor is licensed under the BSD 3-Clause License.

About

Help Android Program Migrate Source To AndroidX

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages