OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import("//build/config/ios/ios_sdk.gni") | 5 import("//build/config/ios/ios_sdk.gni") |
6 | 6 |
7 # TODO(crbug.com/297668): refactor this template to extract common behaviour | 7 # TODO(crbug.com/297668): refactor this template to extract common behaviour |
8 # between OS X and iOS bundle generation, then create a generic "app" template | 8 # between OS X and iOS bundle generation, then create a generic "app" template |
9 # that forward to "executable" on all platform except iOS/OS X. | 9 # that forward to "executable" on all platform except iOS/OS X. |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 "info_plist", | 107 "info_plist", |
108 "output_name", | 108 "output_name", |
109 "visibility", | 109 "visibility", |
110 ]) | 110 ]) |
111 | 111 |
112 output_name = rebase_path("$target_gen_dir/$_output_name", root_build_dir) | 112 output_name = rebase_path("$target_gen_dir/$_output_name", root_build_dir) |
113 if (!defined(libs)) { | 113 if (!defined(libs)) { |
114 libs = [] | 114 libs = [] |
115 } | 115 } |
116 libs += [ "UIKit.framework" ] | 116 libs += [ "UIKit.framework" ] |
117 | |
118 # TODO(crbug.com/599203) - iossim should probably be a data dependency | |
119 # of the create_bundle(target_name) target instead but at the moment | |
120 # create_bundle() is ignoring data_deps. | |
121 if (use_ios_simulator) { | |
122 if (!defined(data_deps)) { | |
123 data_deps = [] | |
124 } | |
125 data_deps += [ "//testing/iossim(${host_toolchain})" ] | |
126 } | |
127 } | 117 } |
128 | 118 |
129 bundle_data(_bundle_data_executable) { | 119 bundle_data(_bundle_data_executable) { |
130 forward_variables_from(invoker, [ "testonly" ]) | 120 forward_variables_from(invoker, [ "testonly" ]) |
131 visibility = [ ":$_target_name" ] | 121 visibility = [ ":$_target_name" ] |
132 sources = [ | 122 sources = [ |
133 "$target_gen_dir/$_output_name", | 123 "$target_gen_dir/$_output_name", |
134 ] | 124 ] |
135 outputs = [ | 125 outputs = [ |
136 "{{bundle_executable_dir}}/$_output_name", | 126 "{{bundle_executable_dir}}/$_output_name", |
(...skipping 14 matching lines...) Expand all Loading... |
151 ]) | 141 ]) |
152 | 142 |
153 if (!defined(deps)) { | 143 if (!defined(deps)) { |
154 deps = [] | 144 deps = [] |
155 } | 145 } |
156 deps += [ | 146 deps += [ |
157 ":$_bundle_data_executable", | 147 ":$_bundle_data_executable", |
158 ":$_bundle_data_info_plist", | 148 ":$_bundle_data_info_plist", |
159 ] | 149 ] |
160 | 150 |
| 151 if (use_ios_simulator) { |
| 152 if (!defined(data_deps)) { |
| 153 data_deps = [] |
| 154 } |
| 155 data_deps += [ "//testing/iossim(${host_toolchain})" ] |
| 156 } |
| 157 |
161 bundle_root_dir = "$root_out_dir/$_output_name.app" | 158 bundle_root_dir = "$root_out_dir/$_output_name.app" |
162 bundle_resources_dir = bundle_root_dir | 159 bundle_resources_dir = bundle_root_dir |
163 bundle_executable_dir = bundle_root_dir | 160 bundle_executable_dir = bundle_root_dir |
164 bundle_plugins_dir = "$bundle_root_dir/Plugins" | 161 bundle_plugins_dir = "$bundle_root_dir/Plugins" |
165 } | 162 } |
166 | 163 |
167 # TODO(crbug.com/297668): | 164 # TODO(crbug.com/297668): |
168 # - add support for codesigning, | 165 # - add support for codesigning, |
169 # - find a way to make "ninja -C out/Default base_unittests.app" work as | 166 # - find a way to make "ninja -C out/Default base_unittests.app" work as |
170 # an alias to "ninja -C out/Default base_unittests" (for convenience | 167 # an alias to "ninja -C out/Default base_unittests" (for convenience |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 220 |
224 sources = [ | 221 sources = [ |
225 "$target_gen_dir/$_nib_filename/objects.nib", | 222 "$target_gen_dir/$_nib_filename/objects.nib", |
226 "$target_gen_dir/$_nib_filename/runtime.nib", | 223 "$target_gen_dir/$_nib_filename/runtime.nib", |
227 ] | 224 ] |
228 outputs = [ | 225 outputs = [ |
229 "{{bundle_resources_dir}}/$_nib_filename/{{source_file_part}}", | 226 "{{bundle_resources_dir}}/$_nib_filename/{{source_file_part}}", |
230 ] | 227 ] |
231 } | 228 } |
232 } | 229 } |
OLD | NEW |