Reland "Add check_deps rules in DEPS files."

Relanding https://codereview.webrtc.org/1796413002/
without the change to the openmax_dl include path
(which broke downstream code).

TBR=tommi@webrtc.org
BUG=webrtc:5623
TESTED=Passing runs using:
buildtools/checkdeps/checkdeps.py --root=. talk
buildtools/checkdeps/checkdeps.py --root=. webrtc

Review URL: https://codereview.webrtc.org/1804333002 .

Cr-Commit-Position: refs/heads/master@{#12031}
This commit is contained in:
kjellander@webrtc.org 2016-03-17 12:05:36 +01:00
parent d8ddb796e4
commit 94a23f04af
42 changed files with 349 additions and 305 deletions

19
DEPS
View file

@ -23,25 +23,6 @@ deps_os = {
},
}
# Define rules for which include paths are allowed in our source.
include_rules = [
# Base is only used to build Android APK tests and may not be referenced by
# WebRTC production code.
'-base',
'-chromium',
'+external/webrtc/webrtc', # Android platform build.
'+gflags',
'+libyuv',
'+net',
'+talk',
'+testing',
'+third_party',
'+unicode',
'+usrsctplib',
'+webrtc',
'+vpx',
]
hooks = [
{
# Check for legacy named top-level dir (named 'trunk').

7
talk/app/webrtc/DEPS Normal file
View file

@ -0,0 +1,7 @@
include_rules = [
"+talk/app/webrtc/objc",
"+webrtc/video_frame.h",
"+webrtc/api",
"+webrtc/base",
"+webrtc/media",
]

47
webrtc/DEPS Normal file
View file

@ -0,0 +1,47 @@
# Define rules for which include paths are allowed in our source.
include_rules = [
# Base is only used to build Android APK tests and may not be referenced by
# WebRTC production code.
"-base",
"-chromium",
"+external/webrtc/webrtc", # Android platform build.
"+gflags",
"+libyuv",
"+testing",
"-webrtc", # Has to be disabled; otherwise all dirs below will be allowed.
# Individual headers that will be moved out of here, see webrtc:
"+webrtc/audio_receive_stream.h",
"+webrtc/audio_send_stream.h",
"+webrtc/audio_sink.h",
"+webrtc/audio_state.h",
"+webrtc/call.h",
"+webrtc/common.h",
"+webrtc/common_types.h",
"+webrtc/config.h",
"+webrtc/engine_configurations.h",
"+webrtc/frame_callback.h",
"+webrtc/stream.h",
"+webrtc/transport.h",
"+webrtc/typedefs.h",
"+webrtc/video_decoder.h",
"+webrtc/video_encoder.h",
"+webrtc/video_frame.h",
"+webrtc/video_receive_stream.h",
"+webrtc/video_renderer.h",
"+webrtc/video_send_stream.h",
"+webrtc/base",
"+webrtc/modules/include",
"+webrtc/test",
"+webrtc/tools",
]
# The below rules will be removed when webrtc: is fixed.
specific_include_rules = {
"audio_send_stream\.h": [
"+webrtc/modules/audio_coding",
],
"video_frame\.h": [
"+webrtc/common_video",
],
}

23
webrtc/api/DEPS Normal file
View file

@ -0,0 +1,23 @@
include_rules = [
"+third_party/libyuv",
"+webrtc/base",
"+webrtc/common_video",
"+webrtc/media",
"+webrtc/p2p",
"+webrtc/pc",
"+webrtc/modules/audio_device",
"+webrtc/modules/rtp_rtcp",
"+webrtc/modules/video_coding",
"+webrtc/modules/video_render",
"+webrtc/system_wrappers",
]
specific_include_rules = {
"androidtestinitializer\.cc": [
"+base/android", # Allowed only for Android tests.
"+webrtc/voice_engine",
],
"peerconnection_jni\.cc": [
"+webrtc/voice_engine",
]
}

10
webrtc/audio/DEPS Normal file
View file

@ -0,0 +1,10 @@
include_rules = [
"+webrtc/base",
"+webrtc/voice_engine",
"+webrtc/modules/bitrate_controller",
"+webrtc/modules/congestion_controller",
"+webrtc/modules/pacing",
"+webrtc/modules/remote_bitrate_estimator",
"+webrtc/modules/rtp_rtcp",
"+webrtc/system_wrappers",
]

11
webrtc/base/DEPS Normal file
View file

@ -0,0 +1,11 @@
include_rules = [
"+json",
"+third_party/jsoncpp",
"+webrtc/system_wrappers",
]
specific_include_rules = {
"gunit_prod.h": [
"+gtest",
],
}

13
webrtc/call/DEPS Normal file
View file

@ -0,0 +1,13 @@
include_rules = [
"+webrtc/audio",
"+webrtc/base",
"+webrtc/modules/audio_coding",
"+webrtc/modules/bitrate_controller",
"+webrtc/modules/congestion_controller",
"+webrtc/modules/pacing",
"+webrtc/modules/rtp_rtcp",
"+webrtc/modules/utility",
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
"+webrtc/video",
]

5
webrtc/common_audio/DEPS Normal file
View file

@ -0,0 +1,5 @@
include_rules = [
"+dl/sp/api", # For openmax_dl.
"+webrtc/base",
"+webrtc/system_wrappers",
]

4
webrtc/common_video/DEPS Normal file
View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
]

8
webrtc/examples/DEPS Normal file
View file

@ -0,0 +1,8 @@
include_rules = [
"+webrtc/api",
"+webrtc/base",
"+webrtc/media",
"+webrtc/modules/audio_device",
"+webrtc/modules/video_capture",
"+webrtc/p2p",
]

5
webrtc/libjingle/DEPS Normal file
View file

@ -0,0 +1,5 @@
include_rules = [
"+third_party/expat",
"+webrtc/base",
"+webrtc/p2p",
]

View file

@ -1,280 +0,0 @@
/*
* Copyright 2004 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.
*/
#include <iostream>
#include <sstream>
#include <string>
#include "buzz/chatroommodule.h"
#include "buzz/constants.h"
#include "buzz/xmlelement.h"
#include "buzz/xmppengine.h"
#include "common/common.h"
#include "engine/util_unittest.h"
#include "test/unittest-inl.h"
#include "test/unittest.h"
#define TEST_OK(x) TEST_EQ((x),XMPP_RETURN_OK)
#define TEST_BADARGUMENT(x) TEST_EQ((x),XMPP_RETURN_BADARGUMENT)
namespace buzz {
class MultiUserChatModuleTest;
static void
WriteEnteredStatus(std::ostream& os, XmppChatroomEnteredStatus status) {
switch(status) {
case XMPP_CHATROOM_ENTERED_SUCCESS:
os<<"success";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_NICKNAME_CONFLICT:
os<<"failure(nickname conflict)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_PASSWORD_REQUIRED:
os<<"failure(password required)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_PASSWORD_INCORRECT:
os<<"failure(password incorrect)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_NOT_A_MEMBER:
os<<"failure(not a member)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_MEMBER_BANNED:
os<<"failure(member banned)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_MAX_USERS:
os<<"failure(max users)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_ROOM_LOCKED:
os<<"failure(room locked)";
break;
case XMPP_CHATROOM_ENTERED_FAILURE_UNSPECIFIED:
os<<"failure(unspecified)";
break;
default:
os<<"unknown";
break;
}
}
static void
WriteExitedStatus(std::ostream& os, XmppChatroomExitedStatus status) {
switch (status) {
case XMPP_CHATROOM_EXITED_REQUESTED:
os<<"requested";
break;
case XMPP_CHATROOM_EXITED_BANNED:
os<<"banned";
break;
case XMPP_CHATROOM_EXITED_KICKED:
os<<"kicked";
break;
case XMPP_CHATROOM_EXITED_NOT_A_MEMBER:
os<<"not member";
break;
case XMPP_CHATROOM_EXITED_SYSTEM_SHUTDOWN:
os<<"system shutdown";
break;
case XMPP_CHATROOM_EXITED_UNSPECIFIED:
os<<"unspecified";
break;
default:
os<<"unknown";
break;
}
}
//! This session handler saves all calls to a string. These are events and
//! data delivered form the engine to application code.
class XmppTestChatroomHandler : public XmppChatroomHandler {
public:
XmppTestChatroomHandler() {}
virtual ~XmppTestChatroomHandler() {}
void ChatroomEnteredStatus(XmppChatroomModule* room,
XmppChatroomEnteredStatus status) {
RTC_UNUSED(room);
ss_ <<"[ChatroomEnteredStatus status: ";
WriteEnteredStatus(ss_, status);
ss_ <<"]";
}
void ChatroomExitedStatus(XmppChatroomModule* room,
XmppChatroomExitedStatus status) {
RTC_UNUSED(room);
ss_ <<"[ChatroomExitedStatus status: ";
WriteExitedStatus(ss_, status);
ss_ <<"]";
}
void MemberEntered(XmppChatroomModule* room,
const XmppChatroomMember* entered_member) {
RTC_UNUSED(room);
ss_ << "[MemberEntered " << entered_member->member_jid().Str() << "]";
}
void MemberExited(XmppChatroomModule* room,
const XmppChatroomMember* exited_member) {
RTC_UNUSED(room);
ss_ << "[MemberExited " << exited_member->member_jid().Str() << "]";
}
void MemberChanged(XmppChatroomModule* room,
const XmppChatroomMember* changed_member) {
RTC_UNUSED(room);
ss_ << "[MemberChanged " << changed_member->member_jid().Str() << "]";
}
virtual void MessageReceived(XmppChatroomModule* room, const XmlElement& message) {
RTC_UNUSED2(room, message);
}
std::string Str() {
return ss_.str();
}
std::string StrClear() {
std::string result = ss_.str();
ss_.str("");
return result;
}
private:
std::stringstream ss_;
};
//! This is the class that holds all of the unit test code for the
//! roster module
class XmppChatroomModuleTest : public UnitTest {
public:
XmppChatroomModuleTest() {}
void TestEnterExitChatroom() {
std::stringstream dump;
// Configure the engine
rtc::scoped_ptr<XmppEngine> engine(XmppEngine::Create());
XmppTestHandler handler(engine.get());
// Configure the module and handler
rtc::scoped_ptr<XmppChatroomModule> chatroom(XmppChatroomModule::Create());
// Configure the module handler
chatroom->RegisterEngine(engine.get());
// Set up callbacks
engine->SetOutputHandler(&handler);
engine->AddStanzaHandler(&handler);
engine->SetSessionHandler(&handler);
// Set up minimal login info
engine->SetUser(Jid("david@my-server"));
engine->SetPassword("david");
// Do the whole login handshake
RunLogin(this, engine.get(), &handler);
TEST_EQ("", handler.OutputActivity());
// Get the chatroom and set the handler
XmppTestChatroomHandler chatroom_handler;
chatroom->set_chatroom_handler(static_cast<XmppChatroomHandler*>(&chatroom_handler));
// try to enter the chatroom
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_NOT_IN_ROOM);
chatroom->set_nickname("thirdwitch");
chatroom->set_chatroom_jid(Jid("darkcave@my-server"));
chatroom->RequestEnterChatroom("", XMPP_CONNECTION_STATUS_UNKNOWN, "en");
TEST_EQ(chatroom_handler.StrClear(), "");
TEST_EQ(handler.OutputActivity(),
"<presence to=\"darkcave@my-server/thirdwitch\">"
"<muc:x xmlns:muc=\"http://jabber.org/protocol/muc\"/>"
"</presence>");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
// simulate the server and test the client
std::string input;
input = "<presence from=\"darkcave@my-server/firstwitch\" to=\"david@my-server\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"owner\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(), "");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
input = "<presence from=\"darkcave@my-server/secondwitch\" to=\"david@my-server\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"member\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(), "");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
input = "<presence from=\"darkcave@my-server/thirdwitch\" to=\"david@my-server\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"member\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(),
"[ChatroomEnteredStatus status: success]");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
// simulate somebody else entering the room after we entered
input = "<presence from=\"darkcave@my-server/fourthwitch\" to=\"david@my-server\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"member\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(), "[MemberEntered darkcave@my-server/fourthwitch]");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
// simulate somebody else leaving the room after we entered
input = "<presence from=\"darkcave@my-server/secondwitch\" to=\"david@my-server\" type=\"unavailable\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"member\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(), "[MemberExited darkcave@my-server/secondwitch]");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
// try to leave the room
chatroom->RequestExitChatroom();
TEST_EQ(chatroom_handler.StrClear(), "");
TEST_EQ(handler.OutputActivity(),
"<presence to=\"darkcave@my-server/thirdwitch\" type=\"unavailable\"/>");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_EXIT);
// simulate the server and test the client
input = "<presence from=\"darkcave@my-server/thirdwitch\" to=\"david@my-server\" type=\"unavailable\">"
"<x xmlns=\"http://jabber.org/protocol/muc#user\">"
"<item affiliation=\"member\" role=\"participant\"/>"
"</x>"
"</presence>";
TEST_OK(engine->HandleInput(input.c_str(), input.length()));
TEST_EQ(chatroom_handler.StrClear(),
"[ChatroomExitedStatus status: requested]");
TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_NOT_IN_ROOM);
}
};
// A global function that creates the test suite for this set of tests.
TestBase* ChatroomModuleTest_Create() {
TestSuite* suite = new TestSuite("ChatroomModuleTest");
ADD_TEST(suite, XmppChatroomModuleTest, TestEnterExitChatroom);
return suite;
}
}

