fbshipit-source-id: cad5f527363fe09c2eea5b05ce1f3f2ecb86941b

This commit is contained in:
Daniel Buchele
2018-06-12 11:42:02 -07:00
parent 1edffabd05
commit 28be3c7cd8
22 changed files with 208 additions and 148 deletions

1
CNAME Normal file
View File

@@ -0,0 +1 @@
fbsonar.com

View File

@@ -43,6 +43,7 @@ public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, 0);
if (BuildConfig.DEBUG && SonarUtils.shouldEnableSonar(this)) {
final SonarClient client = AndroidSonarClient.getInstance(this);

View File

@@ -9,12 +9,11 @@ target 'SonarKit' do
# Pods for SonarKit
# Third party deps podspec link
pod 'EasyWSClient', :podspec => 'third-party-podspecs/EasyWSClient.podspec'
pod 'PeerTalk', :podspec => 'third-party-podspecs/PeerTalk.podspec'
pod 'RSocket', :podspec => 'third-party-podspecs/RSocket.podspec'
pod 'DoubleConversion', :podspec => 'third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => 'third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => 'third-party-podspecs/Folly.podspec'
pod 'Sonar', :podspec => '../xplat/Sonar/SonarKitCPP.podspec'
pod 'Sonar', :podspec => '../xplat/Sonar/Sonar.podspec'
pod 'CocoaAsyncSocket'
pod 'PeerTalk', :git => 'https://github.com/rsms/peertalk'
end

View File

@@ -6,18 +6,17 @@ swift_version = "4.1"
target 'Sample' do
pod 'EasyWSClient', :podspec => '../third-party-podspecs/EasyWSClient.podspec'
pod 'RSocket', :podspec => '../third-party-podspecs/RSocket.podspec'
pod 'DoubleConversion', :podspec => '../third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../third-party-podspecs/Folly.podspec'
pod 'PeerTalk', :git => 'https://github.com/rsms/peertalk'
pod 'PeerTalk', :podspec => '../third-party-podspecs/PeerTalk.podspec'
pod 'ComponentKit', :podspec => '../third-party-podspecs/ComponentKit.podspec'
pod 'Yoga','~>1.8.1', :modular_headers => true
pod 'Sonar', :podspec => '../../xplat/Sonar/SonarKitCPP.podspec'
pod 'Sonar', :podspec => '../../xplat/Sonar/Sonar.podspec'
pod 'SonarKit', :podspec => '../SonarKit.podspec'
pod 'SonarKit/SonarKitLayoutComponentKitSupport', :podspec => '../SonarKit.podspec'
pod 'SonarKit/SKIOSNetworkPlugin', :podspec => '../SonarKit.podspec'
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['YogaKit'].include? target.name

View File

@@ -333,7 +333,6 @@
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
"\"${PODS_ROOT}/Headers/Public/EasyWSClient\"",
"\"${PODS_ROOT}/Headers/Public/Folly\"",
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
"\"${PODS_ROOT}/Headers/Public/Sonar\"/**",
@@ -361,7 +360,6 @@
"-l\"CocoaAsyncSocket\"",
"-l\"ComponentKit\"",
"-l\"DoubleConversion\"",
"-l\"EasyWSClient\"",
"-l\"Folly\"",
"-l\"PeerTalk\"",
"-l\"Sonar\"",
@@ -400,7 +398,6 @@
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
"\"${PODS_ROOT}/Headers/Public/EasyWSClient\"",
"\"${PODS_ROOT}/Headers/Public/Folly\"",
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
"\"${PODS_ROOT}/Headers/Public/Sonar\"/**",
@@ -428,7 +425,6 @@
"-l\"CocoaAsyncSocket\"",
"-l\"ComponentKit\"",
"-l\"DoubleConversion\"",
"-l\"EasyWSClient\"",
"-l\"Folly\"",
"-l\"PeerTalk\"",
"-l\"Sonar\"",

View File

@@ -1,15 +1,15 @@
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0'
yoga_version = '1.8.1'
yoga_version = '~> 1.8'
yogakit_version = '1.8.1'
Pod::Spec.new do |spec|
spec.name = 'SonarKit'
spec.version = '1.0.0'
spec.version = '0.0.1'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/facebook/Sonar'
spec.summary = 'Sonar iOS podspec'
spec.authors = 'Facebook'
# spec.prepare_command = 'mv src double-conversion'
spec.static_framework = true
spec.source = { :git => 'https://github.com/facebook/Sonar.git',
:branch=> "master" }
spec.module_name = 'SonarKit'
@@ -17,7 +17,8 @@ Pod::Spec.new do |spec|
spec.dependency 'Sonar'
spec.dependency 'CocoaAsyncSocket', '~> 7.6'
spec.dependency 'PeerTalk'
spec.source_files = 'iOS/FBDefines/*.{h,cpp,m,mm}', 'iOS/SonarKit/**/*.{h,cpp,m,mm}'
spec.dependency 'OpenSSL-Static', '1.0.2.c1'
spec.source_files = 'iOS/FBDefines/*.{h,cpp,m,mm}', 'iOS/SonarKit/**/*.{h,cpp,m,mm}', 'iOS/SonarKit/FBCxxUtils/*.{h, mm}',
spec.public_header_files = 'iOS/SonarKit/CppBridge/*.{h}',
'iOS/SonarKit/SonarClient.h',
'iOS/SonarKit/SonarDeviceData.h',
@@ -26,12 +27,10 @@ Pod::Spec.new do |spec|
'iOS/SonarKit/SonarConnection.h',
'iOS/SonarKit/SKMacros.h'
spec.private_header_files = 'iOS/Sample/'
spec.compiler_flags = '-DFB_SONARKIT_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0'
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/ComponentKit\"/**" }
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/PeerTalkSonar\" \"$(PODS_ROOT)/ComponentKit\"/**" }
spec.platforms = { :ios => "8.0" }
spec.subspec "SonarKitLayoutPlugin" do |ss|
ss.dependency "Yoga", yoga_version
@@ -62,7 +61,6 @@ Pod::Spec.new do |spec|
ss.source_files = "iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutComponentKitSupport/**/*.{h,cpp,m,mm}"
ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"" }
end
@@ -73,18 +71,6 @@ Pod::Spec.new do |spec|
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKNetworkReporter.h'
ss.source_files = "iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/*.{h,cpp,m,mm}"
ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"" }
end
spec.subspec "SonarKitNetworkPlugin" do |ss|
ss.public_header_files = 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SonarKitNetworkPlugin.h',
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.h',
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKDispatchQueue.h',
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKNetworkReporter.h'
ss.source_files = "iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/*.{h,cpp,m,mm}"
ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"" }
end
@@ -93,7 +79,6 @@ Pod::Spec.new do |spec|
ss.public_header_files = 'iOS/Plugins/SonarKitNetworkPlugin/SKIOSNetworkPlugin/SKIOSNetworkAdapter.h'
ss.source_files = "iOS/Plugins/SonarKitNetworkPlugin/SKIOSNetworkPlugin/**/*.{h,cpp,m,mm}"
ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"" }
end
end

