Last active
September 11, 2020 05:25
-
-
Save mochadwi/d233e4996f3e498f08f57d073e366c9b to your computer and use it in GitHub Desktop.
Revisions
-
mochadwi revised this gist
Apr 18, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: 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](https://material.io/develop/android/docs/getting-started/), e.g: `Theme.AppCompat.Light` -> `Theme.MaterialComponents.Light.Bridge` Run this: - `curl -s -L https://git.io/JewSF | bash` -
mochadwi revised this gist
Apr 18, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,6 +27,7 @@ cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: 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` -
mochadwi revised this gist
Apr 7, 2020 . 2 changed files with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,14 +26,14 @@ do done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.kt" -o -name "*.java" -o -name "*.xml" -o -name "*.jar" -o -name "*.aar" \) -type f ! -path '*/\.git*' ! -path '**/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null ret=$? if (( ! ret )); then $GSED -i.bak "$replace" $file # cmp --silent $file $file.bak ret=$? if (( ret ));then printf "\nDoing file %s\n" $file This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1940,5 +1940,4 @@ android.support.design.widget.AppBarLayout,com.google.android.material.appbar.Ap android.support.design.widget.Snackbar,com.google.android.material.snackbar.Snackbar android.support.design.widget.BottomSheetBehavior,com.google.android.material.bottomsheet.BottomSheetBehavior android.support.design.widget.TextInputEditText,com.google.android.material.textfield.TextInputEditText android.support.design.widget.TextInputLayout,com.google.android.material.textfield.TextInputLayout -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ 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` @@ -27,6 +26,7 @@ cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: 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 Run this: - `curl -s -L https://git.io/JewSF | bash` -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1941,4 +1941,4 @@ android.support.design.widget.Snackbar,com.google.android.material.snackbar.Snac android.support.design.widget.BottomSheetBehavior,com.google.android.material.bottomsheet.BottomSheetBehavior android.support.design.widget.TextInputEditText,com.google.android.material.textfield.TextInputEditText android.support.design.widget.TextInputLayout,com.google.android.material.textfield.TextInputLayout com.pierfrancescosoffritti.youtubeplayer,com.pierfrancescosoffritti.androidyoutubeplayer.core -
mochadwi revised this gist
Apr 7, 2020 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ 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) - Support `com.pierfrancescosoffritti.androidyoutubeplayer` migration to androidx What not? - Not support version mapping, e.g: `android.support.appcompat:appcompat-v7:28.0.1` -> `androidx.appcompat:appcompat:2.0.0` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1941,3 +1941,4 @@ android.support.design.widget.Snackbar,com.google.android.material.snackbar.Snac android.support.design.widget.BottomSheetBehavior,com.google.android.material.bottomsheet.BottomSheetBehavior android.support.design.widget.TextInputEditText,com.google.android.material.textfield.TextInputEditText android.support.design.widget.TextInputLayout,com.google.android.material.textfield.TextInputLayout com.pierfrancescosoffritti.youtubeplayer.player.YouTubePlayerView,com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView -
mochadwi revised this gist
Apr 7, 2020 . No changes.There are no files selected for viewing
-
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,7 @@ cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: - [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: -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,14 @@ What not? 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 TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,10 @@ Why this? 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) TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Why this? 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 TODO: -
mochadwi revised this gist
Apr 7, 2020 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Inpsired by: 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` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -305,6 +305,7 @@ android.arch.persistence.room.writer.QueryWriter,androidx.room.writer.QueryWrite android.arch.persistence.room.writer.RelationCollectorMethodWriter,androidx.room.writer.RelationCollectorMethodWriter android.arch.persistence.room.writer.SQLiteOpenHelperWriter,androidx.room.writer.SQLiteOpenHelperWriter android.arch.persistence.room.writer.TableInfoValidationWriter,androidx.room.writer.TableInfoValidationWriter android.viewbinding.ViewBinding,androidx.viewbinding.ViewBinding android.databinding.adapters.AbsListViewBindingAdapter,androidx.databinding.adapters.AbsListViewBindingAdapter android.databinding.adapters.AbsSeekBarBindingAdapter,androidx.databinding.adapters.AbsSeekBarBindingAdapter android.databinding.adapters.AbsSpinnerBindingAdapter,androidx.databinding.adapters.AbsSpinnerBindingAdapter -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ do done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.gradle" -o -name "*.gradle.kts" -o -name "*.kts" -o -name "*.kt" \) -type f ! -path '*/\.git*' ! -path '**/build/*' ! -path '**/\.idea/*' ! -path '**/java/*' ! -path '**/res/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null -
mochadwi revised this gist
Apr 7, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ do done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.gradle" -o -name "*.gradle.kts" \) -type f ! -path '*/\.git*' ! -path '**/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null -
mochadwi revised this gist
Nov 27, 2019 . No changes.There are no files selected for viewing
-
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,10 @@ 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) What not? - Not support version mapping, e.g: `android.support.appcompat:appcompat-v7:28.0.1` -> `androidx.appcompat:appcompat:2.0.0` TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,4 @@ TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) Run this: - `curl -s -L https://git.io/JewSF | bash` -
mochadwi revised this gist
Nov 12, 2019 . 2 changed files with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Why this? - Skip any "build" directory, regardless of module name: app (app/build), abc (abc/build) TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07)) Run this: - `curl -s -L https://git.io/JewXh | bash` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,10 +2,14 @@ mkdir -p scripts cd scripts # download csv class & artifact mapping wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/androidx_class_map.csv wget -cq https://developer.android.com/topic/libraries/support-library/downloads/androidx-artifact-mapping.csv # download migrator script wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/androidx-migrator-artifact.sh wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/androidx-migrator-class.sh bash androidx-migrator-class.sh bash androidx-migrator-artifact.sh -
mochadwi revised this gist
Nov 12, 2019 . 3 changed files with 21 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Why this? - Skip any "build" directory, regardless of module name: app (app/build), abc (abc/build) TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` (inspired by [loganj](https://gist.github.com/loganj/7535a13e98be83460f362b63dbd13e07) Run this: - `curl -s -L https://git.io/JewXh | bash` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,19 +14,19 @@ MAPPING_FILE="$SCRIPTS_DIR/androidx-artifact-mapping.csv" GSED=$(command -v gsed) if [[ -z "$GSED" ]]; then echo "ERROR: you need to install gnu-sed first." echo "run: 'brew install gnu-sed'" exit 101 fi replace="" while IFS=, read -r from to do replace+="s/\<$from\>/$to/g;" done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.gradle" \) -type f ! -path '*/\.git*' ! -path '**/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,19 +14,19 @@ MAPPING_FILE="$SCRIPTS_DIR/androidx_class_map.csv" GSED=$(command -v gsed) if [[ -z "$GSED" ]]; then echo "ERROR: you need to install gnu-sed first." echo "run: 'brew install gnu-sed'" exit 101 fi replace="" while IFS=, read -r from to do replace+="s/\<$from\>/$to/g;" done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.kt" -o -name "*.java" -o -name "*.xml" \) -type f ! -path '*/\.git*' ! -path '**/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null -
mochadwi revised this gist
Nov 12, 2019 . 2 changed files with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,12 @@ Inpsired by: - 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) TODO: - Use `rg` to replace `find` & `perl` to replace `sed|gsed` Run this: - `curl -s -L https://git.io/JewXh | bash` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ mkdir -p scripts cd scripts wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/34e0d83c37e90b83ea69fe12a7ef6289af872ce5/androidx_class_map.csv wget -cq https://developer.android.com/topic/libraries/support-library/downloads/androidx-artifact-mapping.csv wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/094dbb8f6070ab40147a4bcb160cb9cfabbb339a/androidx-migrator-artifact.sh wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/094dbb8f6070ab40147a4bcb160cb9cfabbb339a/androidx-migrator-class.sh -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,4 @@ Inpsired by: - AbdElraoufSabri: https://gist.github.com/AbdElraoufSabri/907163eecbb87e7ca033d01004623c05 - dudeinthemirror: https://gist.github.com/dudeinthemirror/cb4942e0ee5c3df0fcb678d1798e1d4d Run this: `curl -s -L https://git.io/JewXh | bash` -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,8 @@ mkdir -p scripts cd scripts wget -cq https://gist.github.com/AbdElraoufSabri/907163eecbb87e7ca033d01004623c05/raw/androidx_class_map.csv wget -cq https://developer.android.com/topic/libraries/support-library/downloads/androidx-artifact-mapping.csv wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/094dbb8f6070ab40147a4bcb160cb9cfabbb339a/androidx-migrator-artifact.sh wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/094dbb8f6070ab40147a4bcb160cb9cfabbb339a/androidx-migrator-class.sh bash androidx-migrator-class.sh bash androidx-migrator-artifact.sh -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 27 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,48 @@ #! /bin/bash # shellcheck disable=SC2086 # shellcheck disable=SC2162 # This script provides a workaround for having dependent modules which # have not been migrated to AndroidX # see: https://developer.android.com/jetpack/androidx/migrate # inspired from https://gist.github.com/dlew/5db1b780896bbc6f542e7c00a11db6a0 SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(cd "${SCRIPTS_DIR}"/.. && pwd)" MAPPING_FILE="$SCRIPTS_DIR/androidx-artifact-mapping.csv" GSED=$(command -v gsed) if [[ -z "$GSED" ]]; then echo "ERROR: you need to install gnu-sed first." echo "run: 'brew install gnu-sed'" exit 101 fi replace="" while IFS=, read -r from to do replace+="s/\<$from\>/$to/g;" done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.kt" -o -name "*.java" -o -name "*.xml" \) -type f ! -path '*/\.git*' ! -path '**/android/app/build/*' ! -path '**/demo/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null ret=$? if (( ! ret )); then $GSED -i.bak "$replace" $file cmp --silent $file $file.bak ret=$? if (( ret ));then printf "\nDoing file %s\n" $file else i=$((i+1)) printf '\r%2d skipped' $i rm -f $file.bak fi fi done echo ) -
mochadwi revised this gist
Nov 12, 2019 . 2 changed files with 30 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,6 @@ Inpsired by: - dlew: https://gist.github.com/dlew/5db1b780896bbc6f542e7c00a11db6a0 - AbdElraoufSabri: https://gist.github.com/AbdElraoufSabri/907163eecbb87e7ca033d01004623c05 - dudeinthemirror: https://gist.github.com/dudeinthemirror/cb4942e0ee5c3df0fcb678d1798e1d4d Run this: `curl -s -L https://git.io/JewXg | bash` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,48 @@ #! /bin/bash # shellcheck disable=SC2086 # shellcheck disable=SC2162 # This script provides a workaround for having dependent modules which # have not been migrated to AndroidX # see: https://developer.android.com/jetpack/androidx/migrate # inspired from https://gist.github.com/dlew/5db1b780896bbc6f542e7c00a11db6a0 SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(cd "${SCRIPTS_DIR}"/.. && pwd)" MAPPING_FILE="$SCRIPTS_DIR/androidx_class_map.csv" GSED=$(command -v gsed) if [[ -z "$GSED" ]]; then echo "ERROR: you need to install gnu-sed first." echo "run: 'brew install gnu-sed'" exit 101 fi replace="" while IFS=, read -r from to do replace+="s/\<$from\>/$to/g;" done <<< "$(cat $MAPPING_FILE)" i=0 (find $PROJECT_DIR \( -name "*.kt" -o -name "*.java" -o -name "*.xml" \) -type f ! -path '*/\.git*' ! -path '**/android/app/build/*' ! -path '**/demo/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" $file > /dev/null 2>/dev/null ret=$? if (( ! ret )); then $GSED -i.bak "$replace" $file cmp --silent $file $file.bak ret=$? if (( ret ));then printf "\nDoing file %s\n" $file else i=$((i+1)) printf '\r%2d skipped' $i rm -f $file.bak fi fi done echo ) -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ Run this: `curl -s -L https://git.io/JewXg | bash` -
mochadwi revised this gist
Nov 12, 2019 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #! /usr/bin/env bash mkdir -p scripts cd scripts wget -cq https://gist.github.com/AbdElraoufSabri/907163eecbb87e7ca033d01004623c05/raw/androidx_class_map.csv wget -cq https://developer.android.com/topic/libraries/support-library/downloads/androidx-artifact-mapping.csv wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/f4c86fc641afebdb4cc2b9223ee8ac55aff614e5/androidx-migrator-class.sh wget -cq https://gist.github.com/mochadwi/d233e4996f3e498f08f57d073e366c9b/raw/f4c86fc641afebdb4cc2b9223ee8ac55aff614e5/androidx-migrator-artifact.sh bash androidx-migrator-class.sh bash androidx-migrator-artifact.sh -
mochadwi created this gist
Nov 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #! /usr/bin/env bash # inspired from https://gist.github.com/dudeinthemirror/cb4942e0ee5c3df0fcb678d1798e1d4d SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(cd "${SCRIPTS_DIR}"/.. && pwd)" MAPPING_FILE="$SCRIPTS_DIR/androidx_artifact_map.csv" replace="" while IFS=, read -r from to do replace+="s/$from/$to/g;" done <<< "$(cat $MAPPING_FILE)" echo $replace > replace.sed i=0 (find $PROJECT_DIR \( -name "*.gradle" \) -type f ! -path '*/\.git*' ! -path '**/android/app/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" "$file" > /dev/null 2>/dev/null ret=$? if (( ! ret )); then gsed -i.bak -f replace.sed $file cmp --silent "$file" "$file.bak" ret=$? if (( ret ));then printf "\nDoing file %s\n" "$file" else i=$((i+1)) printf '\r%2d skipped' $i rm -f "$file.bak" fi fi done echo ) rm -rf replace.sed exit This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #! /usr/bin/env bash # inspired from https://gist.github.com/dudeinthemirror/cb4942e0ee5c3df0fcb678d1798e1d4d SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(cd "${SCRIPTS_DIR}"/.. && pwd)" MAPPING_FILE="$SCRIPTS_DIR/androidx_class_map.csv" replace="" while IFS=, read -r from to do replace+="s/$from/$to/g;" done <<< "$(cat $MAPPING_FILE)" echo $replace > replace.sed i=0 (find $PROJECT_DIR \( -name "*.kt" -o -name "*.java" -o -name "*.xml" \) -type f ! -path '*/\.git*' ! -path '**/android/app/build/*' ! -path '**/\.idea/*' 2>/dev/null | while read file do grep -E "android.arch|android.databinding|android.support" "$file" > /dev/null 2>/dev/null ret=$? if (( ! ret )); then gsed -i.bak -f replace.sed $file cmp --silent "$file" "$file.bak" ret=$? if (( ret ));then printf "\nDoing file %s\n" "$file" else i=$((i+1)) printf '\r%2d skipped' $i rm -f "$file.bak" fi fi done echo ) rm -rf replace.sed exit