23
webrtc/media/DEPS Normal file
View file

@ -0,0 +1,23 @@
include_rules = [
"+webrtc/api",
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_video",
"+webrtc/modules/audio_coding",
"+webrtc/modules/audio_device",
"+webrtc/modules/audio_processing",
"+webrtc/modules/video_capture",
"+webrtc/modules/video_coding",
"+webrtc/p2p",
"+webrtc/pc",
"+webrtc/sound",
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
"+usrsctplib",
]
specific_include_rules = {
"win32devicemanager\.cc": [
"+third_party/logitech/files/logitechquickcam.h",
],
}

View file

@ -0,0 +1,7 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_audio",
"+webrtc/audio_coding/neteq/neteq_unittest.pb.h", # Different path.
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,11 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_audio",
"+webrtc/system_wrappers",
]
specific_include_rules = {
"ensure_initialized\.cc": [
"+base/android",
],
}

View file

@ -0,0 +1,14 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_audio",
"+webrtc/system_wrappers",
]
specific_include_rules = {
".*test\.cc": [
"+webrtc/tools",
# Android platform build has different paths.
"+gtest",
"+external/webrtc",
],
}

View file

@ -10,8 +10,8 @@
#include "webrtc/modules/audio_processing/agc/agc.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/test/testsupport/fileutils.h"

View file

@ -13,7 +13,7 @@
#include "webrtc/modules/audio_processing/agc/agc.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "webrtc/modules/include/module_common_types.h"
namespace webrtc {

View file

@ -0,0 +1,5 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,5 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
"+webrtc/video",
]

View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_video",
]

View file

@ -0,0 +1,5 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_audio",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,10 @@
include_rules = [
"+webrtc/base",
"+webrtc/system_wrappers",
]
specific_include_rules = {
"nada\.h": [
"+webrtc/voice_engine",
],
}

View file

@ -0,0 +1,6 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_video",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,6 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_audio",
"+webrtc/common_video",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,5 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_video",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,9 @@
include_rules = [
"+third_party/ffmpeg",
"+third_party/openh264",
"+vpx",
"+webrtc/base",
"+webrtc/common_video",
"+webrtc/system_wrappers",
"+webrtc/tools",
]

View file

@ -11,7 +11,7 @@
#include <memory>
#include <vector>
#include "gtest/gtest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"

View file

@ -15,6 +15,7 @@
#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/checks.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
@ -22,8 +23,6 @@
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/video_frame.h"
#include "gtest/gtest.h"
using ::testing::_;
using ::testing::AllOf;
using ::testing::Field;

View file

@ -0,0 +1,6 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_audio",
"+webrtc/common_video",
"+webrtc/system_wrappers",
]

