Tweak build script to only set version number if we're in a git repository
Add readme for GHUnit
Showing
2 changed files
with
4 additions
and
1 deletions
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | # This script sets a version number for ASIHTTPRequest based on the last commit, and is run when you build one of the targets in the Xcode projects that come with ASIHTTPRequest | 3 | # This script sets a version number for ASIHTTPRequest based on the last commit, and is run when you build one of the targets in the Xcode projects that come with ASIHTTPRequest |
4 | # It only really needs to run on my computer, not on yours... :) | 4 | # It only really needs to run on my computer, not on yours... :) |
5 | require 'find' | 5 | require 'find' |
6 | -if (File.exists?('/usr/local/bin/git')) | 6 | +if (File.exists?('.git') && File.directory?('.git') && File.exists?('/usr/local/bin/git')) |
7 | newversion = `/usr/local/bin/git describe --tags`.match(/(v([0-9]+)(\.([0-9]+)){1,}-([0-9]+))/).to_s.gsub(/[0-9]+$/){|commit| (commit.to_i + 1).to_s}+Time.now.strftime(" %Y-%m-%d") | 7 | newversion = `/usr/local/bin/git describe --tags`.match(/(v([0-9]+)(\.([0-9]+)){1,}-([0-9]+))/).to_s.gsub(/[0-9]+$/){|commit| (commit.to_i + 1).to_s}+Time.now.strftime(" %Y-%m-%d") |
8 | buffer = File.new('Classes/ASIHTTPRequest.m','r').read | 8 | buffer = File.new('Classes/ASIHTTPRequest.m','r').read |
9 | if !buffer.match(/#{Regexp.quote(newversion)}/) | 9 | if !buffer.match(/#{Regexp.quote(newversion)}/) |
External/GHUnit/README-GHUnit
0 → 100644
1 | +This folder is where ASIHTTPRequest looks for GHUnit frameworks. | ||
2 | + | ||
3 | +When you run one of the test targets, a build script will attempt to download a pre-compiled framework and install it here, if one does not already exist. If you would prefer to build GHUnit yourself, simply grab a copy from https://github.com/gabriel/gh-unit, and drop your built framework in this folder. |
-
Please register or login to post a comment