Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: build/config/mac/rules.gni

Issue 1865483002: [Mac/GN] Initial framework bundle support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/base/BUILD.gn » ('j') | ui/base/BUILD.gn » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 mac_app_script = "//build/config/mac/mac_app.py" 5 mac_app_script = "//build/config/mac/mac_app.py"
6 6
7 template("code_sign_mac") { 7 template("code_sign_mac") {
8 assert(defined(invoker.entitlements_path), 8 assert(defined(invoker.entitlements_path),
9 "The path to the entitlements .xcent file") 9 "The path to the entitlements .xcent file")
10 assert(defined(invoker.identity), "The code signing identity") 10 assert(defined(invoker.identity), "The code signing identity")
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 # Top level group 205 # Top level group
206 206
207 group(group_gen_target_name) { 207 group(group_gen_target_name) {
208 deps = [ 208 deps = [
209 ":$copy_all_target_name", 209 ":$copy_all_target_name",
210 ] 210 ]
211 } 211 }
212 } 212 }
213
214 template("mac_framework") {
sdefresne 2016/04/05 22:59:48 Can you document the supported parameters, in part
Robert Sesek 2016/04/06 18:40:04 Done.
215 assert(defined(invoker.deps),
216 "Dependencies must be specified for $target_name")
217 assert(defined(invoker.info_plist),
218 "The Info.plist file must be specified for $target_name")
219
220 _target_name = target_name
221 _output_name = target_name
222 if (defined(invoker.output_name)) {
223 _output_name = invoker.output_name
224 }
225 _framework_name = _output_name + ".framework"
226 _framework_version = ""
227 if (defined(invoker.framework_version)) {
228 _framework_version = invoker.framework_version
229 }
230 _framework_target = _output_name + "_framework"
231
232 _shared_library_target = target_name + "_shared_library"
233 _shared_library_bundle_data = _shared_library_target + "_bundle_data"
234
235 shared_library(_shared_library_target) {
236 visibility = [ ":$_shared_library_bundle_data" ]
237 forward_variables_from(invoker,
238 "*",
239 [
240 "assert_no_deps",
241 "data_deps",
242 "info_plist",
243 "output_name",
244 "visibility",
245 ])
246 }
247
248 bundle_data(_shared_library_bundle_data) {
249 visibility = [ ":$_framework_target" ]
250 forward_variables_from(invoker, [ "testonly" ])
251 sources = [
252 "$root_out_dir/lib$_shared_library_target.dylib",
sdefresne 2016/04/05 22:59:48 Should use "${shlib_extension}" (from build/toolch
Robert Sesek 2016/04/06 18:40:03 Done.
253 ]
254 outputs = [
255 "{{bundle_executable_dir}}/$_output_name",
256 ]
257 public_deps = [
258 ":$_shared_library_target",
259 ]
260 }
261
262 _info_plist_target = target_name + "_info_plist"
263
264 # TODO(rsesek): Process Info.plist variables.
sdefresne 2016/04/05 22:59:48 Can you use what exists for iOS?
Robert Sesek 2016/04/06 18:40:03 We don't have the variables extracted for use yet,
265
266 _info_plist_bundle_data = _info_plist_target + "_bundle_data"
267
268 bundle_data(_info_plist_bundle_data) {
269 visibility = [ ":$_framework_target" ]
270 forward_variables_from(invoker, [ "testonly" ])
271 sources = [
272 invoker.info_plist,
273 ]
274 outputs = [
275 "{{bundle_root_dir}}/Info.plist",
276 ]
277 }
278
279 _package_target = target_name + "_package"
280
281 create_bundle(_framework_target) {
282 visibility = [ ":$_package_target" ]
283 forward_variables_from(invoker,
284 [
285 "data_deps",
286 "deps",
287 "public_deps",
288 "testonly",
289 "visibility",
290 ])
291
292 if (!defined(deps)) {
293 deps = []
294 }
295 deps += [
296 ":$_info_plist_bundle_data",
297 ":$_shared_library_bundle_data",
298 ]
299
300 bundle_root_dir = "$root_out_dir/$_framework_name"
301 if (_framework_version != "") {
302 bundle_root_dir += "/Versions/$_framework_version"
303 }
304 bundle_resources_dir = "$bundle_root_dir/Resources"
305 bundle_executable_dir = "$bundle_root_dir"
306 }
307
308 if (_framework_version != "") {
309 action(_package_target) {
310 visibility = [ ":$_target_name" ]
311 forward_variables_from(invoker, [ "testonly" ])
312 script = "$root_out_dir/gyp-mac-tool"
313 outputs = [
314 "$root_out_dir/$_framework_name/Versions/Current",
315 ]
316 args = [
317 "package-framework",
318 "$_framework_name",
319 "$_framework_version",
320 ]
321 deps = [
322 ":$_framework_target",
323 ]
324 }
325 } else {
326 group(_package_target) {
327 visibility = [ ":$_target_name" ]
328 forward_variables_from(invoker, [ "testonly" ])
329 deps = [
330 ":$_framework_target",
331 ]
332 }
333 }
334
335 group(_target_name) {
336 forward_variables_from(invoker,
337 [
338 "visbility",
339 "testonly",
340 ])
341 deps = [
342 ":$_package_target",
343 ]
344 }
345 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/BUILD.gn » ('j') | ui/base/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698