View File

@@ -7,7 +7,8 @@
*/
#import "SonarCppBridgingConnection.h"
#import "SKUtils.h"
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
#import "SonarCppBridgingResponder.h"
@implementation SonarCppBridgingConnection
@@ -27,7 +28,7 @@
- (void)send:(NSString *)method withParams:(NSDictionary *)params
{
conn_->send([method UTF8String], [SKUtils convertIdToFollyDynamic:params]);
conn_->send([method UTF8String], facebook::cxxutils::convertIdToFollyDynamic(params));
}
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
@@ -36,7 +37,7 @@
std::unique_ptr<facebook::sonar::SonarResponder> responder) {
SonarCppBridgingResponder *const objCResponder =
[[SonarCppBridgingResponder alloc] initWithCppResponder:std::move(responder)];
receiver([SKUtils convertFollyDynamicToId: message], objCResponder);
receiver(facebook::cxxutils::convertFollyDynamicToId(message), objCResponder);
};
conn_->receive([method UTF8String], lambda);
}

View File

@@ -7,7 +7,7 @@
*/
#import "SonarCppBridgingResponder.h"
#import "SKUtils.h"
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
@implementation SonarCppBridgingResponder {
std::unique_ptr<facebook::sonar::SonarResponder> responder_;
@@ -28,8 +28,8 @@
#pragma mark - SonarResponder
- (void)success:(NSDictionary *)response { responder_->success([SKUtils convertIdToFollyDynamic:response]); }
- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response)); }
- (void)error:(NSDictionary *)response { responder_->error([SKUtils convertIdToFollyDynamic:response]); }
- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response)); }
@end

