Obj-C SDK Cleanup

This CL separates the files under sdk/objc into logical directories, replacing
the previous file layout under Framework/.

A long term goal is to have some system set up to generate the files under
sdk/objc/api (the PeerConnection API wrappers) from the C++ code. In the shorter
term the goal is to abstract out shared concepts from these classes in order to
make them as uniform as possible.

The separation into base/, components/, and helpers/ are to differentiate between
the base layer's common protocols, various utilities and the actual platform
specific components.

The old directory layout that resembled a framework's internal layout is not
necessary, since it is generated by the framework target when building it.

Bug: webrtc:9627
Change-Id: Ib084fd83f050ae980649ca99e841f4fb0580bd8f
Reviewed-on: https://webrtc-review.googlesource.com/94142
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24493}
This commit is contained in:
Anders Carlsson
2018-08-30 09:30:29 +02:00
committed by Commit Bot
parent 9ea5765f78
commit 7bca8ca4e2
470 changed files with 7255 additions and 5258 deletions

View File

@ -141,7 +141,7 @@ if (is_ios) {
]
deps = [
":perf_test",
"../sdk:common_objc",
"../sdk:helpers_objc",
]
}
}
@ -192,10 +192,6 @@ rtc_source_set("test_support") {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
if (is_ios && !build_with_chromium) {
deps += [ "../sdk:common_objc" ]
}
}
if (rtc_include_tests) {
@ -263,10 +259,6 @@ if (rtc_include_tests) {
if (is_android) {
deps += [ "//base:base" ]
}
if (is_ios) {
deps += [ "../sdk:common_objc" ]
}
}
rtc_source_set("test_support_test_artifacts") {
@ -375,7 +367,7 @@ if (is_ios) {
"..:webrtc_common",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../sdk:common_objc",
"../sdk:helpers_objc",
]
}
}

View File

@ -13,8 +13,8 @@
#include "test/ios/test_support.h"
#include "test/testsupport/perf_test.h"
#import "sdk/objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h"
#include "sdk/objc/Framework/Classes/Common/helpers.h"
#import "sdk/objc/helpers/NSString+StdString.h"
#import "sdk/objc/helpers/RTCUIApplicationStatusObserver.h"
// Springboard will kill any iOS app that fails to check in after launch within
// a given time. Starting a UIApplication before invoking TestSuite::Run
@ -88,7 +88,7 @@ static bool g_save_chartjson_result;
[outputDirectories[0] stringByAppendingPathComponent:fileName];
webrtc::test::WritePerfResults(
webrtc::ios::StdStringFromNSString(outputPath));
[NSString stdStringForString:outputPath]);
}
}

View File

@ -13,34 +13,32 @@
#import <Foundation/Foundation.h>
#include <string.h>
#import "sdk/objc/helpers/NSString+StdString.h"
#include "rtc_base/checks.h"
#include "sdk/objc/Framework/Classes/Common/helpers.h"
namespace webrtc {
namespace test {
using webrtc::ios::NSStringFromStdString;
using webrtc::ios::StdStringFromNSString;
// For iOS, resource files are added to the application bundle in the root
// and not in separate folders as is the case for other platforms. This method
// therefore removes any prepended folders and uses only the actual file name.
std::string IOSResourcePath(std::string name, std::string extension) {
@autoreleasepool {
NSString* path = NSStringFromStdString(name);
NSString* path = [NSString stringForStdString:name];
NSString* fileName = path.lastPathComponent;
NSString* fileType = NSStringFromStdString(extension);
NSString* fileType = [NSString stringForStdString:extension];
// Get full pathname for the resource identified by the name and extension.
NSString* pathString = [[NSBundle mainBundle] pathForResource:fileName
ofType:fileType];
return StdStringFromNSString(pathString);
return [NSString stdStringForString:pathString];
}
}
std::string IOSRootPath() {
@autoreleasepool {
NSBundle* mainBundle = [NSBundle mainBundle];
return StdStringFromNSString(mainBundle.bundlePath) + "/";
return [NSString stdStringForString:mainBundle.bundlePath] + "/";
}
}
@ -52,7 +50,7 @@ std::string IOSOutputPath() {
NSString* tempDir = NSTemporaryDirectory();
if (tempDir == nil)
tempDir = @"/tmp";
return StdStringFromNSString(tempDir);
return [NSString stdStringForString:tempDir];
}
}