diff --git a/all.gyp b/all.gyp index abf6e6860d..238229063e 100644 --- a/all.gyp +++ b/all.gyp @@ -36,6 +36,11 @@ '<(webrtc_vp9_dir)/vp9.gyp:*', ], 'conditions': [ + ['OS=="android" and build_with_chromium==0', { + 'dependencies': [ + 'webrtc/api/api_java.gyp:*', + ], + }], ['include_tests==1', { 'includes': [ 'webrtc/webrtc_tests.gypi', diff --git a/webrtc/api/api.gyp b/webrtc/api/api.gyp index f63e7e4b11..8525eb09c7 100644 --- a/webrtc/api/api.gyp +++ b/webrtc/api/api.gyp @@ -89,35 +89,6 @@ 'use_native_jni_exports': 1, }, }, - { - # |libjingle_peerconnection_java| builds a jar file with name - # libjingle_peerconnection_java.jar using Chrome's build system. - # It includes all Java files needed to setup a PeeerConnection call - # from Android. - 'target_name': 'libjingle_peerconnection_java', - 'type': 'none', - 'dependencies': [ - 'libjingle_peerconnection_so', - ], - 'variables': { - # Designate as Chromium code and point to our lint settings to - # enable linting of the WebRTC code (this is the only way to make - # lint_action invoke the Android linter). - 'android_manifest_path': '<(webrtc_root)/build/android/AndroidManifest.xml', - 'suppressions_file': '<(webrtc_root)/build/android/suppressions.xml', - 'chromium_code': 1, - 'java_in_dir': 'java', - 'webrtc_base_dir': '<(webrtc_root)/base', - 'webrtc_modules_dir': '<(webrtc_root)/modules', - 'additional_src_dirs' : [ - 'java/android', - '<(webrtc_base_dir)/java/src', - '<(webrtc_modules_dir)/audio_device/android/java/src', - - ], - }, - 'includes': ['../../build/java.gypi'], - }, # libjingle_peerconnection_java ] }], ], # conditions diff --git a/webrtc/api/api_java.gyp b/webrtc/api/api_java.gyp new file mode 100644 index 0000000000..e69f0e2789 --- /dev/null +++ b/webrtc/api/api_java.gyp @@ -0,0 +1,52 @@ +# 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. + +# This file exists only because there's no other way to avoid errors in the +# Chromium build due to the inclusion of build/java.gypi. GYP unfortunately +# processes all 'includes' for all .gyp files, ignoring conditions. This +# processing takes place early in the cycle, before it's possible to use +# variables. It will go away when WebRTC has fully migrated to GN. + +{ + 'includes': [ '../build/common.gypi', ], + 'conditions': [ + ['OS=="android"', { + 'targets': [ + { + # |libjingle_peerconnection_java| builds a jar file with name + # libjingle_peerconnection_java.jar using Chrome's build system. + # It includes all Java files needed to setup a PeeerConnection call + # from Android. + 'target_name': 'libjingle_peerconnection_java', + 'type': 'none', + 'dependencies': [ + '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_so', + ], + 'variables': { + # Designate as Chromium code and point to our lint settings to + # enable linting of the WebRTC code (this is the only way to make + # lint_action invoke the Android linter). + 'android_manifest_path': '<(webrtc_root)/build/android/AndroidManifest.xml', + 'suppressions_file': '<(webrtc_root)/build/android/suppressions.xml', + 'chromium_code': 1, + 'java_in_dir': 'java', + 'webrtc_base_dir': '<(webrtc_root)/base', + 'webrtc_modules_dir': '<(webrtc_root)/modules', + 'additional_src_dirs' : [ + 'java/android', + '<(webrtc_base_dir)/java/src', + '<(webrtc_modules_dir)/audio_device/android/java/src', + + ], + }, + 'includes': ['../../build/java.gypi'], + }, + ], # targets + }], # OS=="android" + ], # conditions +} diff --git a/webrtc/api/api_tests.gyp b/webrtc/api/api_tests.gyp index 303c1ef72a..5ff062a1b4 100644 --- a/webrtc/api/api_tests.gyp +++ b/webrtc/api/api_tests.gyp @@ -129,7 +129,7 @@ 'target_name': 'libjingle_peerconnection_android_unittest', 'type': 'none', 'dependencies': [ - '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_java', + '<(webrtc_root)/api/api_java.gyp:libjingle_peerconnection_java', ], 'variables': { 'apk_name': 'libjingle_peerconnection_android_unittest', diff --git a/webrtc/build/android_tests.gyp b/webrtc/build/android_tests.gyp index fdf72737a1..7803b9a419 100644 --- a/webrtc/build/android_tests.gyp +++ b/webrtc/build/android_tests.gyp @@ -126,7 +126,7 @@ }, 'dependencies': [ '<(webrtc_root)/api/api_tests.gyp:peerconnection_unittests', - '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_java', + '<(webrtc_root)/api/api_java.gyp:libjingle_peerconnection_java', ], 'includes': [ '../../build/apk_test.gypi', @@ -264,7 +264,7 @@ 'target_name': 'android_junit_tests', 'type': 'none', 'dependencies': [ - '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_java', + '<(webrtc_root)/api/api_java.gyp:libjingle_peerconnection_java', '<(DEPTH)/base/base.gyp:base_java', '<(DEPTH)/base/base.gyp:base_java_test_support', '<(DEPTH)/base/base.gyp:base_junit_test_support', diff --git a/webrtc/webrtc_examples.gyp b/webrtc/webrtc_examples.gyp index 1b3c76c83e..0978404435 100755 --- a/webrtc/webrtc_examples.gyp +++ b/webrtc/webrtc_examples.gyp @@ -409,7 +409,7 @@ 'target_name': 'AppRTCDemo', 'type': 'none', 'dependencies': [ - 'api/api.gyp:libjingle_peerconnection_java', + 'api/api_java.gyp:libjingle_peerconnection_java', ], 'variables': { 'apk_name': 'AppRTCDemo',