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

Side by Side Diff: build/config/android/rules.gni

Issue 1057783002: Add new GN junit binary template and new GYP java binary template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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("//base/android/linker/config.gni") 5 import("//base/android/linker/config.gni")
6 import("//build/config/android/config.gni") 6 import("//build/config/android/config.gni")
7 import("//build/config/android/internal_rules.gni") 7 import("//build/config/android/internal_rules.gni")
8 import("//tools/grit/grit_rule.gni") 8 import("//tools/grit/grit_rule.gni")
9 import("//tools/relocation_packer/config.gni") 9 import("//tools/relocation_packer/config.gni")
10 10
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 bypass_platform_checks = invoker.bypass_platform_checks 769 bypass_platform_checks = invoker.bypass_platform_checks
770 } 770 }
771 if (defined(invoker.testonly)) { 771 if (defined(invoker.testonly)) {
772 testonly = invoker.testonly 772 testonly = invoker.testonly
773 } 773 }
774 774
775 main_class = invoker.main_class 775 main_class = invoker.main_class
776 } 776 }
777 } 777 }
778 778
779 # Declare a Junit executable target
780 #
781 # This target creates an executable from java code for running as a junit test
782 # suite. The executable will be in the output folder's /bin/ directory.
783 #
784 # Variables
785 # deps: Specifies the dependencies of this target. Java targets in this list
786 # will be included in the executable (and the javac classpath).
787 #
788 # java_files: List of .java files included in this library.
789 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
790 # will be added to java_files and be included in this library.
791 # srcjars: List of srcjars to be included in this library, together with the
792 # ones obtained from srcjar_deps.
793 #
794 # chromium_code: If true, extra analysis warning/errors will be enabled.
795 #
796 # Example
797 # junit_binary("foo") {
798 # java_files = [ "org/chromium/foo/FooTest.java" ]
799 # deps = [ ":bar_java" ]
800 # }
801 template("junit_binary") {
802 set_sources_assignment_filter([])
803
804 java_binary(target_name) {
805 bypass_platform_checks = true
806 main_class = "org.chromium.testing.local.JunitTestMain"
807 testonly = true
808
809 if (defined(invoker.DEPRECATED_java_in_dir)) {
810 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
811 }
812 if (defined(invoker.chromium_code)) {
813 chromium_code = invoker.chromium_code
814 }
815 deps = [
816 "//testing/android/junit:junit_test_support",
817 "//third_party/junit",
818 "//third_party/mockito:mockito_java",
819 "//third_party/robolectric:robolectric_java",
820 "//third_party/robolectric:android-all-4.3_r2-robolectric-0",
821 ]
822 if (defined(invoker.deps)) {
823 deps += invoker.deps
824 }
825 if (defined(invoker.java_files)) {
826 java_files = invoker.java_files
827 }
828 if (defined(invoker.srcjar_deps)) {
829 srcjar_deps = invoker.srcjar_deps
830 }
831 if (defined(invoker.srcjars)) {
832 srcjars = invoker.srcjars
833 }
834 }
835 }
836
779 # Declare an java library target 837 # Declare an java library target
780 # 838 #
781 # Variables 839 # Variables
782 # deps: Specifies the dependencies of this target. Java targets in this list 840 # deps: Specifies the dependencies of this target. Java targets in this list
783 # will be added to the javac classpath. 841 # will be added to the javac classpath.
784 # 842 #
785 # java_files: List of .java files included in this library. 843 # java_files: List of .java files included in this library.
786 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars 844 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
787 # will be added to java_files and be included in this library. 845 # will be added to java_files and be included in this library.
788 # srcjars: List of srcjars to be included in this library, together with the 846 # srcjars: List of srcjars to be included in this library, together with the
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 template("uiautomator_test") { 1798 template("uiautomator_test") {
1741 set_sources_assignment_filter([]) 1799 set_sources_assignment_filter([])
1742 if (defined(invoker.testonly)) { 1800 if (defined(invoker.testonly)) {
1743 testonly = invoker.testonly 1801 testonly = invoker.testonly
1744 } 1802 }
1745 assert(target_name != "") 1803 assert(target_name != "")
1746 assert(invoker.deps != [] || true) 1804 assert(invoker.deps != [] || true)
1747 group(target_name) { 1805 group(target_name) {
1748 } 1806 }
1749 } 1807 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698