OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'chromium_code': 1, | 7 'chromium_code': 1, |
8 }, | 8 }, |
9 'includes': [ | 9 'includes': [ |
10 '../build/win_precompile.gypi', | 10 '../build/win_precompile.gypi', |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 ], | 642 ], |
643 }, | 643 }, |
644 ], | 644 ], |
645 }], | 645 }], |
646 # Special target to wrap a <(gtest_target_type)==shared_library | 646 # Special target to wrap a <(gtest_target_type)==shared_library |
647 # base_unittests into an android apk for execution. | 647 # base_unittests into an android apk for execution. |
648 # TODO(jrg): lib.target comes from _InstallableTargetInstallPath() | 648 # TODO(jrg): lib.target comes from _InstallableTargetInstallPath() |
649 # in the gyp make generator. What is the correct way to extract | 649 # in the gyp make generator. What is the correct way to extract |
650 # this path from gyp and into 'raw' for input to antfiles? | 650 # this path from gyp and into 'raw' for input to antfiles? |
651 # Hard-coding in the gypfile seems a poor choice. | 651 # Hard-coding in the gypfile seems a poor choice. |
652 # TODO(jrg): there has to be a shorter way to do all this. Try | |
653 # and convert this entire target cluster into ~5 lines that can be | |
654 # trivially copied to other projects with only a deps change, such | |
655 # as with a new gtest_target_type called | |
656 # 'shared_library_apk_wrapper' that does a lot of this magically. | |
657 ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { | 652 ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { |
658 'targets': [ | 653 'targets': [ |
659 { | 654 { |
660 'target_name': 'base_unittests_apk', | 655 'target_name': 'base_unittests_apk', |
661 'type': 'none', | 656 'type': 'none', |
662 'dependencies': [ | 657 'dependencies': [ |
663 'base', # So that android/java/java.gyp:base_java is built | 658 'base', # So that android/java/java.gyp:base_java is built |
664 'base_unittests', | 659 'base_unittests', |
665 ], | 660 ], |
666 'actions': [ | 661 'variables': { |
667 { | 662 'test_suite_name': 'base_unittests', |
668 # Generate apk files (including source and antfile) from | 663 'jar_name': 'chromium_base.jar', |
669 # a template, and builds them. | 664 }, |
670 'action_name': 'generate_and_build', | 665 'includes': [ '../build/apk_test.gypi' ], |
671 'inputs': [ | |
672 '../testing/android/AndroidManifest.xml', | |
673 '../testing/android/generate_native_test.py', | |
674 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', | |
675 '<(PRODUCT_DIR)/lib.java/chromium_base.jar' | |
676 ], | |
677 'outputs': [ | |
678 '<(PRODUCT_DIR)/base_unittests_apk/base_unittests-debug.apk', | |
679 ], | |
680 'action': [ | |
681 '../testing/android/generate_native_test.py', | |
682 '--native_library', | |
683 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', | |
684 '--jar', | |
685 '<(PRODUCT_DIR)/lib.java/chromium_base.jar', | |
686 '--output', | |
687 '<(PRODUCT_DIR)/base_unittests_apk', | |
688 '--ant-args', | |
689 '-DPRODUCT_DIR=<(PRODUCT_DIR)', | |
690 '--ant-compile' | |
691 ], | |
692 }, | |
693 ] | |
694 }], | 666 }], |
695 }], | 667 }], |
696 ], | 668 ], |
697 } | 669 } |
OLD | NEW |