| 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 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 Loading... |
| 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") { |
| 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 output_name = rebase_path("$target_out_dir/$_output_name", root_build_dir) |
| 247 } |
| 248 |
| 249 bundle_data(_shared_library_bundle_data) { |
| 250 visibility = [ ":$_framework_target" ] |
| 251 forward_variables_from(invoker, [ "testonly" ]) |
| 252 sources = [ |
| 253 "$target_out_dir/lib$_output_name.dylib", |
| 254 ] |
| 255 outputs = [ |
| 256 "{{bundle_executable_dir}}/$_output_name", |
| 257 ] |
| 258 public_deps = [ |
| 259 ":$_shared_library_target", |
| 260 ] |
| 261 } |
| 262 |
| 263 _info_plist_target = target_name + "_info_plist" |
| 264 _info_plist_bundle_data = _info_plist_target + "_bundle_data" |
| 265 |
| 266 bundle_data(_info_plist_bundle_data) { |
| 267 visibility = [ ":$_framework_target" ] |
| 268 forward_variables_from(invoker, [ "testonly" ]) |
| 269 sources = [ |
| 270 invoker.info_plist, |
| 271 ] |
| 272 outputs = [ |
| 273 "{{bundle_root_dir}}/Info.plist", |
| 274 ] |
| 275 binary_compress = false |
| 276 } |
| 277 |
| 278 _package_target = target_name + "_package" |
| 279 |
| 280 create_bundle(_framework_target) { |
| 281 visibility = [ ":$_package_target" ] |
| 282 forward_variables_from(invoker, |
| 283 [ |
| 284 "data_deps", |
| 285 "deps", |
| 286 "public_deps", |
| 287 "testonly", |
| 288 "visibility", |
| 289 ]) |
| 290 |
| 291 if (!defined(deps)) { |
| 292 deps = [] |
| 293 } |
| 294 deps += [ |
| 295 ":$_info_plist_bundle_data", |
| 296 ":$_shared_library_bundle_data", |
| 297 ] |
| 298 |
| 299 bundle_root_dir = "$root_out_dir/$_framework_name" |
| 300 if (_framework_version != "") { |
| 301 bundle_root_dir += "/Versions/$_framework_version" |
| 302 } |
| 303 bundle_resources_dir = "$bundle_root_dir/Resources" |
| 304 bundle_executable_dir = "$bundle_root_dir" |
| 305 } |
| 306 |
| 307 if (_framework_version != "") { |
| 308 action(_package_target) { |
| 309 visibility = [ ":$_target_name" ] |
| 310 forward_variables_from(invoker, [ "testonly" ]) |
| 311 script = "$root_out_dir/gyp-mac-tool" |
| 312 outputs = [ |
| 313 "$root_out_dir/$_framework_name/Versions/Current", |
| 314 ] |
| 315 args = [ |
| 316 "package-framework", |
| 317 "$_framework_name", |
| 318 "$_framework_version", |
| 319 ] |
| 320 deps = [ |
| 321 ":$_framework_target", |
| 322 ] |
| 323 } |
| 324 } else { |
| 325 group(_package_target) { |
| 326 visibility = [ ":$_target_name" ] |
| 327 forward_variables_from(invoker, [ "testonly" ]) |
| 328 deps = [ |
| 329 ":$_framework_target", |
| 330 ] |
| 331 } |
| 332 } |
| 333 |
| 334 group(_target_name) { |
| 335 forward_variables_from(invoker, [ "visbility", "testonly" ]) |
| 336 deps = [ |
| 337 ":$_package_target", |
| 338 ] |
| 339 } |
| 340 } |
| OLD | NEW |