#!/usr/bin/perl -i.orig # Edit a build.gradle file in-place to update plugins to a specific version # To update all subprojects, run: # ./versionup.pl */build.gradle # Plugins and their latest versions $plugins = { 'com.google.protobuf' => '0.8.0', 'us.kirchmeier.capsule' => '1.0.2', }; while (<>) { for $plugin (keys %$plugins) { my $ver = $plugins->{$plugin}; s/^(\s*id\s*[\'\"]\Q$plugin\E[\'\"]\s*version\s*)\S+/${1}'$ver'/i; } print; }