Permalink
Browse files

Tweak build script to only set version number if we're in a git repos…

…itory

Add readme for GHUnit
  • Loading branch information...
1 parent 3cb0230 commit 7bcac05713707738b6724c3e033f4cc6c0d50b16 @pokeb committed Feb 6, 2011
Showing with 4 additions and 1 deletion.
  1. +1 −1 Build Scripts/set_version_number.rb
  2. +3 −0 External/GHUnit/README-GHUnit
@@ -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)}/)
@@ -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.