fbshipit-source-id: 2cd940396d650342920b28835f6e672febe6b55c
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:allowBackup="false"
|
||||
android:theme="@style/NoTitleBarWhiteBG">
|
||||
android:theme="@style/NoTitleBarWhiteBG"
|
||||
android:debuggable="true">
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
@@ -25,8 +25,8 @@ buildscript {
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,7 @@ Once you start Sonar and launch an emulator/simulator or connect a device, you w
|
||||
|
||||
### Setup your Android app
|
||||
|
||||
#### Including Sonar via jcenter
|
||||
|
||||
**Sonar is still being deployed to jcenter so you may need to include the .aar manually.**
|
||||
|
||||
Add dependencies to your `build.gradle` file.
|
||||
Sonar is distributed via JCenter. Add dependencies to your `build.gradle` file.
|
||||
|
||||
```
|
||||
repositories {
|
||||
@@ -39,23 +35,6 @@ dependencies {
|
||||
}
|
||||
```
|
||||
|
||||
#### Manually including sonar.aar
|
||||
|
||||
Download the latest .aar from [GitHub releases](https://github.com/facebook/Sonar/releases) and put it in your app's libs/ folder.
|
||||
|
||||
```
|
||||
repositories {
|
||||
jcenter()
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
debugCompile(name:'sonar-0.0.1', ext:'aar')
|
||||
}
|
||||
```
|
||||
|
||||
Now you can initialize Sonar in your Application's `onCreate`-method like this:
|
||||
|
||||
```java
|
||||
@@ -76,20 +55,42 @@ public class MyApplication extends Application {
|
||||
|
||||
### Setup your iOS app
|
||||
|
||||
To integrate with our iOS app, you can use [CocoaPods](https://cocoapods.org). Add the mobile Sonar SDK to your `Podfile`:
|
||||
To integrate with an iOS app, you can use [CocoaPods](https://cocoapods.org). Add the mobile Sonar SDK and its dependencies to your `Podfile`:
|
||||
|
||||
```ruby
|
||||
platform :ios, '8.0'
|
||||
swift_version = '4.1'
|
||||
|
||||
target 'MyApp' do
|
||||
pod 'Sonar', '~> 0.0.1'
|
||||
en
|
||||
|
||||
pod 'RSocket', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/RSocket.podspec?token=ADr9NE_I05Vu8g7oq_g6g_9FLx784NFmks5bJ5LvwA%3D%3D'
|
||||
pod 'DoubleConversion', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/DoubleConversion.podspec?token=ADr9NOxtIEmr5ODP9PWq6-sht-Ye6UYGks5bJ5MjwA%3D%3D'
|
||||
pod 'glog', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/glog.podspec?token=ADr9NBHbrlbkFR3DQTPzj0CnZdria4jvks5bJ5M3wA%3D%3D'
|
||||
pod 'Folly', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/Folly.podspec?token=ADr9NNTjwJ8xqLFwc3Qz3xB3GsCk-Esmks5bJ5NGwA%3D%3D'
|
||||
pod 'PeerTalk', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/PeerTalk.podspec?token=ADr9NB8frQTrUWytsMXtdv_P8km7jV_Mks5bJ5NbwA%3D%3D'
|
||||
pod 'Yoga','~>1.8.1', :modular_headers => true
|
||||
pod 'Sonar', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/xplat/Sonar/Sonar.podspec?token=ADr9NFO7byH9uAuhGAIEYuoJeBNyBxf6ks5bJ5N8wA%3D%3D'
|
||||
pod 'SonarKit', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/SonarKit.podspec?token=ADr9NBuYoodM_NeysQg899hkxXw0WZ7Xks5bJ5OVwA%3D%3D'
|
||||
pod 'SonarKit/SonarKitLayoutComponentKitSupport', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/SonarKit.podspec?token=ADr9NBuYoodM_NeysQg899hkxXw0WZ7Xks5bJ5OVwA%3D%3D'
|
||||
pod 'SonarKit/SKIOSNetworkPlugin', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/SonarKit.podspec?token=ADr9NBuYoodM_NeysQg899hkxXw0WZ7Xks5bJ5OVwA%3D%3D'
|
||||
pod 'ComponentKit', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/ComponentKit.podspec?token=ADr9NNV9gqkpFTUKaHpCiYOZIG3Ev-Hyks5bJ5O-wA%3D%3D'
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
if ['YogaKit'].include? target.name
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['SWIFT_VERSION'] = swift_version
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
and install the dependencies by running `pod install`. When you open the Xcode workspace file for your app, you now can import and initialize Sonar in your AppDelegate.
|
||||
|
||||
```objective-c
|
||||
#import <Sonar/SonarClient.h>
|
||||
#import <SonarKit/SonarClient.h>
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
@@ -104,6 +105,12 @@ and install the dependencies by running `pod install`. When you open the Xcode w
|
||||
}
|
||||
@end
|
||||
```
|
||||
<div class='warning'>
|
||||
|
||||
* We haven't released the dependency to CocoaPods, because we weren't able to successfully validate the podspec of SonarKit. You could help us out by fixing this [issue](https://github.com/facebook/Sonar/issues/11) by submitting a PR to the repo.
|
||||
* If you do not use CocoaPods as a dependency management tool then currently there is no way to integrate SonarKit other than manually including all the dependencies and building it.
|
||||
* Also Sonar doesn't work with swift projects as its written in C++ and had C++ dependencies. But we are working on supporting sonar for swift projects. You can find this issue [here](https://github.com/facebook/Sonar/issues/13)
|
||||
</div>
|
||||
|
||||
## Ready for takeoff
|
||||
|
||||
|
||||
35
flow-typed/electron-menu.js
vendored
35
flow-typed/electron-menu.js
vendored
@@ -31,7 +31,12 @@ type Electron$MenuRoles =
|
||||
| 'help'
|
||||
| 'services';
|
||||
|
||||
type Electron$MenuType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio';
|
||||
type Electron$MenuType =
|
||||
| 'normal'
|
||||
| 'separator'
|
||||
| 'submenu'
|
||||
| 'checkbox'
|
||||
| 'radio';
|
||||
|
||||
type Electron$MenuItemOptions = {
|
||||
click?: (
|
||||
@@ -54,25 +59,27 @@ type Electron$MenuItemOptions = {
|
||||
};
|
||||
|
||||
declare class Electron$MenuItem {
|
||||
constructor: (options: Electron$MenuItemOptions) => void,
|
||||
enabled: boolean,
|
||||
visible: boolean,
|
||||
checked: boolean,
|
||||
constructor: (options: Electron$MenuItemOptions) => void;
|
||||
enabled: boolean;
|
||||
visible: boolean;
|
||||
checked: boolean;
|
||||
}
|
||||
|
||||
declare class Electron$Menu {
|
||||
static setApplicationMenu: (menu: Electron$Menu) => void,
|
||||
static getApplicationMenu: () => ?Electron$Menu,
|
||||
static sendActionToFirstResponder: (action: string) => void,
|
||||
static buildFromTemplate: (templates: Array<Electron$MenuItemOptions>) => Electron$Menu,
|
||||
static setApplicationMenu: (menu: Electron$Menu) => void;
|
||||
static getApplicationMenu: () => ?Electron$Menu;
|
||||
static sendActionToFirstResponder: (action: string) => void;
|
||||
static buildFromTemplate: (
|
||||
templates: Array<Electron$MenuItemOptions>,
|
||||
) => Electron$Menu;
|
||||
popup: (
|
||||
browserWindow: Object,
|
||||
x?: number,
|
||||
y?: number,
|
||||
positioningItem?: number,
|
||||
) => void,
|
||||
popup: (x?: number, y?: number, positioningItem?: number) => void,
|
||||
append: (menuItem: Electron$MenuItem) => void,
|
||||
insert: (pos: number, menuItem: Electron$MenuItem) => void,
|
||||
items: Array<Electron$MenuItem>,
|
||||
) => void;
|
||||
popup: (x?: number, y?: number, positioningItem?: number) => void;
|
||||
append: (menuItem: Electron$MenuItem) => void;
|
||||
insert: (pos: number, menuItem: Electron$MenuItem) => void;
|
||||
items: Array<Electron$MenuItem>;
|
||||
}
|
||||
|
||||
@@ -115,14 +115,23 @@ FB_LINKABLE(CKComponent_Sonar)
|
||||
}
|
||||
|
||||
for (auto responder : action.second) {
|
||||
id initialTarget = _CKTypedComponentDebugInitialTarget(responder).get(self);
|
||||
const CKActionInfo actionInfo = CKActionFind(responder.selector(), initialTarget);
|
||||
[responders addObject: @{
|
||||
@"initialTarget": SKObject(NSStringFromClass([initialTarget class])),
|
||||
@"identifier": SKObject(@(responder.identifier().c_str())),
|
||||
@"handler": SKObject(NSStringFromClass([actionInfo.responder class])),
|
||||
@"selector": SKObject(NSStringFromSelector(responder.selector())),
|
||||
}];
|
||||
auto debugTarget = _CKTypedComponentDebugInitialTarget(responder);
|
||||
if (debugTarget.isBlockBaseAction()) {
|
||||
[responders addObject: @{
|
||||
@"identifier": SKObject(@(responder.identifier().c_str())),
|
||||
@"selector": SKObject(NSStringFromSelector(responder.selector())),
|
||||
}];
|
||||
|
||||
} else {
|
||||
id initialTarget = debugTarget.get(self);
|
||||
const CKActionInfo actionInfo = CKActionFind(responder.selector(), initialTarget);
|
||||
[responders addObject: @{
|
||||
@"initialTarget": SKObject(NSStringFromClass([initialTarget class])),
|
||||
@"identifier": SKObject(@(responder.identifier().c_str())),
|
||||
@"handler": SKObject(NSStringFromClass([actionInfo.responder class])),
|
||||
@"selector": SKObject(NSStringFromSelector(responder.selector())),
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,12 @@ target 'SonarKit' do
|
||||
|
||||
# Pods for SonarKit
|
||||
|
||||
pod 'PeerTalk', :podspec => 'third-party-podspecs/PeerTalk.podspec'
|
||||
pod 'RSocket', :podspec => 'third-party-podspecs/RSocket.podspec'
|
||||
# Third party deps podspec link
|
||||
pod 'EasyWSClient', :podspec => 'third-party-podspecs/EasyWSClient.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/Sonar.podspec'
|
||||
pod 'Sonar', :podspec => '../xplat/Sonar/SonarKitCPP.podspec'
|
||||
pod 'CocoaAsyncSocket'
|
||||
pod 'PeerTalk', :git => 'https://github.com/rsms/peertalk'
|
||||
end
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
PODS:
|
||||
- boost-for-react-native (1.63.0)
|
||||
- CocoaAsyncSocket (7.6.3)
|
||||
- CocoaLibEvent (1.0.0)
|
||||
- DoubleConversion (3.0.0)
|
||||
- Folly (2018.05.28.00):
|
||||
- boost-for-react-native
|
||||
- CocoaLibEvent (~> 1.0)
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- glog (0.3.5)
|
||||
- OpenSSL-Static (1.0.2.c1)
|
||||
- PeerTalk (1.0.0)
|
||||
- RSocket (0.10.0):
|
||||
- Folly
|
||||
- Sonar (0.0.1):
|
||||
- Folly
|
||||
- RSocket
|
||||
|
||||
DEPENDENCIES:
|
||||
- CocoaAsyncSocket
|
||||
- DoubleConversion (from `third-party-podspecs/DoubleConversion.podspec`)
|
||||
- Folly (from `third-party-podspecs/Folly.podspec`)
|
||||
- glog (from `third-party-podspecs/glog.podspec`)
|
||||
- PeerTalk (from `third-party-podspecs/PeerTalk.podspec`)
|
||||
- RSocket (from `third-party-podspecs/RSocket.podspec`)
|
||||
- Sonar (from `../xplat/Sonar/Sonar.podspec`)
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- boost-for-react-native
|
||||
- CocoaAsyncSocket
|
||||
- CocoaLibEvent
|
||||
- OpenSSL-Static
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
DoubleConversion:
|
||||
:podspec: third-party-podspecs/DoubleConversion.podspec
|
||||
Folly:
|
||||
:podspec: third-party-podspecs/Folly.podspec
|
||||
glog:
|
||||
:podspec: third-party-podspecs/glog.podspec
|
||||
PeerTalk:
|
||||
:podspec: third-party-podspecs/PeerTalk.podspec
|
||||
RSocket:
|
||||
:podspec: third-party-podspecs/RSocket.podspec
|
||||
Sonar:
|
||||
:podspec: "../xplat/Sonar/Sonar.podspec"
|
||||
|
||||
CHECKOUT OPTIONS:
|
||||
PeerTalk:
|
||||
:commit: 588303b43efa5082d654b6f75d1b84a6ba4b5b9e
|
||||
:git: https://github.com/rsms/PeerTalk.git
|
||||
RSocket:
|
||||
:commit: 11491fb22aaaf29b2702a1723561db51b314dd0f
|
||||
:git: https://github.com/rsocket/rsocket-cpp.git
|
||||
Sonar:
|
||||
:commit: e6f1e3f018cb4eb8d1d1bfd09851a780f08656fd
|
||||
:git: https://github.com/facebook/Sonar.git
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
||||
CocoaAsyncSocket: eafaa68a7e0ec99ead0a7b35015e0bf25d2c8987
|
||||
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
||||
DoubleConversion: 9bd61b1134a393694e95e0950c5bf3f99534817f
|
||||
Folly: 551752534f77d816ebf69195405d9d0fbd3efcc0
|
||||
glog: fdb5d40eb83acd6a4d5d61d95ecc583f5970a119
|
||||
OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e
|
||||
PeerTalk: aadc42bc7d7f19e89f817b59ef8196305a711504
|
||||
RSocket: e9ee232080f995ba8f403ccf4cb61238a5646cb6
|
||||
Sonar: 29d8fb9b010e56fa1358be996d68d4b436dd8c21
|
||||
|
||||
PODFILE CHECKSUM: c3be9232e8e3190250398e3f9b310c5585d7d26b
|
||||
|
||||
COCOAPODS: 1.5.2
|
||||
@@ -6,17 +6,18 @@ swift_version = "4.1"
|
||||
|
||||
target 'Sample' do
|
||||
|
||||
pod 'RSocket', :podspec => '../third-party-podspecs/RSocket.podspec'
|
||||
pod 'EasyWSClient', :podspec => '../third-party-podspecs/EasyWSClient.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', :podspec => '../third-party-podspecs/PeerTalk.podspec'
|
||||
pod 'PeerTalk', :git => 'https://github.com/rsms/peertalk'
|
||||
pod 'ComponentKit', :podspec => '../third-party-podspecs/ComponentKit.podspec'
|
||||
pod 'Yoga','~>1.8.1', :modular_headers => true
|
||||
pod 'Sonar', :podspec => '../../xplat/Sonar/Sonar.podspec'
|
||||
pod 'SonarKit', :podspec => '../../SonarKit.podspec'
|
||||
pod 'SonarKit/SonarKitLayoutComponentKitSupport', :podspec => '../../SonarKit.podspec'
|
||||
pod 'SonarKit/SKIOSNetworkPlugin', :podspec => '../../SonarKit.podspec'
|
||||
pod 'Sonar', :podspec => '../../xplat/Sonar/SonarKitCPP.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
|
||||
|
||||
@@ -1,62 +1,53 @@
|
||||
PODS:
|
||||
- boost-for-react-native (1.63.0)
|
||||
- CocoaAsyncSocket (7.6.3)
|
||||
- CocoaLibEvent (1.0.0)
|
||||
- ComponentKit (0.21):
|
||||
- Yoga
|
||||
- DoubleConversion (3.0.0)
|
||||
- Folly (2018.05.28.00):
|
||||
- EasyWSClient (1.0.0)
|
||||
- Folly (2018.05.07.00):
|
||||
- boost-for-react-native
|
||||
- CocoaLibEvent (~> 1.0)
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- glog (0.3.5)
|
||||
- OpenSSL-Static (1.0.2.c1)
|
||||
- PeerTalk (1.0.0)
|
||||
- RSocket (0.10.0):
|
||||
- PeerTalk (0.0.2)
|
||||
- Sonar (1.0.0):
|
||||
- EasyWSClient
|
||||
- Folly
|
||||
- Sonar (0.0.1):
|
||||
- Folly
|
||||
- RSocket
|
||||
- SonarKit (0.0.1):
|
||||
- SonarKit (1.0.0):
|
||||
- CocoaAsyncSocket (~> 7.6)
|
||||
- Folly
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- PeerTalk
|
||||
- Sonar
|
||||
- SonarKit/SKIOSNetworkPlugin (= 0.0.1)
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (= 0.0.1)
|
||||
- SonarKit/SonarKitLayoutPlugin (= 0.0.1)
|
||||
- SonarKit/SonarKitNetworkPlugin (= 0.0.1)
|
||||
- SonarKit/SKIOSNetworkPlugin (0.0.1):
|
||||
- SonarKit/SKIOSNetworkPlugin (= 1.0.0)
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (= 1.0.0)
|
||||
- SonarKit/SonarKitLayoutPlugin (= 1.0.0)
|
||||
- SonarKit/SonarKitNetworkPlugin (= 1.0.0)
|
||||
- SonarKit/SonarKitNetworkPlugin (= 1.0.0)
|
||||
- SonarKit/SKIOSNetworkPlugin (1.0.0):
|
||||
- CocoaAsyncSocket (~> 7.6)
|
||||
- Folly
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- PeerTalk
|
||||
- Sonar
|
||||
- SonarKit/SonarKitNetworkPlugin
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (0.0.1):
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (1.0.0):
|
||||
- CocoaAsyncSocket (~> 7.6)
|
||||
- ComponentKit
|
||||
- Folly
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- PeerTalk
|
||||
- Sonar
|
||||
- SonarKit/SonarKitLayoutPlugin
|
||||
- Yoga (~> 1.8)
|
||||
- SonarKit/SonarKitLayoutPlugin (0.0.1):
|
||||
- Yoga (= 1.8.1)
|
||||
- SonarKit/SonarKitLayoutPlugin (1.0.0):
|
||||
- CocoaAsyncSocket (~> 7.6)
|
||||
- Folly
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- PeerTalk
|
||||
- Sonar
|
||||
- Yoga (~> 1.8)
|
||||
- Yoga (= 1.8.1)
|
||||
- YogaKit (= 1.8.1)
|
||||
- SonarKit/SonarKitNetworkPlugin (0.0.1):
|
||||
- SonarKit/SonarKitNetworkPlugin (1.0.0):
|
||||
- CocoaAsyncSocket (~> 7.6)
|
||||
- Folly
|
||||
- OpenSSL-Static (= 1.0.2.c1)
|
||||
- PeerTalk
|
||||
- Sonar
|
||||
- Yoga (1.8.1)
|
||||
@@ -66,22 +57,20 @@ PODS:
|
||||
DEPENDENCIES:
|
||||
- ComponentKit (from `../third-party-podspecs/ComponentKit.podspec`)
|
||||
- DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`)
|
||||
- EasyWSClient (from `../third-party-podspecs/EasyWSClient.podspec`)
|
||||
- Folly (from `../third-party-podspecs/Folly.podspec`)
|
||||
- glog (from `../third-party-podspecs/glog.podspec`)
|
||||
- PeerTalk (from `../third-party-podspecs/PeerTalk.podspec`)
|
||||
- RSocket (from `../third-party-podspecs/RSocket.podspec`)
|
||||
- Sonar (from `../../xplat/Sonar/Sonar.podspec`)
|
||||
- SonarKit (from `../../SonarKit.podspec`)
|
||||
- SonarKit/SKIOSNetworkPlugin (from `../../SonarKit.podspec`)
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (from `../../SonarKit.podspec`)
|
||||
- PeerTalk (from `https://github.com/rsms/peertalk`)
|
||||
- Sonar (from `../../xplat/Sonar/SonarKitCPP.podspec`)
|
||||
- SonarKit (from `../SonarKit.podspec`)
|
||||
- SonarKit/SKIOSNetworkPlugin (from `../SonarKit.podspec`)
|
||||
- SonarKit/SonarKitLayoutComponentKitSupport (from `../SonarKit.podspec`)
|
||||
- Yoga (~> 1.8.1)
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- boost-for-react-native
|
||||
- CocoaAsyncSocket
|
||||
- CocoaLibEvent
|
||||
- OpenSSL-Static
|
||||
- Yoga
|
||||
- YogaKit
|
||||
|
||||
@@ -90,52 +79,50 @@ EXTERNAL SOURCES:
|
||||
:podspec: "../third-party-podspecs/ComponentKit.podspec"
|
||||
DoubleConversion:
|
||||
:podspec: "../third-party-podspecs/DoubleConversion.podspec"
|
||||
EasyWSClient:
|
||||
:podspec: "../third-party-podspecs/EasyWSClient.podspec"
|
||||
Folly:
|
||||
:podspec: "../third-party-podspecs/Folly.podspec"
|
||||
glog:
|
||||
:podspec: "../third-party-podspecs/glog.podspec"
|
||||
PeerTalk:
|
||||
:podspec: "../third-party-podspecs/PeerTalk.podspec"
|
||||
RSocket:
|
||||
:podspec: "../third-party-podspecs/RSocket.podspec"
|
||||
:git: https://github.com/rsms/peertalk
|
||||
Sonar:
|
||||
:podspec: "../../xplat/Sonar/Sonar.podspec"
|
||||
:podspec: "../../xplat/Sonar/SonarKitCPP.podspec"
|
||||
SonarKit:
|
||||
:podspec: "../../SonarKit.podspec"
|
||||
:podspec: "../SonarKit.podspec"
|
||||
|
||||
CHECKOUT OPTIONS:
|
||||
ComponentKit:
|
||||
:commit: 73acd7995610ad6b009a9a74b8290a54dab7c716
|
||||
:commit: f801317e71f88fbb5a398cd726fc0375255f43ba
|
||||
:git: https://github.com/facebook/ComponentKit.git
|
||||
EasyWSClient:
|
||||
:commit: 9b87dc488048900a8cd684f51ddc98143682dbc3
|
||||
:git: https://github.com/dhbaird/easywsclient.git
|
||||
PeerTalk:
|
||||
:commit: 588303b43efa5082d654b6f75d1b84a6ba4b5b9e
|
||||
:git: https://github.com/rsms/PeerTalk.git
|
||||
RSocket:
|
||||
:commit: 11491fb22aaaf29b2702a1723561db51b314dd0f
|
||||
:git: https://github.com/rsocket/rsocket-cpp.git
|
||||
:git: https://github.com/rsms/peertalk
|
||||
Sonar:
|
||||
:commit: a0959cf41cb51e7571066877ee2b7090659913b8
|
||||
:commit: 26c298ad3401157ac2b7336218c1dde63260dc0c
|
||||
:git: https://github.com/facebook/Sonar.git
|
||||
SonarKit:
|
||||
:commit: a0959cf41cb51e7571066877ee2b7090659913b8
|
||||
:commit: 26c298ad3401157ac2b7336218c1dde63260dc0c
|
||||
:git: https://github.com/facebook/Sonar.git
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
||||
CocoaAsyncSocket: eafaa68a7e0ec99ead0a7b35015e0bf25d2c8987
|
||||
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
||||
ComponentKit: 7bd0ad508946aeb68dd52ed8739ced9846ff3671
|
||||
DoubleConversion: 9bd61b1134a393694e95e0950c5bf3f99534817f
|
||||
Folly: 551752534f77d816ebf69195405d9d0fbd3efcc0
|
||||
glog: fdb5d40eb83acd6a4d5d61d95ecc583f5970a119
|
||||
OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e
|
||||
PeerTalk: aadc42bc7d7f19e89f817b59ef8196305a711504
|
||||
RSocket: e9ee232080f995ba8f403ccf4cb61238a5646cb6
|
||||
Sonar: 29d8fb9b010e56fa1358be996d68d4b436dd8c21
|
||||
SonarKit: ac1fff5cc54ddb394282e78542ae67a781dab4f5
|
||||
DoubleConversion: 310ccd7cdf00175c32883664f84fe026025604df
|
||||
EasyWSClient: 7ec8effe7d86f6061a47d19a55355769c9edfd2f
|
||||
Folly: 2d29ed217455246ae583ff1980f9ce882af31e80
|
||||
glog: f175af2df1f453be65bd355b287a07c842927a99
|
||||
PeerTalk: f5389c286e4d477e59b73dfbf25c5c70a2464761
|
||||
Sonar: 815b6c6357c78564d9132f6389605b285a06f052
|
||||
SonarKit: 29b45073b54d7f5db13e53b7afe6fb6f36c6bea7
|
||||
Yoga: e6f1fed82138c17da5332e15e5770abf0e9cc386
|
||||
YogaKit: bb90d11e297e06abef7e0cfb20e035a6bd00cdc4
|
||||
|
||||
PODFILE CHECKSUM: 7c2600fc131a2b041c967e8d6ffc2bd1a0383733
|
||||
PODFILE CHECKSUM: cab936292346d86ef8900c8f67d3c707dc421709
|
||||
|
||||
COCOAPODS: 1.5.2
|
||||
COCOAPODS: 1.5.2
|
||||
@@ -333,6 +333,7 @@
|
||||
"\"${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\"/**",
|
||||
@@ -360,6 +361,7 @@
|
||||
"-l\"CocoaAsyncSocket\"",
|
||||
"-l\"ComponentKit\"",
|
||||
"-l\"DoubleConversion\"",
|
||||
"-l\"EasyWSClient\"",
|
||||
"-l\"Folly\"",
|
||||
"-l\"PeerTalk\"",
|
||||
"-l\"Sonar\"",
|
||||
@@ -398,6 +400,7 @@
|
||||
"\"${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\"/**",
|
||||
@@ -425,6 +428,7 @@
|
||||
"-l\"CocoaAsyncSocket\"",
|
||||
"-l\"ComponentKit\"",
|
||||
"-l\"DoubleConversion\"",
|
||||
"-l\"EasyWSClient\"",
|
||||
"-l\"Folly\"",
|
||||
"-l\"PeerTalk\"",
|
||||
"-l\"Sonar\"",
|
||||
|
||||
@@ -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'
|
||||
yoga_version = '1.8.1'
|
||||
yogakit_version = '1.8.1'
|
||||
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'SonarKit'
|
||||
spec.version = '0.0.1'
|
||||
spec.version = '1.0.0'
|
||||
spec.license = { :type => 'MIT' }
|
||||
spec.homepage = 'https://github.com/facebook/Sonar'
|
||||
spec.summary = 'Sonar iOS podspec'
|
||||
spec.authors = 'Facebook'
|
||||
spec.static_framework = true
|
||||
# spec.prepare_command = 'mv src double-conversion'
|
||||
spec.source = { :git => 'https://github.com/facebook/Sonar.git',
|
||||
:branch=> "master" }
|
||||
spec.module_name = 'SonarKit'
|
||||
@@ -17,10 +17,8 @@ Pod::Spec.new do |spec|
|
||||
spec.dependency 'Sonar'
|
||||
spec.dependency 'CocoaAsyncSocket', '~> 7.6'
|
||||
spec.dependency 'PeerTalk'
|
||||
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.source_files = 'iOS/FBDefines/*.{h,cpp,m,mm}', 'iOS/SonarKit/**/*.{h,cpp,m,mm}'
|
||||
spec.public_header_files = 'iOS/SonarKit/CppBridge/*.{h}',
|
||||
'iOS/SonarKit/FBCxxUtils/*.{h}',
|
||||
'iOS/SonarKit/SonarClient.h',
|
||||
'iOS/SonarKit/SonarDeviceData.h',
|
||||
'iOS/SonarKit/SonarPlugin.h',
|
||||
@@ -28,10 +26,12 @@ 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",
|
||||
"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" }
|
||||
"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" }
|
||||
|
||||
spec.subspec "SonarKitLayoutPlugin" do |ss|
|
||||
ss.dependency "Yoga", yoga_version
|
||||
@@ -62,6 +62,7 @@ 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
|
||||
|
||||
@@ -72,6 +73,18 @@ 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
|
||||
|
||||
@@ -80,6 +93,7 @@ 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,8 +7,7 @@
|
||||
*/
|
||||
#import "SonarCppBridgingConnection.h"
|
||||
|
||||
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
|
||||
|
||||
#import "SKUtils.h"
|
||||
#import "SonarCppBridgingResponder.h"
|
||||
|
||||
@implementation SonarCppBridgingConnection
|
||||
@@ -28,7 +27,7 @@
|
||||
|
||||
- (void)send:(NSString *)method withParams:(NSDictionary *)params
|
||||
{
|
||||
conn_->send([method UTF8String], facebook::cxxutils::convertIdToFollyDynamic(params));
|
||||
conn_->send([method UTF8String], [SKUtils convertIdToFollyDynamic:params]);
|
||||
}
|
||||
|
||||
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
|
||||
@@ -37,7 +36,7 @@
|
||||
std::unique_ptr<facebook::sonar::SonarResponder> responder) {
|
||||
SonarCppBridgingResponder *const objCResponder =
|
||||
[[SonarCppBridgingResponder alloc] initWithCppResponder:std::move(responder)];
|
||||
receiver(facebook::cxxutils::convertFollyDynamicToId(message), objCResponder);
|
||||
receiver([SKUtils convertFollyDynamicToId: message], objCResponder);
|
||||
};
|
||||
conn_->receive([method UTF8String], lambda);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#import "SonarCppBridgingResponder.h"
|
||||
|
||||
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
|
||||
#import "SKUtils.h"
|
||||
|
||||
@implementation SonarCppBridgingResponder {
|
||||
std::unique_ptr<facebook::sonar::SonarResponder> responder_;
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
#pragma mark - SonarResponder
|
||||
|
||||
- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response)); }
|
||||
- (void)success:(NSDictionary *)response { responder_->success([SKUtils convertIdToFollyDynamic:response]); }
|
||||
|
||||
- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response)); }
|
||||
- (void)error:(NSDictionary *)response { responder_->error([SKUtils convertIdToFollyDynamic:response]); }
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
#pragma once
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include <folly/dynamic.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace cxxutils {
|
||||
|
||||
folly::dynamic convertIdToFollyDynamic(id json);
|
||||
id convertFollyDynamicToId(const folly::dynamic &dyn);
|
||||
|
||||
} }
|
||||
@@ -1,24 +0,0 @@
|
||||
<?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>
|
||||
52
iOS/SonarKit/SKUtils.h
Normal file
52
iOS/SonarKit/SKUtils.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2018-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.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <folly/dynamic.h>
|
||||
|
||||
namespace facebook { namespace sonar {
|
||||
#define _C_ID '@'
|
||||
#define _C_CLASS '#'
|
||||
#define _C_SEL ':'
|
||||
#define _C_CHR 'c'
|
||||
#define _C_UCHR 'C'
|
||||
#define _C_SHT 's'
|
||||
#define _C_USHT 'S'
|
||||
#define _C_INT 'i'
|
||||
#define _C_UINT 'I'
|
||||
#define _C_LNG 'l'
|
||||
#define _C_ULNG 'L'
|
||||
#define _C_LNG_LNG 'q'
|
||||
#define _C_ULNG_LNG 'Q'
|
||||
#define _C_FLT 'f'
|
||||
#define _C_DBL 'd'
|
||||
#define _C_BFLD 'b'
|
||||
#define _C_BOOL 'B'
|
||||
#define _C_VOID 'v'
|
||||
#define _C_UNDEF '?'
|
||||
#define _C_PTR '^'
|
||||
#define _C_CHARPTR '*'
|
||||
#define _C_ATOM '%'
|
||||
#define _C_ARY_B '['
|
||||
#define _C_ARY_E ']'
|
||||
#define _C_UNION_B '('
|
||||
#define _C_UNION_E ')'
|
||||
#define _C_STRUCT_B '{'
|
||||
#define _C_STRUCT_E '}'
|
||||
#define _C_VECTOR '!'
|
||||
#define _C_CONST 'r'
|
||||
}
|
||||
}
|
||||
|
||||
@interface SKUtils: NSObject
|
||||
+ (folly::dynamic)convertIdToFollyDynamic:(id)json;
|
||||
+ (id)convertFollyDynamicToId:(const folly::dynamic &)dyn;
|
||||
|
||||
@end
|
||||
@@ -1,17 +1,97 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import "FBCxxFollyDynamicConvert.h"
|
||||
|
||||
#import <objc/runtime.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace cxxutils {
|
||||
|
||||
/*
|
||||
* The implementation is taken from RCTFollyConvert(https://fburl.com/vzw8ql2q)
|
||||
* Copyright (c) 2018-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.
|
||||
*
|
||||
*/
|
||||
#include "SKUtils.h"
|
||||
|
||||
id convertFollyDynamicToId(const folly::dynamic &dyn) {
|
||||
#include <math.h>
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
using namespace facebook::sonar;
|
||||
|
||||
@implementation SKUtils
|
||||
|
||||
+ (folly::dynamic)convertIdToFollyDynamic:(id)json
|
||||
{
|
||||
if (json == nil || json == (id)kCFNull) {
|
||||
return nullptr;
|
||||
} else if ([json isKindOfClass:[NSNumber class]]) {
|
||||
const char *objCType = [json objCType];
|
||||
switch (objCType[0]) {
|
||||
// This is a c++ bool or C99 _Bool. On some platforms, BOOL is a bool.
|
||||
case _C_BOOL:
|
||||
return (bool) [json boolValue];
|
||||
case _C_CHR:
|
||||
// On some platforms, objc BOOL is a signed char, but it
|
||||
// might also be a small number. Use the same hack JSC uses
|
||||
// to distinguish them:
|
||||
// https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbobjc/xplat/third-party/jsc/safari-600-1-4-17/JavaScriptCore/API/JSValue.mm;b8ee03916489f8b12143cd5c0bca546da5014fc9$901
|
||||
if ([json isKindOfClass:[@YES class]]) {
|
||||
return (bool) [json boolValue];
|
||||
} else {
|
||||
const auto value = [json longLongValue];
|
||||
if (isnan(value) || isinf(value)) {
|
||||
return nullptr;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
case _C_UCHR:
|
||||
case _C_SHT:
|
||||
case _C_USHT:
|
||||
case _C_INT:
|
||||
case _C_UINT:
|
||||
case _C_LNG:
|
||||
case _C_ULNG:
|
||||
case _C_LNG_LNG:
|
||||
case _C_ULNG_LNG: {
|
||||
const auto value = [json longLongValue];
|
||||
if (isnan(value) || isinf(value)) {
|
||||
return nullptr;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
case _C_FLT:
|
||||
case _C_DBL: {
|
||||
const auto value = [json doubleValue];
|
||||
if (isnan(value) || isinf(value)) {
|
||||
return nullptr;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// default:
|
||||
// fall through
|
||||
}
|
||||
} else if ([json isKindOfClass:[NSString class]]) {
|
||||
NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];
|
||||
return std::string(reinterpret_cast<const char*>(data.bytes),
|
||||
data.length);
|
||||
} else if ([json isKindOfClass:[NSArray class]]) {
|
||||
folly::dynamic array = folly::dynamic::array;
|
||||
for (id element in json) {
|
||||
array.push_back([self convertIdToFollyDynamic:element]);
|
||||
}
|
||||
return array;
|
||||
} else if ([json isKindOfClass:[NSDictionary class]]) {
|
||||
__block folly::dynamic object = folly::dynamic::object();
|
||||
|
||||
[json enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, __unused BOOL *stop) {
|
||||
object.insert([self convertIdToFollyDynamic:key],
|
||||
[self convertIdToFollyDynamic:value]);
|
||||
}];
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (id)convertFollyDynamicToId:(const folly::dynamic &)dyn {
|
||||
// I could imagine an implementation which avoids copies by wrapping the
|
||||
// dynamic in a derived class of NSDictionary. We can do that if profiling
|
||||
// implies it will help.
|
||||
@@ -27,84 +107,22 @@ id convertFollyDynamicToId(const folly::dynamic &dyn) {
|
||||
return @(dyn.getDouble());
|
||||
case folly::dynamic::STRING:
|
||||
return [[NSString alloc] initWithBytes:dyn.c_str() length:dyn.size()
|
||||
encoding:NSUTF8StringEncoding];
|
||||
encoding:NSUTF8StringEncoding];
|
||||
case folly::dynamic::ARRAY: {
|
||||
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:dyn.size()];
|
||||
for (auto &elem : dyn) {
|
||||
[array addObject:convertFollyDynamicToId(elem)];
|
||||
[array addObject:[self convertFollyDynamicToId: elem]];
|
||||
}
|
||||
return array;
|
||||
}
|
||||
case folly::dynamic::OBJECT: {
|
||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:dyn.size()];
|
||||
for (auto &elem : dyn.items()) {
|
||||
dict[convertFollyDynamicToId(elem.first)] = convertFollyDynamicToId(elem.second);
|
||||
dict[[self convertFollyDynamicToId:elem.first]] = [self convertFollyDynamicToId:elem.second];
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
folly::dynamic convertIdToFollyDynamic(id json)
|
||||
{
|
||||
if (json == nil || json == (id)kCFNull) {
|
||||
return nullptr;
|
||||
} else if ([json isKindOfClass:[NSNumber class]]) {
|
||||
const char *objCType = [json objCType];
|
||||
switch (objCType[0]) {
|
||||
// This is a c++ bool or C99 _Bool. On some platforms, BOOL is a bool.
|
||||
case _C_BOOL:
|
||||
return (bool) [json boolValue];
|
||||
case _C_CHR:
|
||||
// On some platforms, objc BOOL is a signed char, but it
|
||||
// might also be a small number. Use the same hack JSC uses
|
||||
// to distinguish them:
|
||||
// https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbobjc/xplat/third-party/jsc/safari-600-1-4-17/JavaScriptCore/API/JSValue.mm;b8ee03916489f8b12143cd5c0bca546da5014fc9$901
|
||||
if ([json isKindOfClass:[@YES class]]) {
|
||||
return (bool) [json boolValue];
|
||||
} else {
|
||||
return [json longLongValue];
|
||||
}
|
||||
case _C_UCHR:
|
||||
case _C_SHT:
|
||||
case _C_USHT:
|
||||
case _C_INT:
|
||||
case _C_UINT:
|
||||
case _C_LNG:
|
||||
case _C_ULNG:
|
||||
case _C_LNG_LNG:
|
||||
case _C_ULNG_LNG:
|
||||
return [json longLongValue];
|
||||
|
||||
case _C_FLT:
|
||||
case _C_DBL:
|
||||
return [json doubleValue];
|
||||
|
||||
// default:
|
||||
// fall through
|
||||
}
|
||||
} else if ([json isKindOfClass:[NSString class]]) {
|
||||
NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];
|
||||
return std::string(reinterpret_cast<const char*>(data.bytes),
|
||||
data.length);
|
||||
} else if ([json isKindOfClass:[NSArray class]]) {
|
||||
folly::dynamic array = folly::dynamic::array;
|
||||
for (id element in json) {
|
||||
array.push_back(convertIdToFollyDynamic(element));
|
||||
}
|
||||
return array;
|
||||
} else if ([json isKindOfClass:[NSDictionary class]]) {
|
||||
__block folly::dynamic object = folly::dynamic::object();
|
||||
|
||||
[json enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, __unused BOOL *stop) {
|
||||
object.insert(convertIdToFollyDynamic(key),
|
||||
convertIdToFollyDynamic(value));
|
||||
}];
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
} }
|
||||
@end
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
41
iOS/scripts/ios-configure-glog.sh
Normal file
41
iOS/scripts/ios-configure-glog.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/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
|
||||
@@ -13,6 +13,6 @@ Pod::Spec.new do |spec|
|
||||
spec.libraries = "stdc++"
|
||||
spec.compiler_flags = '-std=c++1y'
|
||||
# Pinning to the same version as React.podspec.
|
||||
spec.platforms = { :ios => "8.0" }
|
||||
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
|
||||
|
||||
end
|
||||
|
||||
17
iOS/third-party-podspecs/EasyWSClient.podspec
Normal file
17
iOS/third-party-podspecs/EasyWSClient.podspec
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'Folly'
|
||||
spec.version = '2018.05.28.00'
|
||||
spec.version = '2018.05.07.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,9 +11,7 @@ Pod::Spec.new do |spec|
|
||||
spec.dependency 'boost-for-react-native'
|
||||
spec.dependency 'DoubleConversion'
|
||||
spec.dependency 'glog'
|
||||
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
|
||||
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
|
||||
@@ -27,27 +25,10 @@ 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/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'
|
||||
'folly/lang/Assume.cpp'
|
||||
|
||||
# workaround for https://github.com/facebook/react-native/issues/14326
|
||||
spec.preserve_paths = 'folly/*.h',
|
||||
@@ -57,16 +38,16 @@ Pod::Spec.new do |spec|
|
||||
'folly/detail/*.h',
|
||||
'folly/hash/*.h',
|
||||
'folly/memory/*.h',
|
||||
'folly/**/*.h',
|
||||
'folly/futures/detail/*.h',
|
||||
'folly/futures/*.h'
|
||||
'folly/**/*.h'
|
||||
|
||||
spec.header_mappings_dir = 'folly'
|
||||
spec.header_dir = 'folly'
|
||||
spec.libraries = "stdc++"
|
||||
spec.private_header_files = 'folly/portability/Stdlib.h',
|
||||
'folly/portability/Stdio.h'
|
||||
|
||||
'folly/portability/Malloc.h',
|
||||
'folly/portability/Stdlib.h',
|
||||
'folly/portability/Stdio.h',
|
||||
'folly/portability/PThread.h'
|
||||
spec.public_header_files = 'folly/portability/Config.h',
|
||||
'folly/Executor.h',
|
||||
'folly/Function.h',
|
||||
@@ -100,19 +81,15 @@ 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/portability/PThread.h',
|
||||
'folly/futures/*.h',
|
||||
'folly/futures/detail/*.h'
|
||||
'folly/*.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"}
|
||||
spec.platforms = { :ios => "8.0", :tvos => "10.0" }
|
||||
end
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = "libevent"
|
||||
s.version = "1.0"
|
||||
s.summary = "Unofficial libevent mirror for Cocoapods"
|
||||
|
||||
s.description = <<-DESC
|
||||
This is a binary distribution of the libevent library built for iOS.
|
||||
The library uses configure which makes it a bit tricky to cross compile.
|
||||
DESC
|
||||
|
||||
s.homepage = "http://libevent.org/"
|
||||
s.license = "BSD"
|
||||
s.authors = { "liguangming" => "cute@liguangming.com" }
|
||||
s.social_media_url = "http://twitter.com/liguangming"
|
||||
s.ios.deployment_target = "6.0"
|
||||
s.source = { :git => "https://github.com/cute/libevent.git", :tag => "1.0" }
|
||||
s.header_dir = "event2"
|
||||
s.source_files = "include/**/*.h"
|
||||
s.ios.library = "event"
|
||||
s.preserve_paths = "include", "lib"
|
||||
s.requires_arc = false
|
||||
s.xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/libevent/include",
|
||||
"HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/libevent/include/event2",
|
||||
"LIBRARY_SEARCH_PATHS" => "$(PODS_ROOT)/libevent/lib",
|
||||
}
|
||||
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
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
|
||||
@@ -1,53 +0,0 @@
|
||||
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
|
||||
@@ -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 = "#!/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.prepare_command = File.read("../scripts/ios-configure-glog.sh")
|
||||
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"}
|
||||
spec.platforms = { :ios => "8.0", :tvos => "9.2" }
|
||||
|
||||
end
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"eslint-plugin-relay": "^0.0.20",
|
||||
"flow-bin": "^0.69.0",
|
||||
"glob": "^7.1.2",
|
||||
"prettier": "1.12.1"
|
||||
"prettier": "1.13.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"JSONStream": "^1.3.1",
|
||||
|
||||
@@ -11,11 +11,13 @@ function jsonValue() {
|
||||
|
||||
git -c http.proxy=fwdproxy:8080 -c https.proxy=fwdproxy:8080 clone https://github.com/facebook/Sonar.git sonar-public
|
||||
cp sonar/scripts/sandcastle-build.sh sonar-public/scripts/sandcastle-build.sh
|
||||
# third-party dependencies are not on github, so we need to copy them in place
|
||||
cp -r sonar/third-party sonar-public/third-party
|
||||
cd sonar-public/scripts && ./sandcastle-build.sh "$(git rev-list HEAD --count || echo 0)"
|
||||
|
||||
VERSION=$(plutil -p ./sonar-public/dist/mac/Sonar.app/Contents/Info.plist | awk '/CFBundleShortVersionString/ {print substr($3, 2, length($3)-2)}')
|
||||
|
||||
RELEASE_JSON=$(curl $(fwdproxy-config curl) --silent --data '{
|
||||
RELEASE_JSON=$(curl -x fwdproxy:8080 --silent --data '{
|
||||
"tag_name": "v'$VERSION'",
|
||||
"target_commitish": "master",
|
||||
"name": "v'$VERSION'",
|
||||
@@ -33,7 +35,7 @@ fi
|
||||
|
||||
echo "Created GitHub release ID: $RELEASE_ID"
|
||||
UPLOAD_URL=$(echo $RELEASE_JSON | jsonValue upload_url| sed -e 's#{?name,label}##')
|
||||
ASSET_JSON=$(curl $(fwdproxy-config curl) --silent $UPLOAD_URL'?access_token='$TOKEN'&name=Sonar.zip' --header 'Content-Type: application/zip' --upload-file ./sonar-public/dist/Sonar.zip -X POST)
|
||||
ASSET_JSON=$(curl -x fwdproxy:8080 --silent $UPLOAD_URL'?access_token='$TOKEN'&name=Sonar.zip' --header 'Content-Type: application/zip' --upload-file ./sonar-public/dist/Sonar.zip -X POST)
|
||||
|
||||
DOWNLOAD_URL=$(echo $ASSET_JSON | jsonValue browser_download_url)
|
||||
|
||||
|
||||
@@ -202,9 +202,11 @@ export default class ScreenPlugin extends SonarDevicePlugin<State> {
|
||||
pullingData: true,
|
||||
});
|
||||
})
|
||||
.then((): Promise<string> => {
|
||||
return self.pullFromDevice(`/sdcard/${VIDEO_FILE_NAME}`, VIDEO_PATH);
|
||||
})
|
||||
.then(
|
||||
(): Promise<string> => {
|
||||
return self.pullFromDevice(`/sdcard/${VIDEO_FILE_NAME}`, VIDEO_PATH);
|
||||
},
|
||||
)
|
||||
.then(openFile)
|
||||
.then(() => {
|
||||
self.executeShell(`rm /sdcard/${VIDEO_FILE_NAME}`);
|
||||
|
||||
@@ -443,7 +443,7 @@ export class Server extends EventEmitter {
|
||||
this.certificateProvider.processCertificateSigningRequest(
|
||||
csr,
|
||||
connectionParameters.os,
|
||||
destination
|
||||
destination,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -113,7 +113,7 @@ export default class VirtualList extends Component<
|
||||
// Overscan: render blocks of rows modulo an overscan row count
|
||||
// This dramatically reduces DOM writes during scrolling
|
||||
if (overscanCount) {
|
||||
start = Math.max(0, start - start % overscanCount);
|
||||
start = Math.max(0, start - (start % overscanCount));
|
||||
visibleRowCount += overscanCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ const DesktopDropdownItemContainer = styled.view(
|
||||
type DesktopDropdownItemState = {|hovered: boolean|};
|
||||
|
||||
type DesktopDropdownItemProps = {
|
||||
onClick?: false | ?(event: SyntheticMouseEvent<>) => void,
|
||||
onHover?: false | ?() => React$Node,
|
||||
onClick?: false | ?((event: SyntheticMouseEvent<>) => void),
|
||||
onHover?: false | ?(() => React$Node),
|
||||
children?: React$Node,
|
||||
deactivate?: () => void,
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ const TableHeadColumnContainer = styled.view(
|
||||
const RIGHT_RESIZABLE = {right: true};
|
||||
|
||||
function calculatePercentage(parentWidth: number, selfWidth: number): string {
|
||||
return `${100 / parentWidth * selfWidth}%`;
|
||||
return `${(100 / parentWidth) * selfWidth}%`;
|
||||
}
|
||||
|
||||
class TableHeadColumn extends PureComponent<{
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook.
|
||||
* Copyright 2018-present Facebook.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {exec as opensslWithCallback} from 'openssl-wrapper';
|
||||
|
||||
export function openssl(action: string, options: {}): Promise<string> {
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {Rect} from './geometry.js';
|
||||
export const SNAP_SIZE = 16;
|
||||
|
||||
export function snapGrid(val: number): number {
|
||||
return val - val % SNAP_SIZE;
|
||||
return val - (val % SNAP_SIZE);
|
||||
}
|
||||
|
||||
export function getPossibleSnappedPosition(
|
||||
|
||||
@@ -47,7 +47,7 @@ class Footer extends React.Component {
|
||||
</div>
|
||||
<div>
|
||||
<h5>More</h5>
|
||||
<a href="https://twitter.com/fbsonar">Twitter</a>
|
||||
<a href="https://twitter.com/fb_sonar">Twitter</a>
|
||||
<a href={this.props.config.repoUrl}>GitHub</a>
|
||||
<a
|
||||
className="github-button"
|
||||
|
||||
@@ -322,3 +322,9 @@ footer iframe {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: rgb(253, 245, 212);
|
||||
border-left: 4px solid rgb(241, 196, 15);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'Sonar'
|
||||
spec.version = '0.0.1'
|
||||
spec.version = '1.0.0'
|
||||
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'
|
||||
@@ -12,12 +13,21 @@ Pod::Spec.new do |spec|
|
||||
spec.source_files = 'xplat/Sonar/*.{h,cpp,m,mm}'
|
||||
spec.libraries = "stdc++"
|
||||
spec.dependency 'Folly'
|
||||
spec.dependency 'RSocket'
|
||||
spec.dependency 'EasyWSClient'
|
||||
# spec.dependency 'boost-for-react-native'
|
||||
#
|
||||
# spec.dependency 'DoubleConversion'
|
||||
# spec.dependency 'Folly'
|
||||
# spec.dependency 'glog'
|
||||
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.platforms = { :ios => "8.0" }
|
||||
# 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.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)/RSocket\" \"$(PODS_ROOT)/DoubleConversion\"" }
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/EasyWSClient\" \"$(PODS_ROOT)/DoubleConversion\"" }
|
||||
end
|
||||
@@ -35,7 +35,7 @@
|
||||
#define PRIVATE_KEY_FILE "privateKey.pem"
|
||||
|
||||
static constexpr int reconnectIntervalSeconds = 2;
|
||||
static constexpr int connectionKeepaliveSeconds = 2;
|
||||
static constexpr int connectionKeepaliveSeconds = 10;
|
||||
static constexpr int securePort = 8088;
|
||||
static constexpr int insecurePort = 8089;
|
||||
|
||||
@@ -97,7 +97,7 @@ SonarWebSocketImpl::~SonarWebSocketImpl() {
|
||||
void SonarWebSocketImpl::start() {
|
||||
folly::makeFuture()
|
||||
.via(worker_->getEventBase())
|
||||
.delayed(std::chrono::milliseconds(0))
|
||||
.delayedUnsafe(std::chrono::milliseconds(0))
|
||||
.then([this]() { startSync(); });
|
||||
}
|
||||
|
||||
@@ -113,18 +113,13 @@ void SonarWebSocketImpl::startSync() {
|
||||
}
|
||||
|
||||
connectSecurely();
|
||||
} catch (const std::exception& e) {
|
||||
std::string errors = folly::SSLContext::getErrors();
|
||||
SONAR_LOG("Error connecting to sonar");
|
||||
SONAR_LOG(e.what());
|
||||
SONAR_LOG(errors.c_str());
|
||||
} catch (const std::exception&) {
|
||||
failedConnectionAttempts_++;
|
||||
reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void SonarWebSocketImpl::doCertificateExchange() {
|
||||
SONAR_LOG("Starting certificate exchange");
|
||||
|
||||
rsocket::SetupParameters parameters;
|
||||
folly::SocketAddress address;
|
||||
@@ -187,7 +182,7 @@ void SonarWebSocketImpl::connectSecurely() {
|
||||
void SonarWebSocketImpl::reconnect() {
|
||||
folly::makeFuture()
|
||||
.via(worker_->getEventBase())
|
||||
.delayed(std::chrono::seconds(reconnectIntervalSeconds))
|
||||
.delayedUnsafe(std::chrono::seconds(reconnectIntervalSeconds))
|
||||
.then([this]() { startSync(); });
|
||||
}
|
||||
|
||||
@@ -216,11 +211,6 @@ void SonarWebSocketImpl::sendMessage(const folly::dynamic& message) {
|
||||
|
||||
bool SonarWebSocketImpl::isCertificateExchangeNeeded() {
|
||||
if (failedConnectionAttempts_ >= 2) {
|
||||
auto format =
|
||||
"Requesting fresh certificate exchange after %d failed connection attempts";
|
||||
char buff[strlen(format) + 1];
|
||||
sprintf(buff, format, failedConnectionAttempts_);
|
||||
SONAR_LOG(buff);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -238,7 +228,6 @@ bool SonarWebSocketImpl::isCertificateExchangeNeeded() {
|
||||
}
|
||||
|
||||
void SonarWebSocketImpl::requestSignedCertFromSonar() {
|
||||
SONAR_LOG("Requesting new client certificate from Sonar");
|
||||
std::string csr = loadStringFromFile(absoluteFilePath(CSR_FILE_NAME));
|
||||
if (csr == "") {
|
||||
generateCertSigningRequest(
|
||||
|
||||
@@ -3874,9 +3874,9 @@ preserve@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||
|
||||
prettier@1.12.1:
|
||||
version "1.12.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
|
||||
prettier@1.13.4:
|
||||
version "1.13.4"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.4.tgz#31bbae6990f13b1093187c731766a14036fa72e6"
|
||||
|
||||
pretty-bytes@^1.0.2:
|
||||
version "1.0.4"
|
||||
|
||||
Reference in New Issue
Block a user