Last active
January 22, 2018 20:14
-
-
Save serv-inc/232d03bcb9b2f44bf106ee8f7505018c to your computer and use it in GitHub Desktop.
upgrades udacity's android sources to use the gradle-3.0 plugin of Android Studio 3 -- https://github.com/gshadows/scripts/blob/master/convert-udacity-gradle.sh is more elaborate, this also fixes T10.x
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 characters
#! /bin/sh | |
### upgrades udacity's android sources to use the gradle-3.0 plugin of Android Studio 3. | |
### run this script from the directory you want to upgrade to | |
for i in $(git ls-files '*build.gradle'); do | |
grep 'vectorDrawables' $i && echo "$(/bin/pwd)/$i already upgraded? contains vectorDrawables" && exit 1 | |
sed -i'.bak' -e "s/classpath 'com.android.tools.build:gradle:2.2.3'/classpath 'com.android.tools.build:gradle:3.0.0'/g" $i; | |
sed -i'.bak' "s/buildToolsVersion ['\"]25.0.2['\"]/buildToolsVersion '26.0.2'/g" $i; | |
sed -i'.bak' -e "s/defaultConfig {/defaultConfig{\n vectorDrawables.useSupportLibrary = true/g" $i; | |
sed -i'.bak' -e "s/^dependencies {/dependencies {\n compile 'com.android.support:appcompat-v7:26.1.0'/g" $i; | |
done | |
for i in $(git ls-files '*gradle-wrapper.properties'); do | |
sed -i'.bak' -e "s/gradle-3.3-all.zip/gradle-4.1-all.zip/g" $i; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment