Skip to content

Commit

Permalink
Tweak build script to only set version number if we're in a git repos…
Browse files Browse the repository at this point in the history
…itory

Add readme for GHUnit
  • Loading branch information
pokeb committed Feb 6, 2011
1 parent 3cb0230 commit 7bcac05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Build Scripts/set_version_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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
# It only really needs to run on my computer, not on yours... :)
require 'find'
if (File.exists?('/usr/local/bin/git'))
if (File.exists?('.git') && File.directory?('.git') && File.exists?('/usr/local/bin/git'))
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")
buffer = File.new('Classes/ASIHTTPRequest.m','r').read
if !buffer.match(/#{Regexp.quote(newversion)}/)
Expand Down
3 changes: 3 additions & 0 deletions External/GHUnit/README-GHUnit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This folder is where ASIHTTPRequest looks for GHUnit frameworks.

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.

0 comments on commit 7bcac05

Please sign in to comment.