Inpsired by: - dlew: https://gist.github.com/dlew/5db1b780896bbc6f542e7c00a11db6a0 - AbdElraoufSabri: https://gist.github.com/AbdElraoufSabri/907163eecbb87e7ca033d01004623c05 - dudeinthemirror: https://gist.github.com/dudeinthemirror/cb4942e0ee5c3df0fcb678d1798e1d4d Why this? - Use the same script, with additional "artifact" mapping (androidx-migrator-artifact.sh) - Skip any "build" directory, regardless of module name: app (app/build), abc (abc/build) - Support `view binding` please comment if the class mapping is not updated (official from google also still not updated) What not? - Not support version mapping, e.g: `android.support.appcompat:appcompat-v7:28.0.1` -> `androidx.appcompat:appcompat:2.0.0` - Generated library/3rd-party library, e.g: `Glide`, `Dagger`, etc **must be updated manually**, check for their latest update support an **AndroidX** or not, otherwise, fork the library and customized it ourself Troubleshooting - Keep support library, by using `android.jetifier.blacklist` properties, e.g: [`Glide support library`](https://github.com/bumptech/glide/issues/3080#issuecomment-495430590) - Strange errors ``` cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.support.v7.widget.AppCompatImageView not found ``` - [many recommends to use `api` instead of `implementation](https://stackoverflow.com/questions/42046732/possible-reason-for-errorcannot-generate-view-binders-java-lang-nullpointerexc/42046733) - due to gradle / build cache - due to generated code that still using support library - using `grep ".support.v7.widget.AppCompatImageView" -R .` to make sure if there's cache/generated class reference that imports TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) - Support `com.pierfrancescosoffritti.androidyoutubeplayer` migration to androidx - Support mapping for themes [see here](https://stackoverflow.com/a/61224261/3763032) or using [Bridge Theme](Bridge Themes), e.g: `Theme.AppCompat.Light` -> `Theme.MaterialComponents.Light.Bridge` Run this: - `curl -s -L https://git.io/JewSF | bash`