@@ -2,7 +2,7 @@ require 'rubygems'
2
2
require 'bundler/setup'
3
3
require 'xcoder'
4
4
require 'restkit/rake'
5
- require 'ruby-debug '
5
+ require 'debugger '
6
6
7
7
RestKit ::Rake ::ServerTask . new do |t |
8
8
t . port = 4567
@@ -23,19 +23,19 @@ namespace :test do
23
23
namespace :logic do
24
24
desc "Run the logic tests for iOS"
25
25
task :ios => :kill_simulator do
26
- config = Xcode . project ( :RestKit ) . target ( :RestKitTests ) . config ( :Debug )
26
+ config = Xcode . workspace ( :RestKit ) . scheme ( :RestKitTests )
27
27
builder = config . builder
28
- build_dir = File . dirname ( config . target . project . path ) + '/Build'
28
+ build_dir = File . dirname ( config . parent . workspace_root ) + '/Build'
29
29
builder . symroot = build_dir + '/Products'
30
30
builder . objroot = build_dir
31
31
builder . test ( :sdk => 'iphonesimulator' )
32
32
end
33
33
34
34
desc "Run the logic tests for OS X"
35
35
task :osx do
36
- config = Xcode . project ( :RestKit ) . target ( :RestKitFrameworkTests ) . config ( :Debug )
36
+ config = Xcode . workspace ( :RestKit ) . scheme ( :RestKitFrameworkTests )
37
37
builder = config . builder
38
- build_dir = File . dirname ( config . target . project . path ) + '/Build'
38
+ build_dir = File . dirname ( config . parent . workspace_root ) + '/Build'
39
39
builder . symroot = build_dir + '/Products'
40
40
builder . objroot = build_dir
41
41
builder . test ( :sdk => 'macosx' )
@@ -45,31 +45,12 @@ namespace :test do
45
45
desc "Run the unit tests for iOS and OS X"
46
46
task :logic => [ 'logic:ios' , 'logic:osx' ]
47
47
48
- namespace :application do
49
- desc "Run the application tests for iOS"
50
- task :ios => :kill_simulator do
51
- config = Xcode . project ( :RKApplicationTests ) . target ( 'Application Tests' ) . config ( :Debug )
52
- builder = config . builder
53
- build_dir = File . dirname ( config . target . project . path ) + '/Build'
54
- builder . symroot = build_dir + '/Products'
55
- builder . objroot = build_dir
56
- builder . test ( :sdk => 'iphonesimulator' )
57
- end
58
- end
59
-
60
- desc "Run the application tests for iOS"
61
- task :application => 'application:ios'
62
-
63
48
desc "Run all tests for iOS and OS X"
64
49
task :all do
65
50
Rake . application . invoke_task ( "test:logic" )
66
51
unit_status = $?. exitstatus
67
- puts "\033 [0;33m!! Warning: RestKit application tests are disabled!!"
68
- # Rake.application.invoke_task("test:application")
69
- integration_status = $?. exitstatus
70
52
puts "\033 [0;31m!! Unit Tests failed with exit status of #{ unit_status } " if unit_status != 0
71
- puts "\033 [0;31m!! Integration Tests failed with exit status of #{ integration_status } " if integration_status != 0
72
- puts "\033 [0;32m** All Tests executed successfully" if unit_status == 0 && integration_status == 0
53
+ puts "\033 [0;32m** All Tests executed successfully" if unit_status == 0 #&& integration_status == 0
73
54
end
74
55
end
75
56
100
81
101
82
desc "Build RestKit for iOS and Mac OS X"
102
83
task :build do
103
- run ( "xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk iphonesimulator5.0 clean build" )
104
- run ( "xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk iphoneos clean build" )
105
- run ( "xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk macosx10.6 clean build" )
106
- run ( "xcodebuild -workspace Examples/RKCatalog/RKCatalog.xcodeproj/project.xcworkspace -scheme RKCatalog -sdk iphoneos clean build" )
84
+ run ( "xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk iphonesimulator5.0 clean build" )
85
+ run ( "xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk iphoneos clean build" )
86
+ run ( "xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk macosx10.6 clean build" )
107
87
end
108
88
109
89
desc "Generate documentation via appledoc"
175
155
namespace :build do
176
156
desc "Build all Example projects to ensure they are building properly"
177
157
task :examples do
178
- ios_sdks = %w{ iphoneos iphonesimulator5.0 }
158
+ ios_sdks = %w{ iphoneos iphonesimulator5.0 iphonesimulator6.0 }
179
159
osx_sdks = %w{ macosx }
180
160
osx_projects = %w{ RKMacOSX }
181
161
@@ -199,25 +179,3 @@ desc "Validate a branch is ready for merging by checking for common issues"
199
179
task :validate => [ :build , 'docs:check' , 'uispec:all' ] do
200
180
puts "Project state validated successfully. Proceed with merge."
201
181
end
202
-
203
- namespace :payload do
204
- task :generate do
205
- require 'json'
206
- require 'faker'
207
-
208
- ids = ( 1 ..25 ) . to_a
209
- child_ids = ( 50 ..100 ) . to_a
210
- child_counts = ( 10 ..25 ) . to_a
211
- hash = ids . inject ( { 'parents' => [ ] } ) do |hash , parent_id |
212
- child_count = child_counts . sample
213
- children = ( 0 ..child_count ) . collect do
214
- { 'name' => Faker ::Name . name , 'childID' => child_ids . sample }
215
- end
216
- parent = { 'parentID' => parent_id , 'name' => Faker ::Name . name , 'children' => children }
217
- hash [ 'parents' ] << parent
218
- hash
219
- end
220
- File . open ( 'payload.json' , 'w+' ) { |f | f << hash . to_json }
221
- puts "Generated payload at: payload.json"
222
- end
223
- end
0 commit comments