Permalink
Browse files

Drop Xcode launching in favour of a bundled (modified) iphonesim. Swa…

…p old example application for an iPad/iPhone universal one. The example app needs quite a lot of work doing to properly test iCuke though.
  • Loading branch information...
Rob Holland
Rob Holland committed Jun 20, 2010
1 parent bfb2fbd commit ccfd4521697c9b2cac15f3102fde3f739db63ee1
Showing with 1,764 additions and 415 deletions.
  1. +3 −0 .gitmodules
  2. +7 −15 Rakefile
  3. +3 −0 app/.gitignore
  4. +20 −0 app/LICENSE
  5. +3 −0 app/Readme.markdown
  6. +17 −0 app/Shared/AppDelegate_Shared.h
  7. +25 −0 app/Shared/AppDelegate_Shared.m
  8. BIN app/Shared/Icon.png
  9. +15 −0 app/Shared/ModalViewController.h
  10. +96 −0 app/Shared/ModalViewController.m
  11. +15 −0 app/Shared/TestViewController_Shared.h
  12. +43 −0 app/Shared/TestViewController_Shared.m
  13. +43 −0 app/Shared/Universal-Info.plist
  14. +8 −0 app/Shared/Universal_Prefix.pch
  15. +14 −0 app/Shared/main.m
  16. +301 −0 app/Universal.xcodeproj/project.pbxproj
  17. +15 −0 app/iPad/AppDelegate_Pad.h
  18. +28 −0 app/iPad/AppDelegate_Pad.m
  19. BIN app/iPad/Default-Landscape.png
  20. BIN app/iPad/Default-Portrait.png
  21. +343 −0 app/iPad/MainWindow_Pad.xib
  22. +15 −0 app/iPad/TestViewController_Pad.h
  23. +52 −0 app/iPad/TestViewController_Pad.m
  24. +15 −0 app/iPhone/AppDelegate_Phone.h
  25. +28 −0 app/iPhone/AppDelegate_Phone.m
  26. BIN app/iPhone/Default.png
  27. +363 −0 app/iPhone/MainWindow_Phone.xib
  28. +15 −0 app/iPhone/TestViewController_Phone.h
  29. +36 −0 app/iPhone/TestViewController_Phone.m
  30. +1 −0 bin/.gitignore
  31. +10 −0 bin/icuke
  32. +17 −0 bin/icuke-module
  33. +6 −0 ext/Rakefile
  34. +2 −5 ext/iCuke/sdk3.1/Rakefile
  35. +2 −5 ext/iCuke/sdk4.0/Rakefile
  36. +1 −0 ext/iphonesim
  37. +9 −96 features/iphone.feature
  38. +111 −112 iCuke.gemspec
  39. +15 −10 lib/icuke/cucumber.rb
  40. +4 −19 lib/icuke/{headless.rb → iphonesim.rb}
  41. +4 −4 lib/icuke/screen.rb
  42. +49 −2 lib/icuke/sdk.rb
  43. +10 −11 lib/icuke/simulator.rb
  44. +0 −136 lib/icuke/xcode.rb
