| # Copyright 2018 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") |
| import("//chrome/android/modules/buildflags.gni") |
| |
| android_library("module_installer_java") { |
| java_files = [ |
| "java/src/org/chromium/components/module_installer/builder/Module.java", |
| "java/src/org/chromium/components/module_installer/builder/ModuleEngine.java", |
| "java/src/org/chromium/components/module_installer/engine/ApkEngine.java", |
| "java/src/org/chromium/components/module_installer/engine/FakeEngine.java", |
| "java/src/org/chromium/components/module_installer/engine/InstallEngine.java", |
| "java/src/org/chromium/components/module_installer/engine/EngineFactory.java", |
| "java/src/org/chromium/components/module_installer/engine/InstallListener.java", |
| "java/src/org/chromium/components/module_installer/engine/SplitCompatEngine.java", |
| "java/src/org/chromium/components/module_installer/engine/SplitCompatEngineFacade.java", |
| "java/src/org/chromium/components/module_installer/logger/Logger.java", |
| "java/src/org/chromium/components/module_installer/logger/PlayCoreLogger.java", |
| "java/src/org/chromium/components/module_installer/logger/SplitAvailabilityLogger.java", |
| "java/src/org/chromium/components/module_installer/logger/SplitInstallFailureLogger.java", |
| "java/src/org/chromium/components/module_installer/logger/SplitInstallStatusLogger.java", |
| "java/src/org/chromium/components/module_installer/observer/ActivityObserver.java", |
| "java/src/org/chromium/components/module_installer/observer/ActivityObserverFacade.java", |
| "java/src/org/chromium/components/module_installer/observer/InstallerObserver.java", |
| "java/src/org/chromium/components/module_installer/util/CrashKeyRecorder.java", |
| "java/src/org/chromium/components/module_installer/util/ModuleUtil.java", |
| "java/src/org/chromium/components/module_installer/util/SplitCompatInitializer.java", |
| "java/src/org/chromium/components/module_installer/util/Timer.java", |
| ] |
| |
| deps = [ |
| "//base:base_java", |
| "//base:jni_java", |
| "//components/crash/android:java", |
| "//third_party/google_android_play_core:com_google_android_play_core_java", |
| ] |
| |
| jar_excluded_patterns = [ "*/ModuleInstallerConfig.class" ] |
| |
| annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] |
| } |
| |
| junit_binary("module_installer_junit_tests") { |
| java_files = [ |
| "junit/src/org/chromium/components/module_installer/builder/ModuleEngineTest.java", |
| "junit/src/org/chromium/components/module_installer/builder/ModuleTest.java", |
| "junit/src/org/chromium/components/module_installer/engine/ApkEngineTest.java", |
| "junit/src/org/chromium/components/module_installer/engine/SplitCompatEngineTest.java", |
| "junit/src/org/chromium/components/module_installer/logger/LoggerTestUtil.java", |
| "junit/src/org/chromium/components/module_installer/logger/PlayCoreLoggerTest.java", |
| "junit/src/org/chromium/components/module_installer/logger/SplitInstallFailureLoggerTest.java", |
| "junit/src/org/chromium/components/module_installer/logger/SplitInstallStatusLoggerTest.java", |
| "junit/src/org/chromium/components/module_installer/observer/ActivityObserverTest.java", |
| ] |
| deps = [ |
| ":module_installer_java", |
| "//base:base_java", |
| "//base:base_java_test_support", |
| "//base:base_junit_test_support", |
| ] |
| } |
| |
| java_library("module_interface_java") { |
| supports_android = true |
| java_files = [ "java/src/org/chromium/components/module_installer/builder/ModuleInterface.java" ] |
| } |
| |
| java_annotation_processor("module_interface_processor") { |
| java_files = [ "java/src/org/chromium/components/module_installer/builder/ModuleInterfaceProcessor.java" ] |
| main_class = "org.chromium.components.module_installer.builder.ModuleInterfaceProcessor" |
| annotation_processor_deps = [ "//third_party/auto:auto_service_processor" ] |
| deps = [ |
| ":module_interface_java", |
| "//third_party/android_deps:com_squareup_javapoet_java", |
| "//third_party/auto:auto_service_java", |
| ] |
| } |
| |
| # Use this one if your target needs to depend on ModuleInstallerConfig. The |
| # other two targets are automatically added to build targets. |
| java_cpp_template("module_installer_build_config") { |
| # TODO(fredmello): Temporary code to keep downstream unbroken. |
| package_path = "org/chromium/components/module_installer/builder" |
| sources = [ |
| "build/ModuleInstallerConfig.template", |
| ] |
| } |
| |
| source_set("native") { |
| sources = [ |
| "module.cc", |
| ] |
| deps = [ |
| ":jni_headers", |
| "//base", |
| ] |
| |
| # The method used to load and register JNI for native libraries depends |
| # heavily on build type. |
| if (use_native_modules) { |
| defines = [ "LOAD_FROM_PARTITIONS" ] |
| } else if (is_component_build) { |
| defines = [ "LOAD_FROM_COMPONENTS" ] |
| } else { |
| defines = [ "LOAD_FROM_BASE_LIBRARY" ] |
| } |
| } |
| |
| generate_jni("jni_headers") { |
| sources = [ |
| "java/src/org/chromium/components/module_installer/builder/Module.java", |
| ] |
| } |