24
iOS/SonarKit/Info.plist Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@@ -15,7 +15,7 @@
#import <UIKit/UIKit.h>
#if !TARGET_OS_SIMULATOR
#import "SKPortForwardingServer.h"
//#import "SKPortForwardingServer.h"
#endif
using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
@@ -24,7 +24,7 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
facebook::sonar::SonarClient *_cppClient;
folly::ScopedEventBaseThread eventBaseThread;
#if !TARGET_OS_SIMULATOR
SKPortForwardingServer *_server;
// SKPortForwardingServer *_server;
#endif
}
@@ -103,9 +103,9 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
- (void)start;
{
#if !TARGET_OS_SIMULATOR
_server = [SKPortForwardingServer new];
[_server forwardConnectionsFromPort:8088];
[_server listenForMultiplexingChannelOnPort:8078];
// _server = [SKPortForwardingServer new];
// [_server forwardConnectionsFromPort:8088];
// [_server listenForMultiplexingChannelOnPort:8078];
#endif
_cppClient->start();
}
@@ -114,8 +114,8 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
{
_cppClient->stop();
#if !TARGET_OS_SIMULATOR
[_server close];
_server = nil;
// [_server close];
// _server = nil;
#endif
}

View File

@@ -1,41 +0,0 @@
#!/bin/bash
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

View File

@@ -5,14 +5,12 @@ Pod::Spec.new do |spec|
spec.homepage = 'https://github.com/google/double-conversion'
spec.summary = 'Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles'
spec.authors = 'Google'
# spec.prepare_command = 'mv src double-conversion'
spec.source = { :git => 'https://github.com/google/double-conversion.git',
:tag => "v#{spec.version}" }
spec.module_name = 'DoubleConversion'
spec.source_files = 'double-conversion/*.{h,cc}'
spec.libraries = "stdc++"
spec.compiler_flags = '-std=c++1y'
# Pinning to the same version as React.podspec.
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
spec.platforms = { :ios => "8.0" }
end

View File

