diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..c5fa5f686 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +fbsonar.com diff --git a/docs/getting-started.md b/docs/getting-started.md index f4900bd81..b8e736b0b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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); diff --git a/iOS/Podfile b/iOS/Podfile index 056604147..63a63d759 100644 --- a/iOS/Podfile +++ b/iOS/Podfile @@ -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 diff --git a/iOS/Sample/Podfile b/iOS/Sample/Podfile index 70f73b4a3..e8a1995e0 100644 --- a/iOS/Sample/Podfile +++ b/iOS/Sample/Podfile @@ -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 diff --git a/iOS/Sample/Sample.xcodeproj/project.pbxproj b/iOS/Sample/Sample.xcodeproj/project.pbxproj index bbe9e8cf1..d1b532e26 100644 --- a/iOS/Sample/Sample.xcodeproj/project.pbxproj +++ b/iOS/Sample/Sample.xcodeproj/project.pbxproj @@ -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\"", diff --git a/iOS/SonarKit.podspec b/iOS/SonarKit.podspec index 80136339f..c884c2d98 100644 --- a/iOS/SonarKit.podspec +++ b/iOS/SonarKit.podspec @@ -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 diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm index c2518f328..031cdbca7 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm @@ -7,7 +7,8 @@ */ #import "SonarCppBridgingConnection.h" -#import "SKUtils.h" +#import + #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 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); } diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm index b43701980..0b3714fb4 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm @@ -7,7 +7,7 @@ */ #import "SonarCppBridgingResponder.h" -#import "SKUtils.h" +#import @implementation SonarCppBridgingResponder { std::unique_ptr 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 diff --git a/iOS/SonarKit/Info.plist b/iOS/SonarKit/Info.plist new file mode 100644 index 000000000..1007fd9dd --- /dev/null +++ b/iOS/SonarKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/iOS/SonarKit/SonarClient.mm b/iOS/SonarKit/SonarClient.mm index 14a62745d..c4915bfc3 100644 --- a/iOS/SonarKit/SonarClient.mm +++ b/iOS/SonarKit/SonarClient.mm @@ -15,7 +15,7 @@ #import #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 } diff --git a/iOS/scripts/ios-configure-glog.sh b/iOS/scripts/ios-configure-glog.sh deleted file mode 100644 index e6a15febb..000000000 --- a/iOS/scripts/ios-configure-glog.sh +++ /dev/null @@ -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 -#include -#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 diff --git a/iOS/third-party-podspecs/DoubleConversion.podspec b/iOS/third-party-podspecs/DoubleConversion.podspec index 91f4f819b..41a048859 100755 --- a/iOS/third-party-podspecs/DoubleConversion.podspec +++ b/iOS/third-party-podspecs/DoubleConversion.podspec @@ -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 diff --git a/iOS/third-party-podspecs/EasyWSClient.podspec b/iOS/third-party-podspecs/EasyWSClient.podspec deleted file mode 100644 index 0b3edeba9..000000000 --- a/iOS/third-party-podspecs/EasyWSClient.podspec +++ /dev/null @@ -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 diff --git a/iOS/third-party-podspecs/Folly.podspec b/iOS/third-party-podspecs/Folly.podspec index 4732038d7..1623e2bfd 100755 --- a/iOS/third-party-podspecs/Folly.podspec +++ b/iOS/third-party-podspecs/Folly.podspec @@ -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 diff --git a/iOS/third-party-podspecs/PeerTalk.podspec b/iOS/third-party-podspecs/PeerTalk.podspec new file mode 100644 index 000000000..eeac92540 --- /dev/null +++ b/iOS/third-party-podspecs/PeerTalk.podspec @@ -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 diff --git a/iOS/third-party-podspecs/RSocket.podspec b/iOS/third-party-podspecs/RSocket.podspec new file mode 100644 index 000000000..ac127e1aa --- /dev/null +++ b/iOS/third-party-podspecs/RSocket.podspec @@ -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 diff --git a/iOS/third-party-podspecs/glog.podspec b/iOS/third-party-podspecs/glog.podspec index a68659fa0..3524ba47e 100755 --- a/iOS/third-party-podspecs/glog.podspec +++ b/iOS/third-party-podspecs/glog.podspec @@ -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 \n#include \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 diff --git a/libs/fbjni/src/main/java/com/facebook/jni/HybridClassBase.java b/libs/fbjni/src/main/java/com/facebook/jni/HybridClassBase.java new file mode 100644 index 000000000..76a5e652f --- /dev/null +++ b/libs/fbjni/src/main/java/com/facebook/jni/HybridClassBase.java @@ -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 {} diff --git a/src/plugins/layout/index.js b/src/plugins/layout/index.js index 65da5dd74..0b051ef92 100644 --- a/src/plugins/layout/index.js +++ b/src/plugins/layout/index.js @@ -9,7 +9,6 @@ import type {ElementID, Element, ElementSearchResultSet} from 'sonar'; import { colors, Glyph, - GK, FlexRow, FlexColumn, Toolbar, @@ -540,17 +539,15 @@ export default class Layout extends SonarPlugin { } /> - {GK.get('sonar_layout_search') && ( - - - - {outstandingSearchQuery && } - - )} + + + + {outstandingSearchQuery && } + {initialised ? ( diff --git a/src/utils/CertificateProvider.js b/src/utils/CertificateProvider.js index 9df809b53..93b5d980e 100644 --- a/src/utils/CertificateProvider.js +++ b/src/utils/CertificateProvider.js @@ -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 { + 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 { 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; }); } diff --git a/src/utils/openssl-wrapper-with-promises.js b/src/utils/openssl-wrapper-with-promises.js index 763bfd67d..5d21452a5 100644 --- a/src/utils/openssl-wrapper-with-promises.js +++ b/src/utils/openssl-wrapper-with-promises.js @@ -6,6 +6,7 @@ */ import {exec as opensslWithCallback} from 'openssl-wrapper'; +const child_process = require('child_process'); export function openssl(action: string, options: {}): Promise { return new Promise((resolve, reject) => { @@ -17,3 +18,7 @@ export function openssl(action: string, options: {}): Promise { }); }); } + +export function isInstalled(): boolean { + return !child_process.spawnSync('openssl', ['version']).error; +} diff --git a/xplat/Sonar/SonarKitCPP.podspec b/xplat/Sonar/Sonar.podspec similarity index 67% rename from xplat/Sonar/SonarKitCPP.podspec rename to xplat/Sonar/Sonar.podspec index 3fe3e83bf..e32744c57 100644 --- a/xplat/Sonar/SonarKitCPP.podspec +++ b/xplat/Sonar/Sonar.podspec @@ -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