blob: 939dd7a12c9a324f49b2eeb7e7b66482babf1935 [file] [log] [blame]
# 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("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//remoting/android/client_java_tmpl.gni")
import("//remoting/android/remoting_apk_tmpl.gni")
import("//remoting/credits/credits.gni")
import("//remoting/remoting_options.gni")
import("//remoting/tools/build/remoting_localize.gni")
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chromoting/jni/Client.java",
"java/src/org/chromium/chromoting/jni/DirectoryService.java",
"java/src/org/chromium/chromoting/jni/GlDisplay.java",
"java/src/org/chromium/chromoting/jni/JniInterface.java",
"java/src/org/chromium/chromoting/jni/JniOAuthTokenGetter.java",
"java/src/org/chromium/chromoting/jni/NotificationPresenter.java",
"java/src/org/chromium/chromoting/jni/TouchEventData.java",
]
}
_raw_resources_base_dir = "$target_gen_dir/credits_resources_raw/res"
# The target is named this way, instead of "..._raw_resources", specifically
# to avoid matching any of the _java_resource_patterns items in
# build/config/android/internal_rules.gni
remoting_credits("credits_resources_raw") {
credits_gen_dir = "$_raw_resources_base_dir/raw"
gn_target = "//remoting/android:remoting_apk"
}
remoting_localize("remoting_apk_manifest") {
sources = [ "java/AndroidManifest.xml.jinja2" ]
locale_list = [ "en" ]
variables = [ rebase_path(branding_path) ]
output = "$root_gen_dir/remoting/android/{{source_name_part}}"
}
android_resources("remoting_android_client_java_resources") {
sources = [
"java/res/drawable-hdpi/empty_host_list.png",
"java/res/drawable-hdpi/ic_action_full_screen.png",
"java/res/drawable-hdpi/ic_action_keyboard.png",
"java/res/drawable-hdpi/ic_announcement.png",
"java/res/drawable-hdpi/ic_help.png",
"java/res/drawable-hdpi/ic_host_offline.png",
"java/res/drawable-hdpi/ic_host_online.png",
"java/res/drawable-hdpi/ic_menu.png",
"java/res/drawable-hdpi/ic_mouse.png",
"java/res/drawable-hdpi/ic_refresh.png",
"java/res/drawable-hdpi/ic_touch.png",
"java/res/drawable-ldpi/empty_host_list.png",
"java/res/drawable-mdpi/empty_host_list.png",
"java/res/drawable-mdpi/ic_action_full_screen.png",
"java/res/drawable-mdpi/ic_action_keyboard.png",
"java/res/drawable-mdpi/ic_announcement.png",
"java/res/drawable-mdpi/ic_help.png",
"java/res/drawable-mdpi/ic_host_offline.png",
"java/res/drawable-mdpi/ic_host_online.png",
"java/res/drawable-mdpi/ic_menu.png",
"java/res/drawable-mdpi/ic_mouse.png",
"java/res/drawable-mdpi/ic_refresh.png",
"java/res/drawable-mdpi/ic_touch.png",
"java/res/drawable-xhdpi/empty_host_list.png",
"java/res/drawable-xhdpi/ic_action_full_screen.png",
"java/res/drawable-xhdpi/ic_action_keyboard.png",
"java/res/drawable-xhdpi/ic_announcement.png",
"java/res/drawable-xhdpi/ic_help.png",
"java/res/drawable-xhdpi/ic_host_offline.png",
"java/res/drawable-xhdpi/ic_host_online.png",
"java/res/drawable-xhdpi/ic_menu.png",
"java/res/drawable-xhdpi/ic_mouse.png",
"java/res/drawable-xhdpi/ic_refresh.png",
"java/res/drawable-xhdpi/ic_touch.png",
"java/res/drawable-xxhdpi/empty_host_list.png",
"java/res/drawable-xxhdpi/ic_action_full_screen.png",
"java/res/drawable-xxhdpi/ic_action_keyboard.png",
"java/res/drawable-xxhdpi/ic_announcement.png",
"java/res/drawable-xxhdpi/ic_help.png",
"java/res/drawable-xxhdpi/ic_host_offline.png",
"java/res/drawable-xxhdpi/ic_host_online.png",
"java/res/drawable-xxhdpi/ic_menu.png",
"java/res/drawable-xxhdpi/ic_mouse.png",
"java/res/drawable-xxhdpi/ic_refresh.png",
"java/res/drawable-xxhdpi/ic_touch.png",
"java/res/drawable-xxxhdpi/empty_host_list.png",
"java/res/drawable-xxxhdpi/ic_action_full_screen.png",
"java/res/drawable-xxxhdpi/ic_action_keyboard.png",
"java/res/drawable-xxxhdpi/ic_announcement.png",
"java/res/drawable-xxxhdpi/ic_help.png",
"java/res/drawable-xxxhdpi/ic_host_offline.png",
"java/res/drawable-xxxhdpi/ic_host_online.png",
"java/res/drawable-xxxhdpi/ic_menu.png",
"java/res/drawable-xxxhdpi/ic_mouse.png",
"java/res/drawable-xxxhdpi/ic_refresh.png",
"java/res/drawable-xxxhdpi/ic_touch.png",
"java/res/layout/account_ui.xml",
"java/res/layout/credits.xml",
"java/res/layout/desktop.xml",
"java/res/layout/help.xml",
"java/res/layout/host_offline.xml",
"java/res/layout/host_online.xml",
"java/res/layout/main.xml",
"java/res/layout/navigation_list.xml",
"java/res/layout/navigation_list_item.xml",
"java/res/layout/navigation_list_separator.xml",
"java/res/layout/notification_dialog.xml",
"java/res/layout/pin_dialog.xml",
"java/res/menu/chromoting_actionbar.xml",
"java/res/menu/desktop_actionbar.xml",
"java/res/menu/help_actionbar.xml",
"java/res/menu/host_context_menu.xml",
"java/res/mipmap-anydpi-v26/ic_launcher.xml",
"java/res/mipmap-hdpi/ic_launcher.png",
"java/res/mipmap-hdpi/ic_launcher_foreground.png",
"java/res/mipmap-mdpi/ic_launcher.png",
"java/res/mipmap-mdpi/ic_launcher_foreground.png",
"java/res/mipmap-xhdpi/ic_launcher.png",
"java/res/mipmap-xhdpi/ic_launcher_foreground.png",
"java/res/mipmap-xxhdpi/ic_launcher.png",
"java/res/mipmap-xxhdpi/ic_launcher_foreground.png",
"java/res/mipmap-xxxhdpi/ic_launcher.png",
"java/res/mipmap-xxxhdpi/ic_launcher_foreground.png",
"java/res/values-sw600dp/dimens.xml",
"java/res/values-v17/styles.xml",
"java/res/values/dimens.xml",
"java/res/values/ic_launcher_background.xml",
]
sources += get_target_outputs(":credits_resources_raw")
deps = [
":credits_resources_raw",
"//remoting/resources:strings_java",
"//third_party/android_deps:android_support_v7_appcompat_java",
]
}
remoting_android_client_java_tmpl("remoting_android_client_java") {
# This should always be the public play services libraries since it is only
# used by non-_google apks. Explicitly use the string literal rather than
# google_play_services_package to ensure this.
play_services_package = "//third_party/android_deps"
}
remoting_apk_tmpl("remoting_apk") {
enable_lint = true
lint_baseline_file = "lint-baseline.xml"
lint_suppressions_file = "lint-suppressions.xml"
apk_name = "Chromoting"
sources = [ "//remoting/android/apk/src/org/chromium/chromoting/RemotingApplication.java" ]
deps = [
":remoting_android_client_java",
"//base:base_java",
"//net/android:net_java",
]
}
remoting_localize("remoting_test_apk_manifest") {
sources = [ "javatests/AndroidManifest.xml.jinja2" ]
locale_list = [ "en" ]
variables = [ rebase_path(branding_path) ]
output = "$root_gen_dir/remoting/android_test/{{source_name_part}}"
}
instrumentation_test_apk("remoting_test_apk") {
android_manifest = "$root_gen_dir/remoting/android_test/AndroidManifest.xml"
android_manifest_dep = ":remoting_test_apk_manifest"
apk_name = "ChromotingTest"
apk_under_test = ":remoting_apk"
sources = [
"javatests/src/org/chromium/chromoting/EventTest.java",
"javatests/src/org/chromium/chromoting/MockInputStub.java",
"javatests/src/org/chromium/chromoting/SwipePinchDetectorTest.java",
"javatests/src/org/chromium/chromoting/TapGestureDetectorTest.java",
"javatests/src/org/chromium/chromoting/TouchEventBuilder.java",
"javatests/src/org/chromium/chromoting/TouchEventGenerator.java",
"javatests/src/org/chromium/chromoting/TouchInputStrategyTest.java",
"javatests/src/org/chromium/chromoting/test/util/MutableReference.java",
]
deps = [
":remoting_android_client_java",
"//base:base_java",
"//base:base_java_test_support",
"//third_party/android_support_test_runner:runner_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/junit:junit",
]
if (!is_java_debug) {
proguard_enabled = true
}
}