View
@@ -0,0 +1,3 @@
+[submodule "ext/iphonesim"]
+ path = ext/iphonesim
+ url = git://github.com/robholland/iphonesim.git
View
@@ -12,30 +12,22 @@ begin
gem.homepage = "http://github.com/unboxed/iCuke"
gem.authors = ["Rob Holland"]
gem.add_dependency "cucumber", ">= 0"
- gem.add_dependency "rb-appscript", ">= 0"
gem.add_dependency "httparty", ">= 0"
gem.add_dependency "nokogiri", ">= 0"
- gem.extensions = ['ext/iCuke/Rakefile']
- gem.files += ['ext/iCuke/libicuke.dylib']
+ gem.extensions = ['ext/Rakefile']
+ gem.files += ['bin/iphonesim']
+ gem.files += ['ext/iCuke/libicuke*.dylib']
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-file 'app/sdk3/build/Debug-iphonesimulator/UICatalog.app/UICatalog' do
- ICuke::SDK.use_latest(3)
- sh "cd app/sdk3 && xcodebuild -target UICatalog -configuration Debug -sdk #{ICuke::SDK.fullname}"
+file 'app/build/Debug-iphonesimulator/Universal.app/Universal' do
+ sh "cd app && xcodebuild -target Universal -configuration Debug -sdk #{ICuke::SDK.fullname}"
end
-task :sdk3_app => 'app/sdk3/build/Debug-iphonesimulator/UICatalog.app/UICatalog'
-task :features => :sdk3_app
-
-file 'app/sdk4/build/Debug-iphonesimulator/UICatalog.app/UICatalog' do
- ICuke::SDK.use_latest(4)
- sh "cd app/sdk4 && xcodebuild -target UICatalog -configuration Debug -sdk #{ICuke::SDK.fullname}"
-end
-task :sdk4_app => 'app/sdk3/build/Debug-iphonesimulator/UICatalog.app/UICatalog'
-task :features => :sdk4_app
+task :app => 'app/sdk3/build/Debug-iphonesimulator/UICatalog.app/UICatalog'
+task :features => :app
task :lib do
sh 'cd ext/iCuke && rake'
View
@@ -1 +1,4 @@
+.DS_Store
build
+*.mode1v3
+*.pbxuser
View
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Sam Soffes
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,3 @@
+# Universal iPad/iPhone Example
+
+Simple example app that uses 3.2 as the base SDK and 3.1.3 as the iPhone deployment target.
@@ -0,0 +1,17 @@
+//
+// AppDelegate_Shared.h
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+@interface AppDelegate_Shared : NSObject <UIApplicationDelegate> {
+
+ UIWindow *window;
+ UINavigationController *navigationController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+
+@end
@@ -0,0 +1,25 @@
+ //
+// AppDelegate_Shared.m
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#import "AppDelegate_Shared.h"
+
+@implementation AppDelegate_Shared
+
+@synthesize window;
+
+#pragma mark -
+#pragma mark NSObject
+#pragma mark -
+
+- (void)dealloc {
+ [window release];
+ [navigationController release];
+ [super dealloc];
+}
+
+@end
View
Binary file not shown.
@@ -0,0 +1,15 @@
+//
+// ModalViewController.h
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+@interface ModalViewController : UITableViewController {
+
+}
+
+- (void)close:(id)sender;
+
+@end
@@ -0,0 +1,96 @@
+//
+// ModalViewController.m
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#import "ModalViewController.h"
+
+@implementation ModalViewController
+
+NSString *lorem[] = {
+ @"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
+ @"Donec dictum vehicula suscipit.",
+ @"Morbi eget mauris vel mauris pellentesque luctus ut sed nulla.",
+ @"Aliquam blandit risus ut magna egestas ac commodo lacus sagittis.",
+ @"Duis dui nunc, rutrum a tincidunt nec, commodo vitae ante.",
+ @"Mauris fringilla est at nibh porta pulvinar.",
+ @"Quisque mattis, odio sit amet ultrices elementum, dui libero scelerisque nisl, a bibendum ante orci ut metus.",
+ @"Aliquam id lorem arcu.",
+ @"Fusce luctus, nibh facilisis sagittis ornare, neque ligula accumsan ipsum, non dignissim sapien nulla et turpis.",
+ @"Proin pretium erat nec ipsum fringilla pellentesque.",
+ @"Fusce sem nisi, tincidunt in sodales ac, tincidunt non lorem."
+};
+
+
+#pragma mark -
+#pragma mark UIViewController
+#pragma mark -
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ self.title = @"Shared Modal";
+
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ self.contentSizeForViewInPopover = CGSizeMake(320.0, 300.0);
+ } else {
+ UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)];
+ self.navigationItem.rightBarButtonItem = closeButton;
+ [closeButton release];
+ }
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ return YES;
+ }
+
+ return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
+}
+
+
+#pragma mark -
+#pragma mark Actions
+#pragma mark -
+
+- (void)close:(id)sender {
+ [self.navigationController dismissModalViewControllerAnimated:YES];
+}
+
+
+#pragma mark -
+#pragma mark UITableViewDataSource
+#pragma mark -
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return sizeof(lorem) / sizeof(NSString *);
+}
+
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ static NSString *cellIdentifier = @"cellIdentifier";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
+ if (!cell) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
+ }
+
+ cell.textLabel.text = lorem[indexPath.row];
+
+ return cell;
+}
+
+
+#pragma mark -
+#pragma mark UITableViewDelegate
+#pragma mark -
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
+}
+
+@end
@@ -0,0 +1,15 @@
+//
+// TestViewController_Shared.h
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+@interface TestViewController_Shared : UIViewController {
+
+}
+
+- (void)test:(id)sender;
+
+@end
@@ -0,0 +1,43 @@
+//
+// TestViewController_Shared.m
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#import "TestViewController_Shared.h"
+
+@implementation TestViewController_Shared
+
+#pragma mark -
+#pragma mark UIViewController
+#pragma mark -
+
+- (void)viewDidLoad {
+ UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+ button.frame = CGRectMake(20.0, 20.0, 280.0, 44.0);
+ [button setTitle:@"Show Test Modal" forState:UIControlStateNormal];
+ [button addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
+ [self.view addSubview:button];
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ return YES;
+ }
+
+ return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
+}
+
+
+#pragma mark -
+#pragma mark Actions
+#pragma mark -
+
+- (void)test:(id)sender {
+ // Must be overridden by subclass
+}
+
+@end
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string>Icon.png</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.samsoffes.universal-ipad-iphone-example</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainWindow_Phone</string>
+ <key>NSMainNibFile~ipad</key>
+ <string>MainWindow_Pad</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'Universal' target in the 'Universal' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+#endif
View
@@ -0,0 +1,14 @@
+//
+// main.m
+// Universal
+//
+// Created by Sam Soffes on 4/12/10.
+// Copyright Sam Soffes 2010. All rights reserved.
+//
+
+int main(int argc, char *argv[]) {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, nil);
+ [pool release];
+ return retVal;
+}
Oops, something went wrong.

0 comments on commit ccfd452

Please sign in to comment.