Last active
March 4, 2016 18:46
-
-
Save cybertk/24ce4d20d76f9d6a16c6 to your computer and use it in GitHub Desktop.
Update version in AndroidManifest.xml
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
task :update_build_number do | |
File.open('AndroidManifest.xml', 'r+') do |f| | |
manifest = f.read | |
build = ENV['TRAVIS_BUILD_NUMBER'] || 0 | |
# Update version | |
manifest = manifest.gsub( | |
/android:versionCode=".*"/, "android:versionCode=\"#{build}\"") | |
# Write back | |
f.rewind | |
f.truncate(0) | |
f.write(manifest) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment