# Copyright 2015 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("//mojo/public/mojo_application.gni") import("//testing/test.gni") if (is_android) { import("//build/config/android/rules.gni") java_library_path = "$target_out_dir/java_library.dex.jar" mojo_android_application("resource_provider") { input_so = "$root_shlib_dir/${shlib_prefix}resource_provider_lib$shlib_extension" input_dex_jar = java_library_path deps = [ ":java_library", ":resource_provider_lib", "//third_party/icu:icudata", ] resources = [ "$root_out_dir/icudtl.dat" ] } shared_library("resource_provider_lib") { sources = [ "android/android_hooks.cc", "main.cc", ] deps = [ ":jni_headers", ":lib", "//base", "//components/resource_provider/public/interfaces", "//mojo/environment:chromium", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", "//url", ] } generate_jni("jni_headers") { sources = [ "android/java/org/chromium/resource_provider/Main.java", ] jni_package = "components/resource_provider" } android_library("java_classes") { java_files = [ "android/java/org/chromium/resource_provider/Main.java" ] deps = [ "//base:base_java", ] } android_standalone_library("java_library") { dex_path = java_library_path deps = [ ":java_classes", ] } } else { mojo_native_application("resource_provider") { sources = [ "main.cc", ] deps = [ ":lib", "//base", "//components/resource_provider/public/interfaces", "//mojo/environment:chromium", "//third_party/icu:icudata", "//url", ] resources = [ "$root_out_dir/icudtl.dat" ] } } source_set("lib") { sources = [ "file_utils.cc", "file_utils.h", "resource_provider_app.cc", "resource_provider_app.h", "resource_provider_impl.cc", "resource_provider_impl.h", ] deps = [ "//base", "//components/resource_provider/public/interfaces", "//mojo/application/public/cpp", "//mojo/common:common_base", "//mojo/platform_handle", "//url", ] } test("resource_provider_unittests") { sources = [ "file_utils_unittest.cc", ] deps = [ ":lib", "//base", "//base/test:test_config", "//components/resource_provider/public/interfaces", "//mojo/environment:chromium", "//testing/gtest", "//third_party/mojo/src/mojo/edk/test:run_all_unittests", "//url", ] } mojo_native_application("apptests") { output_name = "resource_provider_apptests" testonly = true sources = [ "resource_provider_apptest.cc", ] resources = [ "//components/test/data/resource_provider/sample", "//components/test/data/resource_provider/dir", ] deps = [ "//base", "//base/test:test_config", "//components/resource_provider/public/cpp", "//components/resource_provider/public/interfaces", "//mojo/application/public/cpp:test_support", "//mojo/platform_handle", ] data_deps = [ ":resource_provider" ] }