Created
August 20, 2020 20:15
-
-
Save TarasOsiris/8ff57442384487de4ee3e53abf95fe6b to your computer and use it in GitHub Desktop.
This file contains 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 characters
allprojects { | |
def mappings = [ | |
'android.support.annotation': 'androidx.annotation', | |
'android.arch.lifecycle': 'androidx.lifecycle', | |
'android.support.v4.app.NotificationCompat': 'androidx.core.app.NotificationCompat', | |
'android.support.v4.app.ActivityCompat': 'androidx.core.app.ActivityCompat', | |
'android.support.v4.content.ContextCompat': 'androidx.core.content.ContextCompat', | |
'android.support.v13.app.FragmentCompat': 'androidx.legacy.app.FragmentCompat', | |
'android.arch.lifecycle.Lifecycle': 'androidx.lifecycle.Lifecycle', | |
'android.arch.lifecycle.LifecycleObserver': 'androidx.lifecycle.LifecycleObserver', | |
'android.arch.lifecycle.OnLifecycleEvent': 'androidx.lifecycle.OnLifecycleEvent', | |
'android.arch.lifecycle.ProcessLifecycleOwner': 'androidx.lifecycle.ProcessLifecycleOwner', | |
] | |
beforeEvaluate { project -> | |
project.rootProject.projectDir.traverse(type: groovy.io.FileType.FILES, nameFilter: ~/.*\.java$/) { f -> | |
mappings.each { entry -> | |
if (f.getText('UTF-8').contains(entry.key)) { | |
println "Updating ${entry.key} to ${entry.value} in file ${f}" | |
ant.replace(file: f, token: entry.key, value: entry.value) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment