iCuke 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. data/.gitignore +2 -0
  2. data/.gitmodules +3 -0
  3. data/README.rdoc +8 -7
  4. data/Rakefile +10 -30
  5. data/VERSION +1 -1
  6. data/app/.gitignore +3 -0
  7. data/app/LICENSE +20 -0
  8. data/app/Readme.markdown +3 -0
  9. data/app/Shared/AppDelegate_Shared.h +17 -0
  10. data/app/Shared/AppDelegate_Shared.m +25 -0
  11. data/app/{images/yellowslide.png → Shared/Icon.png} +0 -0
  12. data/app/Shared/ModalViewController.h +15 -0
  13. data/app/Shared/ModalViewController.m +96 -0
  14. data/app/Shared/TestViewController_Shared.h +15 -0
  15. data/app/Shared/TestViewController_Shared.m +43 -0
  16. data/app/{Info.plist → Shared/Universal-Info.plist} +17 -4
  17. data/app/Shared/Universal_Prefix.pch +8 -0
  18. data/app/Shared/main.m +14 -0
  19. data/app/Universal.xcodeproj/project.pbxproj +301 -0
  20. data/app/iPad/AppDelegate_Pad.h +15 -0
  21. data/app/iPad/AppDelegate_Pad.m +28 -0
  22. data/app/iPad/Default-Landscape.png +0 -0
  23. data/app/iPad/Default-Portrait.png +0 -0
  24. data/app/iPad/MainWindow_Pad.xib +343 -0
  25. data/app/iPad/TestViewController_Pad.h +15 -0
  26. data/app/iPad/TestViewController_Pad.m +52 -0
  27. data/app/iPhone/AppDelegate_Phone.h +15 -0
  28. data/app/iPhone/AppDelegate_Phone.m +28 -0
  29. data/app/{images/segment_search.png → iPhone/Default.png} +0 -0
  30. data/app/iPhone/MainWindow_Phone.xib +363 -0
  31. data/app/iPhone/TestViewController_Phone.h +15 -0
  32. data/app/iPhone/TestViewController_Phone.m +36 -0
  33. data/bin/.gitignore +1 -0
  34. data/bin/icuke +10 -0
  35. data/bin/icuke-module +17 -0
  36. data/ext/.gitignore +1 -0
  37. data/ext/Rakefile +6 -0
  38. data/ext/WaxSim/Simulator.h +31 -0
  39. data/ext/WaxSim/Simulator.m +131 -0
  40. data/ext/WaxSim/WaxSim.m +110 -0
  41. data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +238 -0
  42. data/ext/WaxSim/WaxSim_Prefix.pch +7 -0
  43. data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +126 -0
  44. data/ext/iCuke/Rakefile +14 -17
  45. data/ext/iCuke/libicuke-sdk3.1.dylib +0 -0
  46. data/ext/iCuke/libicuke-sdk4.0.dylib +0 -0
  47. data/ext/iCuke/libicuke.dylib +0 -0
  48. data/ext/iCuke/{DefaultsResponse.h → sdk3.1/DefaultsResponse.h} +0 -0
  49. data/ext/iCuke/{DefaultsResponse.m → sdk3.1/DefaultsResponse.m} +0 -0
  50. data/ext/iCuke/{EventResponse.h → sdk3.1/EventResponse.h} +0 -0
  51. data/ext/iCuke/{EventResponse.m → sdk3.1/EventResponse.m} +0 -0
  52. data/ext/iCuke/sdk3.1/ModuleResponse.h +5 -0
  53. data/ext/iCuke/sdk3.1/ModuleResponse.m +76 -0
  54. data/ext/iCuke/sdk3.1/Rakefile +20 -0
  55. data/ext/iCuke/{Recorder.h → sdk3.1/Recorder.h} +0 -0
  56. data/ext/iCuke/{Recorder.m → sdk3.1/Recorder.m} +0 -0
  57. data/ext/iCuke/{RecorderResponse.h → sdk3.1/RecorderResponse.h} +0 -0
  58. data/ext/iCuke/{RecorderResponse.m → sdk3.1/RecorderResponse.m} +0 -0
  59. data/ext/iCuke/{SynthesizeSingleton.h → sdk3.1/SynthesizeSingleton.h} +0 -0
  60. data/ext/iCuke/{ViewResponse.h → sdk3.1/ViewResponse.h} +0 -0
  61. data/ext/iCuke/{ViewResponse.m → sdk3.1/ViewResponse.m} +0 -0
  62. data/ext/iCuke/{Viewer.h → sdk3.1/Viewer.h} +0 -0
  63. data/ext/iCuke/sdk3.1/Viewer.m +203 -0
  64. data/ext/iCuke/{iCukeHTTPResponseHandler.h → sdk3.1/iCukeHTTPResponseHandler.h} +0 -0
  65. data/ext/iCuke/{iCukeHTTPResponseHandler.m → sdk3.1/iCukeHTTPResponseHandler.m} +0 -0
  66. data/ext/iCuke/{iCukeHTTPServer.h → sdk3.1/iCukeHTTPServer.h} +0 -0
  67. data/ext/iCuke/{iCukeHTTPServer.m → sdk3.1/iCukeHTTPServer.m} +0 -0
  68. data/ext/iCuke/{iCukeServer.h → sdk3.1/iCukeServer.h} +0 -2
  69. data/ext/iCuke/{iCukeServer.m → sdk3.1/iCukeServer.m} +22 -20
  70. data/ext/iCuke/{json → sdk3.1/json}/JSON.h +0 -0
  71. data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.h +0 -0
  72. data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.m +0 -0
  73. data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.h +0 -0
  74. data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.m +0 -0
  75. data/ext/iCuke/{json → sdk3.1/json}/SBJSON.h +0 -0
  76. data/ext/iCuke/{json → sdk3.1/json}/SBJSON.m +0 -0
  77. data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.h +0 -0
  78. data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.m +0 -0
  79. data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.h +0 -0
  80. data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.m +0 -0
  81. data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.h +0 -0
  82. data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.m +0 -0
  83. data/ext/iCuke/sdk4.0/DefaultsResponse.h +5 -0
  84. data/ext/iCuke/sdk4.0/DefaultsResponse.m +66 -0
  85. data/ext/iCuke/sdk4.0/EventResponse.h +5 -0
  86. data/ext/iCuke/sdk4.0/EventResponse.m +130 -0
  87. data/ext/iCuke/sdk4.0/ModuleResponse.h +5 -0
  88. data/ext/iCuke/sdk4.0/ModuleResponse.m +76 -0
  89. data/ext/iCuke/sdk4.0/Rakefile +20 -0
  90. data/ext/iCuke/sdk4.0/Recorder.h +17 -0
  91. data/ext/iCuke/sdk4.0/Recorder.m +90 -0
  92. data/ext/iCuke/sdk4.0/RecorderResponse.h +6 -0
  93. data/ext/iCuke/sdk4.0/RecorderResponse.m +68 -0
  94. data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +68 -0
  95. data/ext/iCuke/sdk4.0/ViewResponse.h +5 -0
  96. data/ext/iCuke/sdk4.0/ViewResponse.m +84 -0
  97. data/ext/iCuke/sdk4.0/Viewer.h +8 -0
  98. data/ext/iCuke/{Viewer.m → sdk4.0/Viewer.m} +14 -0
  99. data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +50 -0
  100. data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +381 -0
  101. data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +53 -0
  102. data/ext/iCuke/sdk4.0/iCukeHTTPServer.m +365 -0
  103. data/ext/iCuke/sdk4.0/iCukeServer.h +14 -0
  104. data/ext/iCuke/sdk4.0/iCukeServer.m +65 -0
  105. data/ext/iCuke/sdk4.0/json/JSON.h +50 -0
  106. data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +68 -0
  107. data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +53 -0
  108. data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +58 -0
  109. data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +55 -0
  110. data/ext/iCuke/sdk4.0/json/SBJSON.h +75 -0
  111. data/ext/iCuke/sdk4.0/json/SBJSON.m +212 -0
  112. data/ext/iCuke/sdk4.0/json/SBJsonBase.h +86 -0
  113. data/ext/iCuke/sdk4.0/json/SBJsonBase.m +78 -0
  114. data/ext/iCuke/sdk4.0/json/SBJsonParser.h +87 -0
  115. data/ext/iCuke/sdk4.0/json/SBJsonParser.m +475 -0
  116. data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +129 -0
  117. data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +228 -0
  118. data/features/iphone.feature +15 -0
  119. data/features/support/env.rb +1 -1
  120. data/iCuke.gemspec +118 -114
  121. data/lib/icuke/cucumber.rb +93 -64
  122. data/lib/icuke/screen.rb +110 -0
  123. data/lib/icuke/sdk.rb +134 -0
  124. data/lib/icuke/simulate.rb +9 -5
  125. data/lib/icuke/simulator.rb +10 -11
  126. data/lib/icuke/waxsim.rb +36 -0
  127. data/lib/icuke.rb +2 -1
  128. metadata +124 -129
  129. data/app/AlertsViewController.h +0 -59
  130. data/app/AlertsViewController.m +0 -341
  131. data/app/AppDelegate.h +0 -60
  132. data/app/AppDelegate.m +0 -101
  133. data/app/ButtonsViewController.h +0 -80
  134. data/app/ButtonsViewController.m +0 -448
  135. data/app/Constants.h +0 -58
  136. data/app/ControlsViewController.h +0 -72
  137. data/app/ControlsViewController.m +0 -379
  138. data/app/ImagesViewController.h +0 -62
  139. data/app/ImagesViewController.m +0 -137
  140. data/app/MainViewController.h +0 -57
  141. data/app/MainViewController.m +0 -262
  142. data/app/Picker/CustomPickerDataSource.h +0 -55
  143. data/app/Picker/CustomPickerDataSource.m +0 -135
  144. data/app/Picker/CustomView.h +0 -62
  145. data/app/Picker/CustomView.m +0 -119
  146. data/app/PickerViewController.h +0 -88
  147. data/app/PickerViewController.m +0 -402
  148. data/app/Prefix.pch +0 -5
  149. data/app/ReadMe.txt +0 -82
  150. data/app/SearchBarController.h +0 -58
  151. data/app/SearchBarController.m +0 -105
  152. data/app/SegmentViewController.h +0 -54
  153. data/app/SegmentViewController.m +0 -195
  154. data/app/TextFieldController.h +0 -67
  155. data/app/TextFieldController.m +0 -342
  156. data/app/TextViewController.h +0 -57
  157. data/app/TextViewController.m +0 -164
  158. data/app/ToolbarViewController.h +0 -74
  159. data/app/ToolbarViewController.m +0 -303
  160. data/app/TransitionViewController.h +0 -64
  161. data/app/TransitionViewController.m +0 -178
  162. data/app/UICatalog.xcodeproj/project.pbxproj +0 -615
  163. data/app/WebViewController.h +0 -57
  164. data/app/WebViewController.m +0 -173
  165. data/app/en.lproj/AlertsViewController.xib +0 -144
  166. data/app/en.lproj/ButtonsViewController.xib +0 -147
  167. data/app/en.lproj/ControlsViewController.xib +0 -147
  168. data/app/en.lproj/ImagesViewController.xib +0 -264
  169. data/app/en.lproj/Localizable.strings +0 -41
  170. data/app/en.lproj/MainWindow.xib +0 -306
  171. data/app/en.lproj/PickerViewController.xib +0 -415
  172. data/app/en.lproj/SearchBarController.xib +0 -142
  173. data/app/en.lproj/SegmentViewController.xib +0 -143
  174. data/app/en.lproj/TextFieldController.xib +0 -167
  175. data/app/en.lproj/TextViewController.xib +0 -149
  176. data/app/en.lproj/ToolbarViewController.xib +0 -491
  177. data/app/en.lproj/TransitionViewController.xib +0 -255
  178. data/app/en.lproj/WebViewController.xib +0 -141
  179. data/app/images/12-6AM.png +0 -0
  180. data/app/images/12-6PM.png +0 -0
  181. data/app/images/6-12AM.png +0 -0
  182. data/app/images/6-12PM.png +0 -0
  183. data/app/images/Default.png +0 -0
  184. data/app/images/Icon.png +0 -0
  185. data/app/images/UIButton_custom.png +0 -0
  186. data/app/images/blueButton.png +0 -0
  187. data/app/images/orangeslide.png +0 -0
  188. data/app/images/scene1.jpg +0 -0
  189. data/app/images/scene2.jpg +0 -0
  190. data/app/images/scene3.jpg +0 -0
  191. data/app/images/scene4.jpg +0 -0
  192. data/app/images/scene5.jpg +0 -0
  193. data/app/images/segment_check.png +0 -0
  194. data/app/images/segment_tools.png +0 -0
  195. data/app/images/slider_ball.png +0 -0
  196. data/app/images/whiteButton.png +0 -0
  197. data/app/main.m +0 -58
  198. data/features/uicatalog.feature +0 -20
  199. data/lib/icuke/com.apple.Accessibility.plist +0 -0
  200. data/lib/icuke/headless.rb +0 -54
  201. data/lib/icuke/xcode.rb +0 -164
