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 forward_variables_from(invoker,
98 "all_dependent_configs",
99 "allow_circular_includes_from",
110 "forward_dependent_configs_from",
119 if (defined(invoker.libs)) {
126 "QuartzCore.framework",
127 "OpenGLES.framework",
130 if (defined(invoker.deps)) {
135 deps += [ ":$plist_gen_target_name" ]
138 # Process the Info.plist
139 action(plist_gen_target_name) {
141 ":$group_target_name",
142 ":$bin_gen_target_name",
145 script = ios_app_script
151 "$root_build_dir/${_app_name}.app/Info.plist",
157 rebase_path(invoker.info_plist, root_build_dir),
159 rebase_path("$root_build_dir/${_app_name}.app"),
163 # Perform Code Signing
164 entitlements_path = invoker.entitlements_path
165 if (invoker.code_signing_identity != "") {
166 code_sign_gen_target_name = target_name + "_codesign"
167 code_sign_ios(code_sign_gen_target_name) {
168 visibility = [ ":$target_name" ]
170 identity = invoker.code_signing_identity
171 application_path = "$root_build_dir/$app_name.app"
173 ":$plist_gen_target_name",
174 ":$bin_gen_target_name",
178 # This avoids a potential unused variable warning in the caller.
179 entitlements_path = entitlements_path
185 ":$plist_gen_target_name",
186 ":$bin_gen_target_name",
188 if (invoker.code_signing_identity != "") {
189 deps += [ ":$code_sign_gen_target_name" ]