Skip to content

Commit

Permalink
Mass refactoring: Change JNI #includes to use full paths (services/, …
Browse files Browse the repository at this point in the history
…testing/, url/).

Using relative paths was causing build failures. To create this change:
  * find out/Debug -name *_jni.h -delete
  * find . -name BUILD.gn -exec sed -i '/jni_package =/d' {} \;
  * ninja $ALL_JNI_HEADERS minus third_party, chromecast, cronet, libassistant
  * refactor_jni_includes.py  --out-dir out/Debug
  * fix DEPs files manually
  * split out services/, testing/, url/ changes into this cl

See https://groups.google.com/a/chromium.org/forum/?#!topic/java/MEovGrAwbqI
for discussion on naming scheme.

Bug: 964169
Change-Id: If6cd9a19ccf2bf189aada4d165d89322ef429518
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671669
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671496}
  • Loading branch information
m0hamed authored and Commit Bot committed Jun 22, 2019
1 parent 3a066ef commit f1c56f2
Show file tree
Hide file tree
Showing 49 changed files with 28 additions and 50 deletions.
2 changes: 1 addition & 1 deletion services/data_decoder/DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include_rules = [
"+device/bluetooth/public",
"+gin",
"+jni",
"+services/data_decoder/public/cpp/android/safe_json_jni_headers",
"+skia",
"+third_party/libxml/chromium",
"+third_party/blink/public",
Expand Down
1 change: 0 additions & 1 deletion services/data_decoder/public/cpp/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ _jni_sources =

generate_jni("safe_json_jni_headers") {
sources = _jni_sources
jni_package = "data_decoder"
}

if (current_toolchain == default_toolchain) {
Expand Down
2 changes: 1 addition & 1 deletion services/data_decoder/public/cpp/json_sanitizer_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "base/strings/string_util.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "jni/JsonSanitizer_jni.h"
#include "services/data_decoder/public/cpp/android/safe_json_jni_headers/JsonSanitizer_jni.h"

using base::android::JavaParamRef;

Expand Down
1 change: 0 additions & 1 deletion services/device/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ if (is_android) {
sources = [
"android/java/src/org/chromium/services/device/InterfaceRegistrar.java",
]
jni_package = "device_service"
}

android_library("java") {
Expand Down
2 changes: 1 addition & 1 deletion services/device/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_rules = [
"+device",
"+jni",
"+services/device/usb/jni_headers",
"+services/network/public/cpp",
"+services/network/test",
"+ui/gfx/native_widget_types.h",
Expand Down
2 changes: 1 addition & 1 deletion services/device/device_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "jni/InterfaceRegistrar_jni.h"
#include "services/device/device_service_jni_headers/InterfaceRegistrar_jni.h"
#include "services/device/screen_orientation/screen_orientation_listener_android.h"
#else
#include "services/device/battery/battery_monitor_impl.h"
Expand Down
1 change: 0 additions & 1 deletion services/device/generic_sensor/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ if (is_android) {
visibility = [ ":generic_sensor" ]

sources = device_sensors_jni_sources
jni_package = "device"
}

android_library("java") {
Expand Down
2 changes: 1 addition & 1 deletion services/device/generic_sensor/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_rules = [
"+device/base/synchronization",
"+jni",
"+services/device/generic_sensor/jni_headers",
"+services/device/public/cpp/device_features.h",
"+third_party/sudden_motion_sensor",
"+ui/gfx/geometry"
Expand Down
2 changes: 1 addition & 1 deletion services/device/generic_sensor/platform_sensor_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "services/device/generic_sensor/platform_sensor_android.h"

#include "base/bind.h"
#include "jni/PlatformSensor_jni.h"
#include "services/device/generic_sensor/jni_headers/PlatformSensor_jni.h"

using base::android::AttachCurrentThread;
using base::android::JavaRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "base/android/scoped_java_ref.h"
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "jni/PlatformSensorProvider_jni.h"
#include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"
#include "services/device/generic_sensor/jni_headers/PlatformSensorProvider_jni.h"
#include "services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer.h"
#include "services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion.h"
#include "services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles.h"
Expand Down
1 change: 0 additions & 1 deletion services/device/geolocation/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ if (is_android) {
"android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java",
"android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java",
]
jni_package = "device"
}

android_library("geolocation_java") {
Expand Down
1 change: 0 additions & 1 deletion services/device/geolocation/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include_rules = [
"+chromeos",
"+components/location",
"+dbus",
"+jni",
"+net/base",
"+net/traffic_annotation",
"+services/network/public/cpp",
Expand Down
2 changes: 1 addition & 1 deletion services/device/geolocation/geolocation_provider_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "jni/LocationProviderFactory_jni.h"
#include "services/device/geolocation/geolocation_jni_headers/LocationProviderFactory_jni.h"
#endif

namespace device {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/location.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "jni/LocationProviderAdapter_jni.h"
#include "services/device/geolocation/geolocation_jni_headers/LocationProviderAdapter_jni.h"
#include "services/device/geolocation/location_provider_android.h"

using base::android::AttachCurrentThread;
Expand Down
1 change: 0 additions & 1 deletion services/device/screen_orientation/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ if (is_android) {
sources = [
"android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java",
]
jni_package = "screen_orientation"
}

android_library("java") {
Expand Down
1 change: 0 additions & 1 deletion services/device/screen_orientation/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include_rules = [
"+jni",
"+mojo/public/cpp/bindings",
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "base/android/jni_android.h"
#include "base/message_loop/message_loop.h"
#include "jni/ScreenOrientationListener_jni.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/device/screen_orientation/screen_orientation_jni_headers/ScreenOrientationListener_jni.h"

namespace device {

Expand Down
1 change: 0 additions & 1 deletion services/device/time_zone_monitor/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ if (is_android) {
sources = [
"android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java",
]
jni_package = "time_zone_monitor"
}

android_library("java") {
Expand Down
1 change: 0 additions & 1 deletion services/device/time_zone_monitor/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include_rules = [
"+chromeos/settings",
"+jni",
"+mojo/public/cpp/bindings",
"+ui/gfx/win",
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/android/jni_android.h"
#include "base/sequenced_task_runner.h"
#include "jni/TimeZoneMonitor_jni.h"
#include "services/device/time_zone_monitor/time_zone_monitor_jni_headers/TimeZoneMonitor_jni.h"

using base::android::JavaParamRef;

Expand Down
1 change: 0 additions & 1 deletion services/device/usb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ if (is_android) {

generate_jni("jni_headers") {
sources = java_sources_needing_jni
jni_package = "device"
}

android_library("java") {
Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include_rules = [
"+components/device_event_log",
"+chromeos",
"+dbus",
"+jni",
"+services/device/usb/jni_headers",

"+third_party/libusb",
]
2 changes: 1 addition & 1 deletion services/device/usb/usb_configuration_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "services/device/usb/usb_configuration_android.h"

#include "jni/ChromeUsbConfiguration_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbConfiguration_jni.h"
#include "services/device/usb/usb_interface_android.h"

using base::android::ScopedJavaLocalRef;
Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/usb_device_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/threading/thread_task_runner_handle.h"
#include "jni/ChromeUsbDevice_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbDevice_jni.h"
#include "services/device/usb/usb_configuration_android.h"
#include "services/device/usb/usb_descriptors.h"
#include "services/device/usb/usb_device_handle_android.h"
Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/usb_device_handle_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/bind.h"
#include "base/location.h"
#include "jni/ChromeUsbConnection_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbConnection_jni.h"
#include "services/device/usb/usb_device.h"
#include "services/device/usb/usb_service.h"

Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/usb_endpoint_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "services/device/usb/usb_endpoint_android.h"

#include "jni/ChromeUsbEndpoint_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbEndpoint_jni.h"

namespace device {

Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/usb_interface_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "services/device/usb/usb_interface_android.h"

#include "base/android/build_info.h"
#include "jni/ChromeUsbInterface_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbInterface_jni.h"
#include "services/device/usb/usb_endpoint_android.h"

using base::android::ScopedJavaLocalRef;
Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/usb_service_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/location.h"
#include "base/sequenced_task_runner.h"
#include "components/device_event_log/device_event_log.h"
#include "jni/ChromeUsbService_jni.h"
#include "services/device/usb/jni_headers/ChromeUsbService_jni.h"
#include "services/device/usb/usb_device_android.h"

using base::android::AttachCurrentThread;
Expand Down
1 change: 0 additions & 1 deletion services/device/vibration/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ generate_jni("vibration_jni_headers") {
sources = [
"java/src/org/chromium/device/vibration/VibrationManagerImpl.java",
]
jni_package = "vibration"
}

android_library("vibration_manager_java") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "jni/VibrationManagerImpl_jni.h"
#include "services/device/vibration/android/vibration_jni_headers/VibrationManagerImpl_jni.h"
#else
#include "services/device/vibration/vibration_manager_impl.h"
#endif
Expand Down
1 change: 0 additions & 1 deletion services/device/wake_lock/power_save_blocker/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ if (is_android) {
generate_jni("jni_headers") {
visibility = [ ":power_save_blocker" ]
sources = java_sources_needing_jni
jni_package = "device"
}

android_library("java") {
Expand Down
1 change: 0 additions & 1 deletion services/device/wake_lock/power_save_blocker/DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include_rules = [
"+chromeos/dbus",
"+dbus",
"+jni",
"+services/device/public",
"+ui/android",
"+ui/gfx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/sequenced_task_runner.h"
#include "jni/PowerSaveBlocker_jni.h"
#include "services/device/wake_lock/power_save_blocker/jni_headers/PowerSaveBlocker_jni.h"
#include "ui/android/view_android.h"

namespace device {
Expand Down
1 change: 0 additions & 1 deletion services/media_session/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"+jni",
"+ui/gfx",
"+third_party/skia/include",
]
1 change: 0 additions & 1 deletion services/media_session/public/cpp/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ _jni_sources = [

generate_jni("media_session_jni_headers") {
sources = _jni_sources
jni_package = "media_metadata"
}

if (current_toolchain == default_toolchain) {
Expand Down
2 changes: 1 addition & 1 deletion services/media_session/public/cpp/media_image_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "jni/MediaImage_jni.h"
#include "services/media_session/public/cpp/android/media_session_jni_headers/MediaImage_jni.h"

using base::android::ScopedJavaLocalRef;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "jni/MediaMetadata_jni.h"
#include "services/media_session/public/cpp/android/media_session_jni_headers/MediaMetadata_jni.h"
#include "services/media_session/public/cpp/media_image.h"

using base::android::ScopedJavaLocalRef;
Expand Down
1 change: 0 additions & 1 deletion services/shape_detection/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ if (is_android) {
sources = [
"android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
]
jni_package = "shape_detection"
}

android_library("shape_detection_java") {
Expand Down
1 change: 0 additions & 1 deletion services/shape_detection/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"+jni",
"+skia/ext/skia_utils_mac.h",
"+third_party/skia/include",
"+ui/gfx/codec",
Expand Down
2 changes: 1 addition & 1 deletion services/shape_detection/shape_detection_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "jni/InterfaceRegistrar_jni.h"
#include "services/shape_detection/shape_detection_jni_headers/InterfaceRegistrar_jni.h"
#endif

namespace shape_detection {
Expand Down
1 change: 0 additions & 1 deletion services/tracing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ if (is_android) {
sources = [
"android/test/src/org/chromium/tracing/UnwindTestHelper.java",
]
jni_package = "tracing"
}

android_library("tracing_test_helper_java") {
Expand Down
2 changes: 1 addition & 1 deletion services/tracing/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ include_rules = [

specific_include_rules = {
'stack_unwinder_android_unittest.cc': [
"+jni",
"+services/tracing/jni_headers",
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/task/post_task.h"
#include "base/test/scoped_task_environment.h"
#include "base/trace_event/cfi_backtrace_android.h"
#include "jni/UnwindTestHelper_jni.h"
#include "services/tracing/jni_headers/UnwindTestHelper_jni.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace tracing {
Expand Down
1 change: 0 additions & 1 deletion testing/android/native_test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ generate_jni("native_test_jni_headers") {
"java/src/org/chromium/native_test/MainRunner.java",
"java/src/org/chromium/native_test/NativeTest.java",
]
jni_package = "testing"
}
2 changes: 1 addition & 1 deletion testing/android/native_test/main_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/android/jni_array.h"
#include "base/logging.h"
#include "jni/MainRunner_jni.h"
#include "testing/android/native_test/native_test_jni_headers/MainRunner_jni.h"
#include "testing/android/native_test/native_test_util.h"

extern int main(int argc, char** argv);
Expand Down
2 changes: 1 addition & 1 deletion testing/android/native_test/native_test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "base/strings/stringprintf.h"
#include "base/test/test_support_android.h"
#include "gtest/gtest.h"
#include "jni/NativeTest_jni.h"
#include "testing/android/native_test/main_runner.h"
#include "testing/android/native_test/native_test_jni_headers/NativeTest_jni.h"
#include "testing/android/native_test/native_test_util.h"

using base::android::JavaParamRef;
Expand Down
1 change: 0 additions & 1 deletion url/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ if (is_android) {
sources = [
"android/java/src/org/chromium/url/IDNStringUtil.java",
]
jni_package = "url"
}
}

Expand Down
Loading

0 comments on commit f1c56f2

Please sign in to comment.