@@ -1,17 +0,0 @@
Pod::Spec.new do |spec|
spec.name = 'EasyWSClient'
spec.version = '1.0.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/google/double-conversion'
spec.summary = 'Easywsclient is an easy and powerful WebSocket client to get your C++ code connected to a web stack right away.'
spec.authors = 'David Baird'
# spec.prepare_command = 'mv src double-conversion'
spec.source = { :git => 'https://github.com/dhbaird/easywsclient.git', :branch => 'master'}
spec.module_name = 'EasyWSClient'
spec.source_files = '*.{hpp,cpp}'
spec.libraries = "stdc++"
spec.compiler_flags = '-std=c++1y'
# Pinning to the same version as React.podspec.
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
end

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Folly'
spec.version = '2018.05.07.00'
spec.version = '2018.05.28.00'
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'https://github.com/facebook/folly'
spec.summary = 'An open-source C++ library developed and used at Facebook.'
@@ -11,7 +11,9 @@ Pod::Spec.new do |spec|
spec.dependency 'boost-for-react-native'
spec.dependency 'DoubleConversion'
spec.dependency 'glog'
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -frtti
spec.dependency 'OpenSSL-Static', '1.0.2.c1'
spec.dependency 'CocoaLibEvent', '~> 1.0'
spec.compiler_flags = '-DFOLLY_HAVE_PTHREAD=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -frtti
-fexceptions
-std=c++14
-Wno-error
@@ -25,10 +27,27 @@ Pod::Spec.new do |spec|
'folly/memory/detail/MallocImpl.cpp',
'folly/String.cpp',
'folly/*.cpp',
'folly/detail/*.cpp',
'folly/hash/*.cpp',
'folly/portability/*.cpp',
'folly/ScopeGuard.h',
'folly/lang/ColdClass.cpp',
'folly/lang/Assume.h',
'folly/lang/Assume.cpp'
'folly/lang/Assume.cpp',
'folly/io/async/*.cpp',
'folly/io/async/ssl/*.cpp',
'folly/io/*.cpp',
'folly/synchronization/*.cpp',
'folly/lang/*.cpp',
'folly/memory/*.cpp',
'folly/futures/*.cpp',
'folly/futures/detail/*.cpp',
'folly/experimental/hazptr/*.cpp',
'folly/executors/*.cpp',
'folly/concurrency/*.cpp',
'folly/ssl/*.cpp',
'folly/ssl/detail/*.cpp',
'folly/system/*.cpp'
# workaround for https://github.com/facebook/react-native/issues/14326
spec.preserve_paths = 'folly/*.h',
@@ -38,16 +57,16 @@ Pod::Spec.new do |spec|
'folly/detail/*.h',
'folly/hash/*.h',
'folly/memory/*.h',
'folly/**/*.h'
'folly/**/*.h',
'folly/futures/detail/*.h',
'folly/futures/*.h'
spec.header_mappings_dir = 'folly'
spec.header_dir = 'folly'
spec.libraries = "stdc++"
spec.private_header_files = 'folly/portability/Stdlib.h',
'folly/portability/Malloc.h',
'folly/portability/Stdlib.h',
'folly/portability/Stdio.h',
'folly/portability/PThread.h'
'folly/portability/Stdio.h'
spec.public_header_files = 'folly/portability/Config.h',
'folly/Executor.h',
'folly/Function.h',
@@ -81,15 +100,19 @@ Pod::Spec.new do |spec|
'folly/FBString.h',
'folly/hash/Hash.h',
'folly/memory/Malloc.h',
'folly/io/async/AsyncTimeout.h',
'folly/**/*.h',
'folly/memory/detail/MallocImpl.h',
'folly/String.h',
'folly/*.h'
'folly/*.h',
'folly/portability/PThread.h',
'folly/futures/*.h',
'folly/futures/detail/*.h'
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++11",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\"" }
# Pinning to the same version as React.podspec.
spec.platforms = { :ios => "8.0", :tvos => "10.0" }
spec.platforms = { :ios => "8.0"}
end

View File

@@ -0,0 +1,19 @@
Pod::Spec.new do |spec|
spec.name = 'PeerTalk'
spec.version = '1.0.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'http://rsms.me/peertalk/'
spec.authors = { 'Rasmus Andersson' => 'rasmus@notion.se' }
spec.summary = 'iOS and OS X Cocoa library for communicating over USB and TCP.'
spec.source = { :git => "https://github.com/rsms/PeerTalk.git", :branch => 'master' }
spec.source_files = 'peertalk/*.{h,m}'
spec.requires_arc = true
spec.ios.deployment_target = '8.4'
spec.osx.deployment_target = '10.10'
spec.description = " PeerTalk is a iOS and OS X Cocoa library for communicating over USB and TCP.\n\n Highlights:\n\n * Provides you with USB device attach/detach events and attached device's info\n * Can connect to TCP services on supported attached devices (e.g. an iPhone), bridging the communication over USB transport\n * Offers a higher-level API (PTChannel and PTProtocol) for convenient implementations.\n * Tested and designed for libdispatch (aka Grand Central Dispatch).\n"
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"/**" }
end