@@ -0,0 +1,110 @@
1
+ #import <AppKit/AppKit.h>
2
+ #import "iPhoneSimulatorRemoteClient.h"
3
+ #import "Simulator.h"
4
+ #import "termios.h"
5
+
6
+ static BOOL gReset = false;
7
+
8
+ void printUsage();
9
+ void simulate(NSString *sdk, NSString *family, NSString *appPath, NSDictionary *environment, NSArray *additionalArgs);
10
+ void resetSignal(int sig);
11
+
12
+ int main(int argc, char *argv[]) {
13
+ signal(SIGQUIT, resetSignal);
14
+
15
+ int c;
16
+ char *sdk = nil;
17
+ char *family = nil;
18
+ char *appPath = nil;
19
+ NSMutableArray *additionalArgs = [NSMutableArray array];
20
+ NSMutableDictionary *environment = [NSMutableDictionary dictionary];
21
+ NSString *environment_variable;
22
+ NSArray *environment_variable_parts;
23
+
24
+ while ((c = getopt(argc, argv, "e:s:f:ah")) != -1) {
25
+ switch(c) {
26
+ case 'e':
27
+ environment_variable = [NSString stringWithCString:optarg encoding:NSUTF8StringEncoding];
28
+ environment_variable_parts = [environment_variable componentsSeparatedByString:@"="];
29
+
30
+ [environment setObject:[environment_variable_parts objectAtIndex:1] forKey:[environment_variable_parts objectAtIndex:0]];
31
+ break;
32
+ case 's':
33
+ sdk = optarg;
34
+ break;
35
+ case 'f':
36
+ family = optarg;
37
+ break;
38
+ case 'a':
39
+ fprintf(stdout, "Available SDK Versions.\n", optopt);
40
+ for (NSString *sdkVersion in [Simulator availableSDKs]) {
41
+ fprintf(stderr, " %s\n", [sdkVersion UTF8String]);
42
+ }
43
+ return 1;
44
+ case 'h':
45
+ printUsage();
46
+ return 1;
47
+ case '?':
48
+ if (optopt == 's' || optopt == 'f') {
49
+ fprintf(stderr, "Option -%c requires an argument.\n", optopt);
50
+ printUsage();
51
+ }
52
+ else {
53
+ fprintf(stderr, "Unknown option `-%c'.\n", optopt);
54
+ printUsage();
55
+ }
56
+ return 1;
57
+ break;
58
+ default:
59
+ abort ();
60
+ }
61
+
62
+ }
63
+
64
+ if (argc > optind) {
65
+ appPath = argv[optind++];
66
+
67
+ // Additional args are sent to app
68
+ for (int i = optind; i < argc; i++) {
69
+ [additionalArgs addObject:[NSString stringWithUTF8String:argv[i]]];
70
+ }
71
+ }
72
+ else {
73
+ fprintf(stderr, "No app-path was specified!\n");
74
+ printUsage();
75
+ return 1;
76
+ }
77
+
78
+
79
+ NSString *sdkString = sdk ? [NSString stringWithUTF8String:sdk] : nil;
80
+ NSString *familyString = family ? [NSString stringWithUTF8String:family] : nil;
81
+ NSString *appPathString = [NSString stringWithUTF8String:appPath];
82
+
83
+ simulate(sdkString, familyString, appPathString, environment, additionalArgs);
84
+
85
+ return 0;
86
+ }
87
+
88
+ void simulate(NSString *sdk, NSString *family, NSString *appPath, NSDictionary *environment, NSArray *additionalArgs) {
89
+ Simulator *simulator = [[Simulator alloc] initWithAppPath:appPath sdk:sdk family:family env:environment args:additionalArgs];
90
+ [simulator launch];
91
+
92
+ while (!gReset && [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:-1]]) ;
93
+
94
+ [simulator end];
95
+ }
96
+
97
+ void printUsage() {
98
+ fprintf(stderr, "usage: waxsim [options] app-path\n");
99
+ fprintf(stderr, "example: waxsim -s 2.2 /path/to/app.app\n");
100
+ fprintf(stderr, "Available options are:\n");
101
+ fprintf(stderr, "\t-s sdk\tVersion number of sdk to use (-s 3.1)\n");
102
+ fprintf(stderr, "\t-f family\tDevice to use (-f ipad)\n");
103
+ fprintf(stderr, "\t-e VAR=value\tEnvironment variable to set (-e CFFIXED_HOME=/tmp/iphonehome)\n");
104
+ fprintf(stderr, "\t-a \tAvailable SDK's\n");
105
+ fprintf(stderr, "\t-h \tPrints out this wonderful documentation!\n");
106
+ }
107
+
108
+ void resetSignal(int sig) {
109
+ gReset = true;
110
+ }
@@ -0,0 +1,238 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 45;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 048274F11126398C003DFACB /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048274F01126398C003DFACB /* AppKit.framework */; };
11
+ 048275B2112639B7003DFACB /* Simulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 048275B1112639B7003DFACB /* Simulator.m */; };
12
+ 048275C011263A74003DFACB /* iPhoneSimulatorRemoteClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */; };
13
+ 8DD76F9A0486AA7600D96B5E /* WaxSim.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* WaxSim.m */; settings = {ATTRIBUTES = (); }; };
14
+ 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
15
+ /* End PBXBuildFile section */
16
+
17
+ /* Begin PBXCopyFilesBuildPhase section */
18
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
19
+ isa = PBXCopyFilesBuildPhase;
20
+ buildActionMask = 8;
21
+ dstPath = /usr/share/man/man1/;
22
+ dstSubfolderSpec = 0;
23
+ files = (
24
+ );
25
+ runOnlyForDeploymentPostprocessing = 1;
26
+ };
27
+ /* End PBXCopyFilesBuildPhase section */
28
+
29
+ /* Begin PBXFileReference section */
30
+ 048274F01126398C003DFACB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
31
+ 048275AF112639B7003DFACB /* iPhoneSimulatorRemoteClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iPhoneSimulatorRemoteClient.h; path = iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h; sourceTree = "<group>"; };
32
+ 048275B0112639B7003DFACB /* Simulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Simulator.h; sourceTree = "<group>"; };
33
+ 048275B1112639B7003DFACB /* Simulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Simulator.m; sourceTree = "<group>"; };
34
+ 048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iPhoneSimulatorRemoteClient.framework; path = Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework; sourceTree = DEVELOPER_DIR; };
35
+ 08FB7796FE84155DC02AAC07 /* WaxSim.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WaxSim.m; sourceTree = "<group>"; };
36
+ 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
37
+ 32A70AAB03705E1F00C91783 /* WaxSim_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaxSim_Prefix.pch; sourceTree = "<group>"; };
38
+ 8DD76FA10486AA7600D96B5E /* waxsim */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = waxsim; sourceTree = BUILT_PRODUCTS_DIR; };
39
+ /* End PBXFileReference section */
40
+
41
+ /* Begin PBXFrameworksBuildPhase section */
42
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
43
+ isa = PBXFrameworksBuildPhase;
44
+ buildActionMask = 2147483647;
45
+ files = (
46
+ 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
47
+ 048274F11126398C003DFACB /* AppKit.framework in Frameworks */,
48
+ 048275C011263A74003DFACB /* iPhoneSimulatorRemoteClient.framework in Frameworks */,
49
+ );
50
+ runOnlyForDeploymentPostprocessing = 0;
51
+ };
52
+ /* End PBXFrameworksBuildPhase section */
53
+
54
+ /* Begin PBXGroup section */
55
+ 08FB7794FE84155DC02AAC07 /* WaxSim */ = {
56
+ isa = PBXGroup;
57
+ children = (
58
+ 08FB7795FE84155DC02AAC07 /* Source */,
59
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
60
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
61
+ );
62
+ name = WaxSim;
63
+ sourceTree = "<group>";
64
+ };
65
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
66
+ isa = PBXGroup;
67
+ children = (
68
+ 32A70AAB03705E1F00C91783 /* WaxSim_Prefix.pch */,
69
+ 08FB7796FE84155DC02AAC07 /* WaxSim.m */,
70
+ 048275B0112639B7003DFACB /* Simulator.h */,
71
+ 048275B1112639B7003DFACB /* Simulator.m */,
72
+ 048275AF112639B7003DFACB /* iPhoneSimulatorRemoteClient.h */,
73
+ );
74
+ name = Source;
75
+ sourceTree = "<group>";
76
+ };
77
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
78
+ isa = PBXGroup;
79
+ children = (
80
+ 048275BF11263A74003DFACB /* iPhoneSimulatorRemoteClient.framework */,
81
+ 048274F01126398C003DFACB /* AppKit.framework */,
82
+ 08FB779EFE84155DC02AAC07 /* Foundation.framework */,
83
+ );
84
+ name = "External Frameworks and Libraries";
85
+ sourceTree = "<group>";
86
+ };
87
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
88
+ isa = PBXGroup;
89
+ children = (
90
+ 8DD76FA10486AA7600D96B5E /* waxsim */,
91
+ );
92
+ name = Products;
93
+ sourceTree = "<group>";
94
+ };
95
+ /* End PBXGroup section */
96
+
97
+ /* Begin PBXNativeTarget section */
98
+ 8DD76F960486AA7600D96B5E /* WaxSim */ = {
99
+ isa = PBXNativeTarget;
100
+ buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WaxSim" */;
101
+ buildPhases = (
102
+ 8DD76F990486AA7600D96B5E /* Sources */,
103
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */,
104
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */,
105
+ );
106
+ buildRules = (
107
+ );
108
+ dependencies = (
109
+ );
110
+ name = WaxSim;
111
+ productInstallPath = "$(HOME)/bin";
112
+ productName = WaxSim;
113
+ productReference = 8DD76FA10486AA7600D96B5E /* waxsim */;
114
+ productType = "com.apple.product-type.tool";
115
+ };
116
+ /* End PBXNativeTarget section */
117
+
118
+ /* Begin PBXProject section */
119
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
120
+ isa = PBXProject;
121
+ buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WaxSim" */;
122
+ compatibilityVersion = "Xcode 3.1";
123
+ hasScannedForEncodings = 1;
124
+ mainGroup = 08FB7794FE84155DC02AAC07 /* WaxSim */;
125
+ projectDirPath = "";
126
+ projectRoot = "";
127
+ targets = (
128
+ 8DD76F960486AA7600D96B5E /* WaxSim */,
129
+ );
130
+ };
131
+ /* End PBXProject section */
132
+
133
+ /* Begin PBXSourcesBuildPhase section */
134
+ 8DD76F990486AA7600D96B5E /* Sources */ = {
135
+ isa = PBXSourcesBuildPhase;
136
+ buildActionMask = 2147483647;
137
+ files = (
138
+ 8DD76F9A0486AA7600D96B5E /* WaxSim.m in Sources */,
139
+ 048275B2112639B7003DFACB /* Simulator.m in Sources */,
140
+ );
141
+ runOnlyForDeploymentPostprocessing = 0;
142
+ };
143
+ /* End PBXSourcesBuildPhase section */
144
+
145
+ /* Begin XCBuildConfiguration section */
146
+ 1DEB927508733DD40010E9CD /* Debug */ = {
147
+ isa = XCBuildConfiguration;
148
+ buildSettings = {
149
+ ALWAYS_SEARCH_USER_PATHS = NO;
150
+ COPY_PHASE_STRIP = NO;
151
+ FRAMEWORK_SEARCH_PATHS = (
152
+ "$(inherited)",
153
+ "\"$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks\"",
154
+ );
155
+ GCC_DYNAMIC_NO_PIC = NO;
156
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
157
+ GCC_ENABLE_OBJC_GC = supported;
158
+ GCC_MODEL_TUNING = G5;
159
+ GCC_OPTIMIZATION_LEVEL = 0;
160
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
161
+ GCC_PREFIX_HEADER = WaxSim_Prefix.pch;
162
+ INSTALL_PATH = /usr/local/bin;
163
+ LD_RUNPATH_SEARCH_PATHS = /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks;
164
+ PRODUCT_NAME = waxsim;
165
+ };
166
+ name = Debug;
167
+ };
168
+ 1DEB927608733DD40010E9CD /* Release */ = {
169
+ isa = XCBuildConfiguration;
170
+ buildSettings = {
171
+ ALWAYS_SEARCH_USER_PATHS = NO;
172
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
173
+ FRAMEWORK_SEARCH_PATHS = (
174
+ "$(inherited)",
175
+ "\"$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks\"",
176
+ );
177
+ GCC_ENABLE_OBJC_GC = supported;
178
+ GCC_MODEL_TUNING = G5;
179
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
180
+ GCC_PREFIX_HEADER = WaxSim_Prefix.pch;
181
+ INSTALL_PATH = /usr/local/bin;
182
+ LD_RUNPATH_SEARCH_PATHS = /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks;
183
+ PRODUCT_NAME = waxsim;
184
+ };
185
+ name = Release;
186
+ };
187
+ 1DEB927908733DD40010E9CD /* Debug */ = {
188
+ isa = XCBuildConfiguration;
189
+ buildSettings = {
190
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
191
+ GCC_C_LANGUAGE_STANDARD = gnu99;
192
+ GCC_OPTIMIZATION_LEVEL = 0;
193
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
194
+ GCC_WARN_UNUSED_VARIABLE = YES;
195
+ ONLY_ACTIVE_ARCH = YES;
196
+ PREBINDING = NO;
197
+ SDKROOT = macosx10.6;
198
+ };
199
+ name = Debug;
200
+ };
201
+ 1DEB927A08733DD40010E9CD /* Release */ = {
202
+ isa = XCBuildConfiguration;
203
+ buildSettings = {
204
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
205
+ GCC_C_LANGUAGE_STANDARD = gnu99;
206
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
207
+ GCC_WARN_UNUSED_VARIABLE = YES;
208
+ ONLY_ACTIVE_ARCH = YES;
209
+ PREBINDING = NO;
210
+ SDKROOT = macosx10.6;
211
+ };
212
+ name = Release;
213
+ };
214
+ /* End XCBuildConfiguration section */
215
+
216
+ /* Begin XCConfigurationList section */
217
+ 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WaxSim" */ = {
218
+ isa = XCConfigurationList;
219
+ buildConfigurations = (
220
+ 1DEB927508733DD40010E9CD /* Debug */,
221
+ 1DEB927608733DD40010E9CD /* Release */,
222
+ );
223
+ defaultConfigurationIsVisible = 0;
224
+ defaultConfigurationName = Release;
225
+ };
226
+ 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WaxSim" */ = {
227
+ isa = XCConfigurationList;
228
+ buildConfigurations = (
229
+ 1DEB927908733DD40010E9CD /* Debug */,
230
+ 1DEB927A08733DD40010E9CD /* Release */,
231
+ );
232
+ defaultConfigurationIsVisible = 0;
233
+ defaultConfigurationName = Release;
234
+ };
235
+ /* End XCConfigurationList section */
236
+ };
237
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
238
+ }
@@ -0,0 +1,7 @@
1
+ //
2
+ // Prefix header for all source files of the 'WaxSim' target in the 'WaxSim' project.
3
+ //
4
+
5
+ #ifdef __OBJC__
6
+ #import <Foundation/Foundation.h>
7
+ #endif
@@ -0,0 +1,126 @@
1
+ #import <Cocoa/Cocoa.h>
2
+
3
+ /*
4
+ * File: /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
5
+ * Arch: Intel 80x86 (i386)
6
+ * Current version: 12.0.0, Compatibility version: 1.0.0
7
+ */
8
+
9
+ @class DTiPhoneSimulatorSession;
10
+
11
+ @protocol DTiPhoneSimulatorSessionDelegate
12
+
13
+ - (void) session: (DTiPhoneSimulatorSession *) session didEndWithError: (NSError *) error;
14
+ - (void) session: (DTiPhoneSimulatorSession *) session didStart: (BOOL) started withError: (NSError *) error;
15
+
16
+ @end
17
+
18
+ @interface DTiPhoneSimulatorApplicationSpecifier : NSObject <NSCopying>
19
+ {
20
+ NSString *_appPath;
21
+ NSString *_bundleID;
22
+ }
23
+
24
+ + (id) specifierWithApplicationPath: (NSString *) appPath;
25
+ + (id) specifierWithApplicationBundleIdentifier: (NSString *) bundleID;
26
+ - (NSString *) bundleID;
27
+ - (void) setBundleID: (NSString *) bundleId;
28
+ - (NSString *) appPath;
29
+ - (void) setAppPath: (NSString *) appPath;
30
+
31
+ @end
32
+
33
+ @interface DTiPhoneSimulatorSystemRoot : NSObject <NSCopying>
34
+ {
35
+ NSString *sdkRootPath;
36
+ NSString *sdkVersion;
37
+ NSString *sdkDisplayName;
38
+ }
39
+
40
+ + (id) defaultRoot;
41
+
42
+ + (id)rootWithSDKPath:(NSString *) path;
43
+ + (id)rootWithSDKVersion:(NSString *)version;
44
+
45
+ + (NSArray *) knownRoots;
46
+ - (id)initWithSDKPath:(id)fp8;
47
+ - (id)sdkDisplayName;
48
+ - (void)setSdkDisplayName:(id)fp8;
49
+ - (id)sdkVersion;
50
+ - (void)setSdkVersion:(id)fp8;
51
+ - (id)sdkRootPath;
52
+ - (void)setSdkRootPath:(id)fp8;
53
+
54
+ @end
55
+
56
+
57
+
58
+ @interface DTiPhoneSimulatorSessionConfig : NSObject <NSCopying>
59
+ {
60
+ NSString *_localizedClientName;
61
+ DTiPhoneSimulatorSystemRoot *_simulatedSystemRoot;
62
+ DTiPhoneSimulatorApplicationSpecifier *_applicationToSimulateOnStart;
63
+ NSArray *_simulatedApplicationLaunchArgs;
64
+ NSDictionary *_simulatedApplicationLaunchEnvironment;
65
+ BOOL _simulatedApplicationShouldWaitForDebugger;
66
+ NSString *_simulatedApplicationStdOutPath;
67
+ NSString *_simulatedApplicationStdErrPath;
68
+ }
69
+
70
+ + (NSString *) displayNameForDeviceFamily: (NSNumber *) family;
71
+
72
+ - (id)simulatedApplicationStdErrPath;
73
+ - (void)setSimulatedApplicationStdErrPath:(id)fp8;
74
+ - (id)simulatedApplicationStdOutPath;
75
+ - (void)setSimulatedApplicationStdOutPath:(id)fp8;
76
+ - (id)simulatedApplicationLaunchEnvironment;
77
+ - (void)setSimulatedApplicationLaunchEnvironment:(id)fp8;
78
+ - (id)simulatedApplicationLaunchArgs;
79
+ - (void)setSimulatedApplicationLaunchArgs:(id)fp8;
80
+
81
+ - (DTiPhoneSimulatorApplicationSpecifier *) applicationToSimulateOnStart;
82
+ - (void) setApplicationToSimulateOnStart: (DTiPhoneSimulatorApplicationSpecifier *) appSpec;
83
+ - (DTiPhoneSimulatorSystemRoot *) simulatedSystemRoot;
84
+ - (void) setSimulatedSystemRoot: (DTiPhoneSimulatorSystemRoot *) simulatedSystemRoot;
85
+
86
+ - (NSNumber *) simulatedDeviceFamily;
87
+ - (void) setSimulatedDeviceFamily: (NSNumber *) family;
88
+
89
+ - (BOOL) simulatedApplicationShouldWaitForDebugger;
90
+ - (void) setSimulatedApplicationShouldWaitForDebugger: (BOOL) waitForDebugger;
91
+
92
+ - (id)localizedClientName;
93
+ - (void)setLocalizedClientName:(id)fp8;
94
+
95
+ @end
96
+
97
+
98
+ @interface DTiPhoneSimulatorSession : NSObject {
99
+ NSString *_uuid;
100
+ id <DTiPhoneSimulatorSessionDelegate> _delegate;
101
+ NSNumber *_simulatedApplicationPID;
102
+ int _sessionLifecycleProgress;
103
+ NSTimer *_timeoutTimer;
104
+ DTiPhoneSimulatorSessionConfig *_sessionConfig;
105
+ struct ProcessSerialNumber _simulatorPSN;
106
+ }
107
+
108
+ - (BOOL) requestStartWithConfig: (DTiPhoneSimulatorSessionConfig *) config timeout: (NSTimeInterval) timeout error: (NSError **) outError;
109
+ - (void) requestEndWithTimeout: (NSTimeInterval) timeout;
110
+
111
+ - (id)sessionConfig;
112
+ - (void)setSessionConfig:(id)fp8;
113
+ - (id)timeoutTimer;
114
+ - (void)setTimeoutTimer:(id)fp8;
115
+ - (int)sessionLifecycleProgress;
116
+ - (void)setSessionLifecycleProgress:(int)fp8;
117
+ - (id)simulatedApplicationPID;
118
+ - (void)setSimulatedApplicationPID:(id)fp8;
119
+
120
+ - (id<DTiPhoneSimulatorSessionDelegate>) delegate;
121
+ - (void) setDelegate: (id<DTiPhoneSimulatorSessionDelegate>) delegate;
122
+
123
+ - (id)uuid;
124
+ - (void)setUuid:(id)fp8;
125
+
126
+ @end
data/ext/iCuke/Rakefile CHANGED
@@ -1,22 +1,19 @@
1
- require 'rake/clean'
1
+ require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'icuke', 'sdk')
2
2
 