View file

@ -0,0 +1,5 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_video",
"+webrtc/system_wrappers",
]

5
webrtc/p2p/DEPS Normal file
View file

@ -0,0 +1,5 @@
include_rules = [
"+net",
"+webrtc/base",
"+webrtc/system_wrappers",
]

13
webrtc/pc/DEPS Normal file
View file

@ -0,0 +1,13 @@
include_rules = [
"+webrtc/api",
"+webrtc/base",
"+webrtc/media",
"+webrtc/p2p",
"+third_party/libsrtp"
]
specific_include_rules = {
"srtpfilter_unittest\.cc": [
"+crypto",
],
}

4
webrtc/sound/DEPS Normal file
View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
]

View file

@ -0,0 +1,4 @@
include_rules = [
"+webrtc/base",
]

13
webrtc/test/DEPS Normal file
View file

@ -0,0 +1,13 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_video",
"+webrtc/modules/audio_coding",
"+webrtc/modules/audio_device",
"+webrtc/modules/media_file",
"+webrtc/modules/rtp_rtcp",
"+webrtc/modules/video_capture",
"+webrtc/modules/video_coding",
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
]

8
webrtc/tools/DEPS Normal file
View file

@ -0,0 +1,8 @@
include_rules = [
"+webrtc/base",
"+webrtc/common_video",
"+webrtc/modules/audio_processing",
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
]

17
webrtc/video/DEPS Normal file
View file

@ -0,0 +1,17 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_video",
"+webrtc/modules/bitrate_controller",
"+webrtc/modules/congestion_controller",
"+webrtc/modules/pacing",
"+webrtc/modules/remote_bitrate_estimator",
"+webrtc/modules/rtp_rtcp",
"+webrtc/modules/utility",
"+webrtc/modules/video_coding",
"+webrtc/modules/video_capture",
"+webrtc/modules/video_processing",
"+webrtc/modules/video_render",
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
]

14
webrtc/voice_engine/DEPS Normal file
View file

@ -0,0 +1,14 @@
include_rules = [
"+webrtc/base",
"+webrtc/call",
"+webrtc/common_audio",
"+webrtc/modules/audio_coding",
"+webrtc/modules/audio_conference_mixer",
"+webrtc/modules/audio_device",
"+webrtc/modules/audio_processing",
"+webrtc/modules/media_file",
"+webrtc/modules/pacing",
"+webrtc/modules/rtp_rtcp",
"+webrtc/modules/utility",
"+webrtc/system_wrappers",
]