View File

@@ -0,0 +1,53 @@
Pod::Spec.new do |spec|
spec.name = 'RSocket'
spec.version = '0.10.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/rsocket/rsocket-cpp'
spec.summary = 'C++ implementation of RSocket'
spec.authors = 'Facebook'
spec.source = { :git => 'https://github.com/rsocket/rsocket-cpp.git', :branch => "master"}
spec.module_name = 'RSocket'
spec.source_files = 'rsocket/benchmarks/*',
'rsocket/framing/*',
'rsocket/internal/*',
'rsocket/statemachine/*',
'rsocket/transports/*',
'rsocket/transports/**/*',
'yarpl/observable/*',
'yarpl/flowable/*',
'rsocket/*'
spec.libraries = "stdc++"
spec.compiler_flags = '-std=c++1y'
spec.dependency 'Folly'
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -frtti
-fexceptions
-std=c++14
-Wno-error
-Wno-unused-local-typedefs
-Wno-unused-variable
-Wno-sign-compare
-Wno-comment
-Wno-return-type
-Wno-global-constructors'
spec.preserve_paths = 'rsocket/benchmarks/*.h',
'rsocket/framing/*.h',
'rsocket/internal/*.h',
'rsocket/statemachine/*.h',
'rsocket/transports/*.h',
'rsocket/*.h',
'yarpl/flowable/*.h',
'yarpl/observable/*.h',
'yarpl/perf/*.h',
'yarpl/single/*.h',
'yarpl/utils/*.h',
'yarpl/*.h',
'**/*.h'
spec.header_mappings_dir = 'rsocket'
spec.header_dir = 'rsocket'
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\"/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/DoubleConversion\"/**" }
spec.platforms = { :ios => "8.0" }
end

View File

@@ -5,7 +5,7 @@ Pod::Spec.new do |spec|
spec.homepage = 'https://github.com/google/glog'
spec.summary = 'Google logging module'
spec.authors = 'Google'
spec.prepare_command = File.read("../scripts/ios-configure-glog.sh")
spec.prepare_command = "#!/bin/bash\nset -e\n\nPLATFORM_NAME=\"${PLATFORM_NAME:-iphoneos}\"\nCURRENT_ARCH=\"${CURRENT_ARCH:-armv7}\"\n\nexport CC=\"$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)\"\nexport CXX=\"$CC\"\n\n# Remove automake symlink if it exists\nif [ -h \"test-driver\" ]; then\n rm test-driver\nfi\n\n./configure --host arm-apple-darwin\n\n# Fix build for tvOS\ncat << EOF >> src/config.h\n\n/* Add in so we have Apple Target Conditionals */\n#ifdef __APPLE__\n#include <TargetConditionals.h>\n#include <Availability.h>\n#endif\n\n/* Special configuration for AppleTVOS */\n#if TARGET_OS_TV\n#undef HAVE_SYSCALL_H\n#undef HAVE_SYS_SYSCALL_H\n#undef OS_MACOSX\n#endif\n\n/* Special configuration for ucontext */\n#undef HAVE_UCONTEXT_H\n#undef PC_FROM_UCONTEXT\n#if defined(__x86_64__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip\n#elif defined(__i386__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip\n#endif\nEOF"
spec.source = { :git => 'https://github.com/google/glog.git',
:tag => "v#{spec.version}" }
spec.module_name = 'glog'
@@ -36,6 +36,6 @@ Pod::Spec.new do |spec|
}
spec.compiler_flags = '-std=c++1y'
spec.libraries = "stdc++"
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
spec.platforms = { :ios => "8.0"}
end

View File