3
- SDK_VERSION = '3.1.2'
4
- SDK_ROOT = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator#{SDK_VERSION}.sdk"
5
- CFLAGS = '-arch i386 -pipe -ggdb -std=c99 -DTARGET_OS_IPHONE'
6
- SDK_CFLAGS = "-isysroot #{SDK_ROOT} -F/System/Library/PrivateFrameworks -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000"
7
- CC = '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2'
3
+ SUPPORTED_SDKS = ['3.1', '4.0']
8
4
 
9
- rule '.o' => '.m' do |o|
10
- sh "#{CC} -I. -Ijson -c -o #{o.name} -fvisibility=hidden -x objective-c #{CFLAGS} #{SDK_CFLAGS} #{o.source}"
5
+ ICuke::SDK.minor_versions.each do |sdk|
6
+ unless SUPPORTED_SDKS.include?(sdk)
7
+ puts "Note: iCuke does not currently support version #{sdk} of the iPhone SDK, skipping"
8
+ next
9
+ end
10
+
11
+ task :install do
12
+ sh "cd sdk#{sdk} && rake"
13
+ end
14
+ task :clean do
15
+ sh "cd sdk#{sdk} && rake clean"
16
+ end
11
17
  end
12
18
 
13
- CLEAN.include('**/*.o')
14
-
15
- file 'libicuke.dylib' => FileList['**/*.m'].ext('.o') do |t|
16
- sh "#{CC} -dynamiclib -o #{t.name} -fvisibility=hidden #{CFLAGS} #{SDK_CFLAGS} -framework Foundation -framework GraphicsServices -framework UIKit -framework CFNetwork -framework AXRuntime #{t.prerequisites.join(' ')}"
17
- end
18
-
19
- CLEAN.include('libicuke.dylib')
20
-
21
- task :install => 'libicuke.dylib'
22
19
  task :default => :install
