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

Side by Side Diff: mojo/public/mojo_application.gni

Issue 1227953007: Fix mojo_android_application when there is no java sources. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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/module_args/mojo.gni") 5 import("//build/module_args/mojo.gni")
6 import("mojo.gni") 6 import("mojo.gni")
7 import("mojo_sdk.gni") 7 import("mojo_sdk.gni")
8 8
9 # Generate a binary mojo application.The parameters of this template are those 9 # Generate a binary mojo application.The parameters of this template are those
10 # of a shared library. 10 # of a shared library.
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 # sources (optional): The c++ sources. 320 # sources (optional): The c++ sources.
321 # deps (optional): The c++ dependencies. 321 # deps (optional): The c++ dependencies.
322 # java_sources (optional): The java sources. 322 # java_sources (optional): The java sources.
323 # java_deps (optional): The java dependencies. 323 # java_deps (optional): The java dependencies.
324 # jni_package (optional): The c++ package for the generated jni headers. 324 # jni_package (optional): The c++ package for the generated jni headers.
325 # output_name (optional): override for the output file name 325 # output_name (optional): override for the output file name
326 # public_deps / data_deps (optional): Dependencies. 326 # public_deps / data_deps (optional): Dependencies.
327 template("mojo_android_application") { 327 template("mojo_android_application") {
328 shared_library_name = "__${target_name}_lib" 328 shared_library_name = "__${target_name}_lib"
329 library_basename = "lib${shared_library_name}.so" 329 library_basename = "lib${shared_library_name}.so"
330 generate_jni_name = "__${target_name}_jni" 330 if (defined(invoker.jni_package)) {
331 java_library_name = "__${target_name}_java" 331 assert(defined(invoker.java_sources))
332 generate_jni_name = "__${target_name}_jni"
333 }
334 if (defined(invoker.java_sources)) {
335 java_library_name = "__${target_name}_java"
336 }
332 android_standalone_library_name = "__${target_name}_java_lib" 337 android_standalone_library_name = "__${target_name}_java_lib"
333 dex_output_path = "${target_gen_dir}/${target_name}.dex" 338 dex_output_path = "${target_gen_dir}/${target_name}.dex"
334 zip_action_name = "__${target_name}_zip" 339 zip_action_name = "__${target_name}_zip"
335 zip_action_output = "${target_gen_dir}/${target_name}.zip" 340 zip_action_output = "${target_gen_dir}/${target_name}.zip"
336 copy_symbols_target = "__${target_name}_copy_symbols" 341 copy_symbols_target = "__${target_name}_copy_symbols"
337 final_target_name = target_name 342 final_target_name = target_name
338 343
339 if (defined(invoker.java_sources) && defined(invoker.jni_package)) { 344 if (defined(invoker.jni_package)) {
340 generate_jni(generate_jni_name) { 345 generate_jni(generate_jni_name) {
341 visibility = [ ":${shared_library_name}" ] 346 visibility = [ ":${shared_library_name}" ]
342 347
343 sources = invoker.java_sources 348 sources = invoker.java_sources
344 jni_package = invoker.jni_package 349 jni_package = invoker.jni_package
345 } 350 }
346 } 351 }
347 352
348 shared_library(shared_library_name) { 353 shared_library(shared_library_name) {
349 visibility = [ 354 visibility = [
350 ":${copy_symbols_target}", 355 ":${copy_symbols_target}",
351 ":${zip_action_name}", 356 ":${zip_action_name}",
352 ] 357 ]
353 358
354 if (defined(invoker.sources)) { 359 if (defined(invoker.sources)) {
355 sources = invoker.sources 360 sources = invoker.sources
356 } 361 }
357 362
358 deps = [] 363 deps = []
359 if (defined(invoker.java_sources) && defined(invoker.jni_package)) { 364 if (defined(invoker.jni_package)) {
360 deps += [ ":${generate_jni_name}" ] 365 deps += [ ":${generate_jni_name}" ]
361 } 366 }
362 if (defined(invoker.deps)) { 367 if (defined(invoker.deps)) {
363 deps += invoker.deps 368 deps += invoker.deps
364 } 369 }
365 } 370 }
366 371
367 copy(copy_symbols_target) { 372 copy(copy_symbols_target) {
368 visibility = [ ":${final_target_name}" ] 373 visibility = [ ":${final_target_name}" ]
369 deps = [ 374 deps = [
370 ":${shared_library_name}", 375 ":${shared_library_name}",
371 ] 376 ]
372 377
373 sources = [ 378 sources = [
374 "${root_out_dir}/${library_basename}", 379 "${root_out_dir}/${library_basename}",
375 ] 380 ]
376 outputs = [ 381 outputs = [
377 "${root_out_dir}/symbols/${library_basename}", 382 "${root_out_dir}/symbols/${library_basename}",
378 ] 383 ]
379 } 384 }
380 385
381 android_library(java_library_name) { 386 if (defined(invoker.java_sources)) {
382 visibility = [ ":*" ] 387 android_library(java_library_name) {
388 visibility = [ ":*" ]
383 389
384 if (defined(invoker.java_sources)) {
385 java_files = invoker.java_sources 390 java_files = invoker.java_sources
386 }
387 391
388 if (defined(invoker.java_deps)) { 392 if (defined(invoker.java_deps)) {
389 deps = invoker.java_deps 393 deps = invoker.java_deps
394 }
390 } 395 }
391 } 396 }
392 397
393 android_standalone_library(android_standalone_library_name) { 398 android_standalone_library(android_standalone_library_name) {
394 deps = [ 399 deps = []
395 ":${java_library_name}", 400
396 ] 401 if (defined(invoker.java_sources)) {
402 deps += [ ":${java_library_name}" ]
403 }
397 404
398 if (defined(invoker.java_deps)) { 405 if (defined(invoker.java_deps)) {
399 deps += invoker.java_deps 406 deps += invoker.java_deps
400 } 407 }
401 408
402 dex_path = dex_output_path 409 dex_path = dex_output_path
403 } 410 }
404 411
405 action(zip_action_name) { 412 action(zip_action_name) {
406 visibility = [ ":${final_target_name}" ] 413 visibility = [ ":${final_target_name}" ]
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 deps = [ 471 deps = [
465 ":${copy_symbols_target}", 472 ":${copy_symbols_target}",
466 ] 473 ]
467 474
468 public_deps = [ 475 public_deps = [
469 ":${zip_action_name}", 476 ":${zip_action_name}",
470 ] 477 ]
471 } 478 }
472 } 479 }
473 } 480 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698