summaryrefslogtreecommitdiffstats
path: root/testing/iossim
diff options
context:
space:
mode:
authorlliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 19:07:08 +0000
committerlliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 19:07:08 +0000
commit8176de1e9f4f9d1c1ad23e404a94545504811469 (patch)
tree307a9ae17005f992545e9a651a98f635f8463e51 /testing/iossim
parentdabfc8839c43d5a14b7443d458876b0447a69079 (diff)
downloadchromium_src-8176de1e9f4f9d1c1ad23e404a94545504811469.zip
chromium_src-8176de1e9f4f9d1c1ad23e404a94545504811469.tar.gz
chromium_src-8176de1e9f4f9d1c1ad23e404a94545504811469.tar.bz2
Get iossim to compile with Xcode 6.
Xcode 6 moved the location of the frameworks that iossim depends on and added a few new dependecies so new header files need to be generated by the gyp target. Note that this CL gets iossim to compile but iossim will not launch the Xcode 6 simulator. BUG=381213 NOTRY=true TBR=rohitrao@chromium.org Review URL: https://codereview.chromium.org/336773002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/iossim')
-rw-r--r--testing/iossim/iossim.gyp68
-rw-r--r--testing/iossim/iossim.mm60
2 files changed, 106 insertions, 22 deletions
diff --git a/testing/iossim/iossim.gyp b/testing/iossim/iossim.gyp
index af80adb..2c1bd83 100644
--- a/testing/iossim/iossim.gyp
+++ b/testing/iossim/iossim.gyp
@@ -12,9 +12,69 @@
'type': 'executable',
'variables': {
'developer_dir': '<!(xcode-select -print-path)',
- 'iphone_sim_path': '<(developer_dir)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks',
- 'other_frameworks_path': '<(developer_dir)/../OtherFrameworks'
+ # TODO(lliabraa): Once all builders are on Xcode 6 this variable can
+ # be removed and the actions gated by this variable can be run by
+ # default (crbug.com/385030).
+ 'xcode_version': '<!(xcodebuild -version | grep Xcode | awk \'{print $2}\')',
},
+ 'conditions': [
+ ['xcode_version=="6.0"', {
+ 'variables': {
+ 'iphone_sim_path': '<(developer_dir)/../SharedFrameworks',
+ },
+ 'defines': [
+ 'IOSSIM_USE_XCODE_6',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'generate_dvt_foundation_header',
+ 'inputs': [
+ '<(iphone_sim_path)/DVTFoundation.framework/Versions/Current/DVTFoundation',
+ '<(PRODUCT_DIR)/class-dump',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h'
+ ],
+ 'action': [
+ # Actions don't provide a way to redirect stdout, so a custom
+ # script is invoked that will execute the first argument and
+ # write the output to the file specified as the second argument.
+ # -I sorts classes, categories, and protocols by inheritance.
+ # -C <regex> only displays classes matching regular expression.
+ './redirect-stdout.sh',
+ '<(PRODUCT_DIR)/class-dump -CDVTStackBacktrace|DVTInvalidation|DVTMixIn <(iphone_sim_path)/DVTFoundation.framework',
+ '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h',
+ ],
+ 'message': 'Generating DVTFoundation.h',
+ },
+ {
+ 'action_name': 'generate_dvt_core_simulator',
+ 'inputs': [
+ '<(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework/Versions/Current/CoreSimulator',
+ '<(PRODUCT_DIR)/class-dump',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h'
+ ],
+ 'action': [
+ # Actions don't provide a way to redirect stdout, so a custom
+ # script is invoked that will execute the first argument and
+ # write the output to the file specified as the second argument.
+ # -I sorts classes, categories, and protocols by inheritance.
+ # -C <regex> only displays classes matching regular expression.
+ './redirect-stdout.sh',
+ '<(PRODUCT_DIR)/class-dump -CSim <(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework',
+ '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h',
+ ],
+ 'message': 'Generating CoreSimulator.h',
+ },
+ ], # actions
+ }, { # else: xcode_version!="6"
+ 'variables': {
+ 'iphone_sim_path': '<(developer_dir)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks',
+ },
+ }], # xcode_version
+ ], # conditions
'dependencies': [
'third_party/class-dump/class-dump.gyp:class-dump#host',
],
@@ -48,9 +108,9 @@
'<(PRODUCT_DIR)/class-dump -I -CiPhoneSimulator <(iphone_sim_path)/DVTiPhoneSimulatorRemoteClient.framework',
'<(INTERMEDIATE_DIR)/iossim/DVTiPhoneSimulatorRemoteClient.h',
],
- 'message': 'Generating header',
+ 'message': 'Generating DVTiPhoneSimulatorRemoteClient.h',
},
- ],
+ ], # actions
'xcode_settings': {
'ARCHS': ['x86_64'],
'WARNING_CFLAGS': [
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm
index 6187973..1b00e25 100644
--- a/testing/iossim/iossim.mm
+++ b/testing/iossim/iossim.mm
@@ -14,34 +14,53 @@
// For best results, the iOS Simulator application should not be running when
// iossim is invoked.
//
-// Headers for the iPhoneSimulatorRemoteClient framework used in this tool are
-// generated by class-dump, via GYP.
+// Headers for iPhoneSimulatorRemoteClient and other frameworks used in this
+// tool are generated by class-dump, via GYP.
// (class-dump is available at http://www.codethecode.com/projects/class-dump/)
//
// However, there are some forward declarations required to get things to
-// compile. Also, the DTiPhoneSimulatorSessionDelegate protocol is referenced
-// by the iPhoneSimulatorRemoteClient framework, but not defined in the object
-// file, so it must be defined here before importing the generated
-// iPhoneSimulatorRemoteClient.h file.
+// compile.
-@class DTiPhoneSimulatorApplicationSpecifier;
-@class DTiPhoneSimulatorSession;
-@class DTiPhoneSimulatorSessionConfig;
-@class DTiPhoneSimulatorSystemRoot;
-@class DVTiPhoneSimulatorMessenger;
+// TODO(lliabraa): Once all builders are on Xcode 6 this ifdef can be removed
+// (crbug.com/385030).
+#if defined(IOSSIM_USE_XCODE_6)
+@class DVTStackBacktrace;
+#import "DVTFoundation.h"
+#endif // IOSSIM_USE_XCODE_6
-@interface DVTPlatform : NSObject
-+ (BOOL)loadAllPlatformsReturningError:(id*)arg1;
+@protocol OS_dispatch_queue
@end
-
@protocol OS_dispatch_source
@end
-@protocol OS_dispatch_queue
+// TODO(lliabraa): Once all builders are on Xcode 6 this ifdef can be removed
+// (crbug.com/385030).
+#if defined(IOSSIM_USE_XCODE_6)
+@protocol OS_xpc_object
@end
-@class DVTDispatchLock;
+@protocol SimBridge;
+@class SimDeviceSet;
+@class SimDeviceType;
+@class SimRuntime;
+@class SimServiceConnectionManager;
+#import "CoreSimulator.h"
+#endif // IOSSIM_USE_XCODE_6
+
+@interface DVTPlatform : NSObject
++ (BOOL)loadAllPlatformsReturningError:(id*)arg1;
+@end
+@class DTiPhoneSimulatorApplicationSpecifier;
+@class DTiPhoneSimulatorSession;
+@class DTiPhoneSimulatorSessionConfig;
+@class DTiPhoneSimulatorSystemRoot;
@class DVTConfinementServiceConnection;
+@class DVTDispatchLock;
+@class DVTiPhoneSimulatorMessenger;
+@class DVTNotificationToken;
@class DVTTask;
-
+// The DTiPhoneSimulatorSessionDelegate protocol is referenced
+// by the iPhoneSimulatorRemoteClient framework, but not defined in the object
+// file, so it must be defined here before importing the generated
+// iPhoneSimulatorRemoteClient.h file.
@protocol DTiPhoneSimulatorSessionDelegate
- (void)session:(DTiPhoneSimulatorSession*)session
didEndWithError:(NSError*)error;
@@ -49,7 +68,6 @@
didStart:(BOOL)started
withError:(NSError*)error;
@end
-
#import "DVTiPhoneSimulatorRemoteClient.h"
// An undocumented system log key included in messages from launchd. The value
@@ -84,9 +102,14 @@ const NSTimeInterval kDefaultSessionStartTimeoutSeconds = 30;
const NSTimeInterval kOutputPollIntervalSeconds = 0.1;
// The path within the developer dir of the private Simulator frameworks.
+#if defined(IOSSIM_USE_XCODE_6)
+NSString* const kSimulatorFrameworkRelativePath =
+ @"../SharedFrameworks/DVTiPhoneSimulatorRemoteClient.framework";
+#else
NSString* const kSimulatorFrameworkRelativePath =
@"Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/"
@"DVTiPhoneSimulatorRemoteClient.framework";
+#endif // IOSSIM_USE_XCODE_6
NSString* const kDVTFoundationRelativePath =
@"../SharedFrameworks/DVTFoundation.framework";
NSString* const kDevToolsFoundationRelativePath =
@@ -757,6 +780,7 @@ int main(int argc, char* const argv[]) {
exit(kExitInitializationFailure);
}
}
+
if (!InitializeSimulatorUserHome(simHomePath)) {
LogError(@"Unable to initialize home directory for simulator: %@",
simHomePath);