mbonadei 438062bd43 Reland of Fixing package-boundary violation with srjar_deps (patchset #1 id:1 of https://codereview.webrtc.org/2617533005/ )
Reason for revert:
Skipping the build of the target "//webrtc/modules/audio_device:audio_device_java" when building webrtc with chromium.

This was causing a failure because in that case it is not possible to refer to the script used by the template "android_shared_srcjar" with an absolute path (which seems to be necessary since the script attribute of action is relative to the invocation target and not to the template declaration).

Original issue's description:
> Revert of Fixing package-boundary violation with srjar_deps (patchset #5 id:80001 of https://codereview.webrtc.org/2610823002/ )
>
> Reason for revert:
> This CL is breaking a chromium.webrtc.fyi: https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Builder/builds/226
>
> I am trying to reproduce the issue on my local machine and I will try to re-land the CL later.
>
> Original issue's description:
> > Fixing package-boundary violation with srjar_deps
> >
> > Without the usage of the srcjar_deps attribute we were not able to
> > include .java files from other packages without violating the package
> > boundary contraint.
> >
> > As an example, in this CL the target "libjingle_peerconnection_java" was
> > directly including .java files from another packages in its "java_files"
> > attribute.
> >
> > Using srcjar_deps we are able to declare the dependency of the target
> > avoiding to create hidden dependencies in the codebase.
> >
> > This is not fixing the webrtc:6356 bug directly but it is a first step to
> > include ThreadUtils classes in libjingle_peerconnection_client_java.jar
> > again.
> >
> > It seems also to be related to the chromium:648244 bug. This can be solved
> > if we can find a way to perform srcjar generation in the android_library
> > target without changing the semantic of the target.
> >
> > BUG=webrtc:6356
> >
> > Review-Url: https://codereview.webrtc.org/2610823002
> > Cr-Commit-Position: refs/heads/master@{#15914}
> > Committed: 10a76592a7
>
> TBR=kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6356
>
> Review-Url: https://codereview.webrtc.org/2617533005
> Cr-Commit-Position: refs/heads/master@{#15915}
> Committed: eb731ed09e

TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6356

Review-Url: https://codereview.webrtc.org/2612953004
Cr-Commit-Position: refs/heads/master@{#15958}
2017-01-09 10:37:21 +00:00

218 lines
7.4 KiB
Plaintext

# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("//webrtc/build/webrtc.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
config("libjingle_peerconnection_jni_warnings_config") {
# The warnings below are enabled by default. Since GN orders compiler flags
# for a target before flags from configs, the only way to disable such
# warnings is by having them in a separate config, loaded from the target.
if (!is_win) {
cflags = [
"-Wno-sign-compare",
"-Wno-unused-variable",
]
}
}
rtc_static_library("libjingle_peerconnection_jni") {
sources = [
"src/jni/androidhistogram_jni.cc",
"src/jni/androidmediacodeccommon.h",
"src/jni/androidmediadecoder_jni.cc",
"src/jni/androidmediadecoder_jni.h",
"src/jni/androidmediaencoder_jni.cc",
"src/jni/androidmediaencoder_jni.h",
"src/jni/androidnetworkmonitor_jni.cc",
"src/jni/androidnetworkmonitor_jni.h",
"src/jni/androidvideotracksource.cc",
"src/jni/androidvideotracksource.h",
"src/jni/androidvideotracksource_jni.cc",
"src/jni/classreferenceholder.cc",
"src/jni/classreferenceholder.h",
"src/jni/jni_helpers.cc",
"src/jni/jni_helpers.h",
"src/jni/native_handle_impl.cc",
"src/jni/native_handle_impl.h",
"src/jni/peerconnection_jni.cc",
"src/jni/surfacetexturehelper_jni.cc",
"src/jni/surfacetexturehelper_jni.h",
]
configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [
"//build/config/clang:extra_warnings",
"//build/config/clang:find_bad_constructs",
]
}
# TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_win) {
cflags += [
"/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
"/wd4389", # signed/unsigned mismatch.
]
}
deps = [
"//webrtc/api:libjingle_peerconnection",
]
if (rtc_build_libyuv) {
deps += [ "$rtc_libyuv_dir" ]
public_deps = [
"$rtc_libyuv_dir",
]
} else {
# Need to add a directory normally exported by libyuv.
include_dirs = [ "$rtc_libyuv_dir/include" ]
}
}
rtc_static_library("libjingle_peerconnection_metrics_default_jni") {
sources = [
"src/jni/androidmetrics_jni.cc",
]
configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
deps = [
"//webrtc/api:libjingle_peerconnection",
"//webrtc/system_wrappers:field_trial_default",
"//webrtc/system_wrappers:metrics_default",
]
}
rtc_shared_library("libjingle_peerconnection_so") {
sources = [
"src/jni/jni_onload.cc",
]
suppressed_configs += [ "//build/config/android:hide_native_jni_exports" ]
deps = [
":libjingle_peerconnection_jni",
":libjingle_peerconnection_metrics_default_jni",
"//webrtc/api:libjingle_peerconnection",
]
output_extension = "so"
}
android_library("libjingle_peerconnection_java") {
java_files = [
"api/org/webrtc/AudioSource.java",
"api/org/webrtc/AudioTrack.java",
"api/org/webrtc/CallSessionFileRotatingLogSink.java",
"api/org/webrtc/Camera1Capturer.java",
"api/org/webrtc/Camera1Enumerator.java",
"api/org/webrtc/Camera1Session.java",
"api/org/webrtc/Camera2Capturer.java",
"api/org/webrtc/Camera2Enumerator.java",
"api/org/webrtc/Camera2Session.java",
"api/org/webrtc/CameraCapturer.java",
"api/org/webrtc/CameraEnumerationAndroid.java",
"api/org/webrtc/CameraEnumerator.java",
"api/org/webrtc/CameraSession.java",
"api/org/webrtc/CameraVideoCapturer.java",
"api/org/webrtc/DataChannel.java",
"api/org/webrtc/EglBase.java",
"api/org/webrtc/EglBase10.java",
"api/org/webrtc/EglBase14.java",
"api/org/webrtc/EglRenderer.java",
"api/org/webrtc/FileVideoCapturer.java",
"api/org/webrtc/GlRectDrawer.java",
"api/org/webrtc/GlShader.java",
"api/org/webrtc/GlTextureFrameBuffer.java",
"api/org/webrtc/GlUtil.java",
"api/org/webrtc/Histogram.java",
"api/org/webrtc/IceCandidate.java",
"api/org/webrtc/MediaCodecVideoDecoder.java",
"api/org/webrtc/MediaCodecVideoEncoder.java",
"api/org/webrtc/MediaConstraints.java",
"api/org/webrtc/MediaSource.java",
"api/org/webrtc/MediaStream.java",
"api/org/webrtc/MediaStreamTrack.java",
"api/org/webrtc/NetworkMonitor.java",
"api/org/webrtc/NetworkMonitorAutoDetect.java",
"api/org/webrtc/PeerConnection.java",
"api/org/webrtc/PeerConnectionFactory.java",
"api/org/webrtc/RendererCommon.java",
"api/org/webrtc/RtpParameters.java",
"api/org/webrtc/RtpReceiver.java",
"api/org/webrtc/RtpSender.java",
"api/org/webrtc/ScreenCapturerAndroid.java",
"api/org/webrtc/SdpObserver.java",
"api/org/webrtc/SessionDescription.java",
"api/org/webrtc/StatsObserver.java",
"api/org/webrtc/StatsReport.java",
"api/org/webrtc/SurfaceTextureHelper.java",
"api/org/webrtc/SurfaceViewRenderer.java",
"api/org/webrtc/VideoCapturer.java",
"api/org/webrtc/VideoCapturerAndroid.java",
"api/org/webrtc/VideoFileRenderer.java",
"api/org/webrtc/VideoRenderer.java",
"api/org/webrtc/VideoRendererGui.java",
"api/org/webrtc/VideoSource.java",
"api/org/webrtc/VideoTrack.java",
"api/org/webrtc/YuvConverter.java",
]
deps = [
"//webrtc/base:base_java",
]
srcjar_deps = [ "//webrtc/modules/audio_device:audio_device_java" ]
}
android_library("libjingle_peerconnection_metrics_default_java") {
java_files = [ "api/org/webrtc/Metrics.java" ]
deps = [
"//webrtc/base:base_java",
]
}
if (rtc_include_tests) {
instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
apk_name = "libjingle_peerconnection_android_unittest"
android_manifest = "instrumentationtests/AndroidManifest.xml"
java_files = [
"instrumentationtests/src/org/webrtc/Camera1CapturerUsingByteBufferTest.java",
"instrumentationtests/src/org/webrtc/Camera1CapturerUsingTextureTest.java",
"instrumentationtests/src/org/webrtc/Camera2CapturerTest.java",
"instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java",
"instrumentationtests/src/org/webrtc/EglRendererTest.java",
"instrumentationtests/src/org/webrtc/GlRectDrawerTest.java",
"instrumentationtests/src/org/webrtc/MediaCodecVideoEncoderTest.java",
"instrumentationtests/src/org/webrtc/NetworkMonitorTest.java",
"instrumentationtests/src/org/webrtc/PeerConnectionTest.java",
"instrumentationtests/src/org/webrtc/RendererCommonTest.java",
"instrumentationtests/src/org/webrtc/SurfaceTextureHelperTest.java",
"instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java",
"instrumentationtests/src/org/webrtc/WebRtcJniBootTest.java",
]
deps = [
"//base:base_java",
"//webrtc/base:base_java",
"//webrtc/sdk/android:libjingle_peerconnection_java",
"//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
]
shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
}
}