Replace stupid and complicated auto-versioning script with a marginally less stu…
…pid and complicated one in ruby
Showing
5 changed files
with
9 additions
and
9 deletions
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | #import "ASIInputStream.h" | 21 | #import "ASIInputStream.h" |
| 22 | 22 | ||
| 23 | // Automatically set on build | 23 | // Automatically set on build |
| 24 | -NSString *ASIHTTPRequestVersion = @"v1.2-57 2010-01-04"; | 24 | +NSString *ASIHTTPRequestVersion = @"v1.2-58 2010-01-04"; |
| 25 | 25 | ||
| 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 27 | 27 |
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
set_version_number.rb
0 → 100755
| 1 | +#!/usr/bin/env ruby | ||
| 2 | +require 'find' | ||
| 3 | +newversion = `/opt/local/bin/git describe --tags`.match(/(v([0-9]+)\.([0-9]+)-([0-9]+))/).to_s.gsub(/[0-9]+$/){|commit| (commit.to_i + 1).to_s}+Time.now.strftime(" %Y-%m-%d") | ||
| 4 | +buffer = File.new('Classes/ASIHTTPRequest.m','r').read | ||
| 5 | +if !buffer.match(/#{Regexp.quote(newversion)}/) | ||
| 6 | + buffer = buffer.sub(/(NSString \*ASIHTTPRequestVersion = @\")(.*)(";)/,'\1'+newversion+'\3'); | ||
| 7 | +end | ||
| 8 | +File.open('Classes/ASIHTTPRequest.m','w') {|fw| fw.write(buffer)} |
set_version_number.sh
deleted
100755 → 0
| 1 | -#!/bin/sh | ||
| 2 | -versionString=`/opt/local/bin/git describe --tags` | ||
| 3 | -version="`echo $versionString | sed -E 's/(v([0-9]+)\.([0-9]+))(.*)/\1/g'`" | ||
| 4 | -commitNum="`echo $versionString | sed -E 's/(v([0-9]+)\.([0-9]+))\-([0-9]*)(.*)/\4/g'`" | ||
| 5 | -date=`date "+%Y-%m-%d"` | ||
| 6 | -displayVersion="${version}-`expr $commitNum + 1` ${date}" | ||
| 7 | - | ||
| 8 | -sed -i "" "s/NSString \*ASIHTTPRequestVersion = @\"\(.*\)/NSString *ASIHTTPRequestVersion = @\"$displayVersion\";/g" Classes/ASIHTTPRequest.m |
-
Please register or login to post a comment