OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | |
7 'iphone_sim_path': '$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Deve
loper/Library/PrivateFrameworks', | |
8 'other_frameworks_path': '$(DEVELOPER_DIR)/../OtherFrameworks' | |
9 }, | |
10 'targets': [ | 6 'targets': [ |
11 { | 7 { |
12 'target_name': 'iossim', | 8 'target_name': 'iossim', |
13 'type': 'executable', | 9 'conditions': [ |
14 'dependencies': [ | 10 ['OS != "ios"', { |
15 '<(DEPTH)/testing/iossim/third_party/class-dump/class-dump.gyp:class-dum
p', | 11 'type': 'executable', |
16 ], | 12 'variables': { |
17 'include_dirs': [ | 13 'developer_dir': '<!(xcode-select -print-path)', |
18 '<(INTERMEDIATE_DIR)/iossim', | 14 'iphone_sim_path': '<(developer_dir)/Platforms/iPhoneSimulator.platf
orm/Developer/Library/PrivateFrameworks', |
19 ], | 15 'other_frameworks_path': '<(developer_dir)/../OtherFrameworks' |
20 'sources': [ | 16 }, |
21 'iossim.mm', | 17 'dependencies': [ |
22 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h', | 18 'third_party/class-dump/class-dump.gyp:class-dump', |
23 ], | |
24 'libraries': [ | |
25 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', | |
26 ], | |
27 'actions': [ | |
28 { | |
29 'action_name': 'generate_iphone_sim_header', | |
30 'inputs': [ | |
31 '<(iphone_sim_path)/iPhoneSimulatorRemoteClient.framework/Versions/C
urrent/iPhoneSimulatorRemoteClient', | |
32 '$(BUILD_DIR)/$(CONFIGURATION)/class-dump', | |
33 ], | 19 ], |
34 'outputs': [ | 20 'include_dirs': [ |
35 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h' | 21 '<(INTERMEDIATE_DIR)/iossim', |
36 ], | 22 ], |
37 'action': [ | 23 'sources': [ |
38 # Actions don't provide a way to redirect stdout, so a custom | 24 'iossim.mm', |
39 # script is invoked that will execute the first argument and write | |
40 # the output to the file specified as the second argument. | |
41 '<(DEPTH)/testing/iossim/redirect-stdout.sh', | |
42 '$(BUILD_DIR)/$(CONFIGURATION)/class-dump -CiPhoneSimulator <(iphone
_sim_path)/iPhoneSimulatorRemoteClient.framework', | |
43 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h', | 25 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h', |
44 ], | 26 ], |
45 'message': 'Generating header', | 27 'libraries': [ |
46 }, | 28 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', |
| 29 ], |
| 30 'actions': [ |
| 31 { |
| 32 'action_name': 'generate_iphone_sim_header', |
| 33 'inputs': [ |
| 34 '<(iphone_sim_path)/iPhoneSimulatorRemoteClient.framework/Versio
ns/Current/iPhoneSimulatorRemoteClient', |
| 35 '<(PRODUCT_DIR)/class-dump', |
| 36 ], |
| 37 'outputs': [ |
| 38 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h' |
| 39 ], |
| 40 'action': [ |
| 41 # Actions don't provide a way to redirect stdout, so a custom |
| 42 # script is invoked that will execute the first argument and wri
te |
| 43 # the output to the file specified as the second argument. |
| 44 './redirect-stdout.sh', |
| 45 '<(PRODUCT_DIR)/class-dump -CiPhoneSimulator <(iphone_sim_path)/
iPhoneSimulatorRemoteClient.framework', |
| 46 '<(INTERMEDIATE_DIR)/iossim/iPhoneSimulatorRemoteClient.h', |
| 47 ], |
| 48 'message': 'Generating header', |
| 49 }, |
| 50 ], |
| 51 }, { # else, OS == "ios" |
| 52 'type': 'none', |
| 53 'variables': { |
| 54 'ninja_output_dir': 'ninja-iossim', |
| 55 # Gyp to rerun |
| 56 're_run_targets': [ |
| 57 'testing/iossim/iossim.gyp', |
| 58 ], |
| 59 }, |
| 60 'includes': ['../../build/ios/mac_build.gypi'], |
| 61 'actions': [ |
| 62 { |
| 63 'action_name': 'compile iossim', |
| 64 'inputs': [], |
| 65 'outputs': [], |
| 66 'action': [ |
| 67 '<@(ninja_cmd)', |
| 68 'iossim', |
| 69 ], |
| 70 'message': 'Generating the iossim executable', |
| 71 }, |
| 72 { |
| 73 'action_name': 'copy iossim', |
| 74 'inputs': [ |
| 75 # TODO(ios): It should be possible to define the input, but |
| 76 # adding it causes gyp to complain about duplicate id. |
| 77 # '<(ninja_product_dir)/iossim', |
| 78 ], |
| 79 'outputs': [ |
| 80 '<(DEPTH)/xcodebuild/<(CONFIGURATION_NAME)/iossim', |
| 81 ], |
| 82 'action': [ |
| 83 'cp', |
| 84 '<(ninja_product_dir)/iossim', |
| 85 '<(DEPTH)/xcodebuild/<(CONFIGURATION_NAME)/iossim', |
| 86 ], |
| 87 }, |
| 88 ], |
| 89 }], |
47 ], | 90 ], |
48 }, | 91 }, |
49 ], | 92 ], |
50 } | 93 } |
OLD | NEW |