Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More robust build script. Updated for iOS6.

  • Loading branch information...
commit cf921f491e931a3d785fdbcb9d516225294ddc01 1 parent 4f9b2c5
Erik Doernenburg authored

Showing 1 changed file with 27 additions and 7 deletions. Show diff stats Hide diff stats

  1. 34  Tools/{makerelease.rb → build.rb}
34  Tools/makerelease.rb → Tools/build.rb 100644 → 100755
... ...
@@ -1,19 +1,28 @@
  1
+#!/usr/bin/env ruby
1 2
    
2  
-class ReleaseManager
  3
+class Builder
3 4
 
4 5
     def initialize
5 6
         @env = Environment.new()
6 7
         @worker = CompositeWorker.new([Logger.new(), Executer.new()])
7 8
     end              
8 9
     
9  
-    def makeAll
  10
+    def makeRelease
10 11
       createWorkingDirectories
11 12
       downloadSource
  13
+      copySource
12 14
       buildModules
13 15
       createPackage "ocmock-2.0.1.dmg", "OCMock 2.0.1" 
14 16
       openPackageDir
15 17
     end
16 18
     
  19
+    def justBuild
  20
+      createWorkingDirectories
  21
+      downloadSource
  22
+      buildModules
  23
+      openPackageDir
  24
+    end
  25
+    
17 26
     def createWorkingDirectories
18 27
         @worker.run("mkdir -p #{@env.sourcedir}")
19 28
         @worker.run("mkdir -p #{@env.productdir}")
@@ -22,7 +31,9 @@ def createWorkingDirectories
22 31
     
23 32
     def downloadSource
24 33
         @worker.run("git archive master | tar -x -v -C #{@env.sourcedir}")
25  
-        @worker.chdir(@env.sourcedir) 
  34
+    end
  35
+
  36
+    def copySource
26 37
         @worker.run("cp -R #{@env.sourcedir}/Source #{@env.productdir}")
27 38
     end
28 39
 
@@ -32,8 +43,8 @@ def buildModules
32 43
         osxproductdir = "#{@env.productdir}/OSX"                                        
33 44
         @worker.run("mkdir -p #{osxproductdir}")
34 45
         @worker.run("cp -R build/Release/OCMock.framework #{osxproductdir}")    
35  
-        @worker.run("xcodebuild -project OCMock.xcodeproj -target OCMockLib -sdk iphoneos5.0")                                                 
36  
-        @worker.run("xcodebuild -project OCMock.xcodeproj -target OCMockLib -sdk iphonesimulator5.0")                                                 
  46
+        @worker.run("xcodebuild -project OCMock.xcodeproj -target OCMockLib -sdk iphoneos6.0")                                                 
  47
+        @worker.run("xcodebuild -project OCMock.xcodeproj -target OCMockLib -sdk iphonesimulator6.0")                                                 
37 48
         @worker.run("lipo -create -output build/Release/libOCMock.a build/Release-*/libOCMock.a")      
38 49
         iosproductdir = "#{@env.productdir}/iOS"                                           
39 50
         @worker.run("mkdir -p #{iosproductdir}")
@@ -77,7 +88,7 @@ def cleanup
77 88
 
78 89
 class Environment
79 90
     def initialize()
80  
-        @tmpdir = "/tmp/makerelease.#{Process.pid}"
  91
+        @tmpdir = "/tmp/ocmock.#{Process.pid}"
81 92
         @sourcedir = tmpdir + "/Source"
82 93
         @productdir = tmpdir + "/Products"
83 94
         @packagedir = tmpdir
@@ -141,5 +152,14 @@ def run(cmd, &block)
141 152
 end    
142 153
 
143 154
 
144  
-ReleaseManager.new.makeAll
  155
+if /Tools$/.match(Dir.pwd)
  156
+  Dir.chdir("..")
  157
+end
  158
+
  159
+if ARGV[0] == '-r' 
  160
+  Builder.new.makeRelease
  161
+else
  162
+  Builder.new.justBuild
  163
+end
  164
+
145 165
 

0 notes on commit cf921f4

Please sign in to comment.
Something went wrong with that request. Please try again.