Binary file
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ #import "iCukeHTTPResponseHandler.h"
2
+
3
+ @interface ModuleResponse : iCukeHTTPResponseHandler {
4
+ }
5
+ @end
@@ -0,0 +1,76 @@
1
+ #import "ModuleResponse.h"
2
+ #import "iCukeHTTPServer.h"
3
+ #include <dlfcn.h>
4
+
5
+ @implementation ModuleResponse
6
+ + (void)load
7
+ {
8
+ [iCukeHTTPResponseHandler registerHandler:self];
9
+ }
10
+
11
+ + (BOOL)canHandleRequest:(CFHTTPMessageRef)aRequest
12
+ method:(NSString *)requestMethod
13
+ url:(NSURL *)requestURL
14
+ headerFields:(NSDictionary *)requestHeaderFields
15
+ {
16
+ return [requestURL.path isEqualToString:@"/module"];
17
+ }
18
+
19
+ - (void)startResponse
20
+ {
21
+ NSString *module = [[url query] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
22
+
23
+ if (!dlopen([module UTF8String], 0)) {
24
+ CFHTTPMessageRef response =
25
+ CFHTTPMessageCreateResponse(
26
+ kCFAllocatorDefault, 500, NULL, kCFHTTPVersion1_1);
27
+ CFHTTPMessageSetHeaderFieldValue(
28
+ response, (CFStringRef)@"Content-Type", (CFStringRef)@"text/plain");
29
+ CFHTTPMessageSetHeaderFieldValue(
30
+ response, (CFStringRef)@"Connection", (CFStringRef)@"close");
31
+ CFHTTPMessageSetBody(
32
+ response,
33
+ (CFDataRef)[[NSString stringWithFormat:
34
+ @"Unable to load module: %@, %s", module, dlerror()]
35
+ dataUsingEncoding:NSUTF8StringEncoding]);
36
+ CFDataRef headerData = CFHTTPMessageCopySerializedMessage(response);
37
+ @try
38
+ {
39
+ [fileHandle writeData:(NSData *)headerData];
40
+ }
41
+ @catch (NSException *exception)
42
+ {
43
+ // Ignore the exception, it normally just means the client
44
+ // closed the connection from the other end.
45
+ }
46
+ @finally
47
+ {
48
+ CFRelease(headerData);
49
+ CFRelease(response);
50
+ [server closeHandler:self];
51
+ }
52
+
53
+ return;
54
+ }
55
+
56
+ CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 200, NULL, kCFHTTPVersion1_1);
57
+ CFHTTPMessageSetHeaderFieldValue(response, (CFStringRef)@"Connection", (CFStringRef)@"close");
58
+
59
+ CFDataRef headerData = CFHTTPMessageCopySerializedMessage(response);
60
+
61
+ @try
62
+ {
63
+ [fileHandle writeData:(NSData *)headerData];
64
+ }
65
+ @catch (NSException *exception)
66
+ {
67
+ // Ignore the exception, it normally just means the client
68
+ // closed the connection from the other end.
69
+ }
70
+ @finally
71
+ {
72
+ CFRelease(headerData);
73
+ [server closeHandler:self];
74
+ }
75
+ }
76
+ @end
@@ -0,0 +1,20 @@
1
+ require File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'icuke', 'sdk')
2
+ require 'rake/clean'
3
+
4
+ version = '3.1'
5
+ ICuke::SDK.use_latest(version)
6
+
7
+ rule '.o' => '.m' do |o|
8
+ sh "#{ICuke::SDK.gcc} -c -o #{o.name} #{o.source}"
9
+ end
10
+
11
+ CLEAN.include('**/*.o')
12
+
13
+ file "../#{ICuke::SDK.dylib}" => FileList['**/*.m'].ext('.o') do |t|
14
+ sh "#{ICuke::SDK.ld} -dynamiclib -o #{t.name} -framework Foundation -framework GraphicsServices -framework UIKit -framework CFNetwork -framework AXRuntime #{t.prerequisites.join(' ')}"
15
+ end
16
+
17
+ CLEAN.include("../#{ICuke::SDK.dylib}")
18
+
19
+ task :install => "../#{ICuke::SDK.dylib}"
20
+ task :default => :install
File without changes
File without changes
File without changes
File without changes
File without changes