@@ -0,0 +1,14 @@
/*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
package com.facebook.jni;
import com.facebook.proguard.annotations.DoNotStrip;
@DoNotStrip
public abstract class HybridClassBase extends HybridData {}

View File

@@ -9,7 +9,6 @@ import type {ElementID, Element, ElementSearchResultSet} from 'sonar';
import {
colors,
Glyph,
GK,
FlexRow,
FlexColumn,
Toolbar,
@@ -540,7 +539,6 @@ export default class Layout extends SonarPlugin<InspectorState> {
}
/>
</SearchIconContainer>
{GK.get('sonar_layout_search') && (
<SearchBox tabIndex={-1}>
<SearchIcon
name="magnifying-glass"
@@ -550,7 +548,6 @@ export default class Layout extends SonarPlugin<InspectorState> {
<LayoutSearchInput onSubmit={this.search.bind(this)} />
{outstandingSearchQuery && <LoadingSpinner size={16} />}
</SearchBox>
)}
</Toolbar>
<FlexRow fill={true}>
{initialised ? (

View File

@@ -8,7 +8,10 @@
import LogManager from '../fb-stubs/Logger';
const fs = require('fs');
const adb = require('adbkit-fb');
import {openssl} from './openssl-wrapper-with-promises';
import {
openssl,
isInstalled as opensslInstalled,
} from './openssl-wrapper-with-promises';
const path = require('path');
// Desktop file paths
@@ -68,6 +71,7 @@ export default class CertificateProvider {
os: string,
appDirectory: string,
): Promise<void> {
this.ensureOpenSSLIsAvailable();
if (!appDirectory.match(allowedAppDirectoryRegex)) {
return Promise.reject(
new Error(
@@ -98,6 +102,15 @@ export default class CertificateProvider {
);
}
ensureOpenSSLIsAvailable(): void {
if (!opensslInstalled()) {
const e = Error(
"It looks like you don't have OpenSSL installed. Please install it to continue.",
);
this.server.emit('error', e);
}
}
getCACertificate(): Promise<string> {
return new Promise((resolve, reject) => {
fs.readFile(caCert, (err, data) => {
@@ -121,7 +134,7 @@ export default class CertificateProvider {
CAkey: caKey,
CAcreateserial: true,
}).then(cert => {
fs.unlink(csrFile);
fs.unlinkSync(csrFile);
return cert;
});
}

View File

@@ -6,6 +6,7 @@
*/
import {exec as opensslWithCallback} from 'openssl-wrapper';
const child_process = require('child_process');
export function openssl(action: string, options: {}): Promise<string> {
return new Promise((resolve, reject) => {
@@ -17,3 +18,7 @@ export function openssl(action: string, options: {}): Promise<string> {
});
});
}
export function isInstalled(): boolean {
return !child_process.spawnSync('openssl', ['version']).error;
}

View File

@@ -1,11 +1,10 @@
Pod::Spec.new do |spec|
spec.name = 'Sonar'
spec.version = '1.0.0'
spec.version = '0.0.1'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/facebook/sonar'
spec.summary = 'SonarKit core cpp code with network implementation'
spec.authors = 'Facebook'
# spec.prepare_command = 'mv src double-conversion'
spec.source = { :git => 'https://github.com/facebook/Sonar.git',
:branch => 'master' }
spec.module_name = 'Sonar'
@@ -13,21 +12,12 @@ Pod::Spec.new do |spec|
spec.source_files = 'xplat/Sonar/*.{h,cpp,m,mm}'
spec.libraries = "stdc++"
spec.dependency 'Folly'
spec.dependency 'EasyWSClient'
# spec.dependency 'boost-for-react-native'
#
# spec.dependency 'DoubleConversion'
# spec.dependency 'Folly'
# spec.dependency 'glog'
spec.dependency 'RSocket'
spec.compiler_flags = '-DFB_SONARKIT_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -Wall
-std=c++14
-Wno-global-constructors'
# spec.header_mappings_dir = 'folly'
# spec.header_dir = 'folly'
# spec.preserve_paths = 'xplat/**/*'
# Pinning to the same version as React.podspec.
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
spec.platforms = { :ios => "8.0" }
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/EasyWSClient\" \"$(PODS_ROOT)/DoubleConversion\"" }
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/RSocket\" \"$(PODS_ROOT)/DoubleConversion\"" }
end