# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/android/rules.gni") android_library("java") { sources = [ "android/java/src/org/chromium/chrome/browser/flags/BooleanCachedFieldTrialParameter.java", "android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java", "android/java/src/org/chromium/chrome/browser/flags/CachedFieldTrialParameter.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java", "android/java/src/org/chromium/chrome/browser/flags/DoubleCachedFieldTrialParameter.java", "android/java/src/org/chromium/chrome/browser/flags/FeatureParamUtils.java", "android/java/src/org/chromium/chrome/browser/flags/IntCachedFieldTrialParameter.java", "android/java/src/org/chromium/chrome/browser/flags/StringCachedFieldTrialParameter.java", ] deps = [ "//base:base_java", "//base:jni_java", "//chrome/browser/preferences:java", "//third_party/android_deps:androidx_annotation_annotation_java", ] srcjar_deps = [ ":chrome_android_java_switches_srcjar" ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } generate_jni("jni_headers") { sources = [ "android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java", ] } static_library("flags_android") { sources = [ "android/cached_feature_flags.cc", "android/cached_feature_flags.h", ] deps = [ ":jni_headers", "//base", "//content/public/common", ] } java_cpp_strings("chrome_android_java_switches_srcjar") { sources = [ "//chrome/common/chrome_switches.cc" ] template = "android/java_templates/ChromeSwitches.java.tmpl" } java_library("flags_junit_tests") { # Skip platform checks since Robolectric depends on requires_android targets. bypass_platform_checks = true testonly = true sources = [ "android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlagsAnnotationUnitTest.java", "android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlagsUnitTest.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureListWithProcessorUnitTest.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureListWithoutProcessorUnitTest.java", "android/java/src/org/chromium/chrome/browser/flags/FeatureParamUtilsUnitTest.java", ] deps = [ ":java", "//base:base_java", "//base:base_java_test_support", "//base:base_junit_test_support", "//base/test:test_support_java", "//chrome/test/android:chrome_java_test_support", "//third_party/android_deps:robolectric_all_java", "//third_party/junit", ] } android_library("javatests") { testonly = true sources = [ "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureListInstrumentationTest.java", "android/java/src/org/chromium/chrome/browser/flags/FieldTrialsInstrumentationTest.java", ] deps = [ ":java", "//base:base_java", "//base:base_java_test_support", "//base/test:test_support_java", "//chrome/android:chrome_java", "//chrome/test/android:chrome_java_test_support", "//third_party/android_deps:androidx_test_runner_java", "//third_party/android_sdk:android_test_mock_java", "//third_party/android_support_test_runner:runner_java", "//third_party/junit", "//third_party/mockito:mockito_java", ] }