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
3 # found in the LICENSE file.
5 ios_app_script = "//build/config/ios/ios_app.py"
7 template("code_sign_ios") {
8 assert(defined(invoker.entitlements_path),
9 "The path to the entitlements .xcent file")
10 assert(defined(invoker.identity), "The code signing identity")
11 assert(defined(invoker.application_path), "The application to code sign")
12 assert(defined(invoker.deps))
16 invoker.entitlements_path,
19 _application_path = invoker.application_path
21 script = ios_app_script
24 "$_application_path/_CodeSignature/CodeResources",
30 rebase_path(invoker.application_path, root_build_dir),
34 rebase_path(invoker.entitlements_path, root_build_dir),
37 forward_variables_from(invoker,
46 # TODO(GYP), TODO(dpranke): Should this be part of ios_app?
47 template("resource_copy_ios") {
48 assert(defined(invoker.resources),
49 "The source list of resources to copy over")
50 assert(defined(invoker.bundle_directory),
51 "The directory within the bundle to place the sources in")
52 assert(defined(invoker.app_name), "The name of the application")
54 _bundle_directory = invoker.bundle_directory
55 _app_name = invoker.app_name
56 _resources = invoker.resources
59 set_sources_assignment_filter([])
62 "$root_build_dir/$_app_name.app/$_bundle_directory/{{source_file_part}}",
68 assert(defined(invoker.deps),
69 "Dependencies must be specified for $target_name")
70 assert(defined(invoker.info_plist),
71 "The application plist file must be specified for $target_name")
72 assert(defined(invoker.entitlements_path),
73 "The entitlements path must be specified for $target_name")
74 assert(defined(invoker.code_signing_identity),
75 "The code_signing_identity must be specified for $target_name")
77 # We just create a variable so we can use the same in interpolation
78 if (defined(invoker.app_name)) {
79 _app_name = invoker.app_name
81 _app_name = target_name
84 forward_variables_from(invoker, [ "testonly" ])
86 plist_gen_target_name = target_name + "_plist"
87 bin_gen_target_name = target_name + "_bin"
88 group_target_name = target_name
90 # Generate the executable
91 executable(bin_gen_target_name) {
92 visibility = [ ":$group_target_name" ]
94 output_name = "${_app_name}.app/${_app_name}"
96 if (defined(invoker.libs)) {
103 "QuartzCore.framework",
104 "OpenGLES.framework",
107 if (defined(invoker.deps)) {
112 deps += [ ":$plist_gen_target_name" ]
115 # Process the Info.plist
116 action(plist_gen_target_name) {
118 ":$group_target_name",
119 ":$bin_gen_target_name",
122 script = ios_app_script
128 "$root_build_dir/${_app_name}.app/Info.plist",
134 rebase_path(invoker.info_plist, root_build_dir),
136 rebase_path("$root_build_dir/${_app_name}.app"),
140 # Perform Code Signing
141 entitlements_path = invoker.entitlements_path
142 if (invoker.code_signing_identity != "") {
143 code_sign_gen_target_name = target_name + "_codesign"
144 code_sign_ios(code_sign_gen_target_name) {
145 visibility = [ ":$target_name" ]
147 identity = invoker.code_signing_identity
148 application_path = "$root_build_dir/$app_name.app"
150 ":$plist_gen_target_name",
151 ":$bin_gen_target_name",
155 # This avoids a potential unused variable warning in the caller.
156 entitlements_path = entitlements_path
162 ":$plist_gen_target_name",
163 ":$bin_gen_target_name",
165 if (invoker.code_signing_identity != "") {
166 deps += [ ":$code_sign_gen_target_name" ]