Commit Graph

166 Commits

Author SHA1 Message Date
Hilal Alsibai
55930db6a6 Open source desktop shared preferences plugin
Summary: The Android plugin has already been open sourced. This seemed to have fallen through the cracks.

Reviewed By: danielbuechele

Differential Revision: D8661536

fbshipit-source-id: eefbf224230f055db7ab5b5a0e04c192d3309132
2018-07-02 11:05:14 -07:00
Marc Terns
9ad693ca05 CocoaPods Private Repo support (#107)
Summary:
This PR brings us one step closer for publishing SonarKit.podspec to the public Cocoapods master repository. This solves [#93](https://github.com/facebook/Sonar/issues/93).

- [X] `SonarKit.podspec` now lints by passing the `--sources` flag and the `--use-libraries` flag. `pod spec lint  SonarKit.podspec --sources=https://github.com/facebook/Sonar,master --allow-warnings --use-libraries` Same for `pod repo push`.

- [X] `SonarKit.podspec` is now also published to the CocoaPods Private repo. What does this mean? It means that we no longer need to manually define all of `SonarKit` dependencies in the Podfile. It only takes `SonarKit` consumers to add this line `source 'https://github.com/facebook/Sonar.git'` on top of any Podfile, and `SonarKit` will be installed by just defining it with `pod SonarKit`.

- [X] We are publishing a Cocoapods Private Repo in the meantime we don't have all of our dependencies updated and published to the CocoaPods master repo. The CocoaPods Private Repo contains updated dependency podspecs that will need to be published to the CocoaPods master repo in the near future. That will be the next action item in order to have SonarKit.podspec published as well.

- [X] Sample App Podfile has been refactored, much simpler and cleaner.

- [X] SonarKit Framework project now pulls its dependencies from the cocoapods master repository and the temporary private repository instead of the local podspecs. I am able to compile the SonarKit framework project now, before I was unable to.

- [X] Local third party podspec dependencies have been removed.

emilsjolander priteshrnandgaonkar noahsark769 feel free to contribute or expose any concerns.
Closes https://github.com/facebook/Sonar/pull/107

Reviewed By: danielbuechele

Differential Revision: D8694271

Pulled By: priteshrnandgaonkar

fbshipit-source-id: dcccf70d917cad1e27606a29c0b921883bf9a76f
2018-07-02 08:33:07 -07:00
Pascal Hartig
e11a587426 Update getting started reference (#118)
Summary:
Mention latest published version `0.0.8`.
Closes https://github.com/facebook/Sonar/pull/118

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694476

Pulled By: passy

fbshipit-source-id: 7fc536dde44313eff09a64611d4c942d4f52fa1f
2018-07-02 02:33:19 -07:00
Pascal Hartig
cc3a784538 v0.0.8
Summary: Bump the Android version to 0.0.8.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694509

fbshipit-source-id: fec7a0cfcde7dfd12ba2ad13f68da6e1e6e55254
2018-07-02 02:33:18 -07:00
Pascal Hartig
0515ddb76e Setup fbjni sub-project for maven (#119)
Summary:
Set up our fbjni sub-project to be published to Maven Central.
This removes a bunch of abiFilters that we no longer make use of, too.
Closes https://github.com/facebook/Sonar/pull/119

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694537

Pulled By: passy

fbshipit-source-id: de246fbda99c02856fbc7806b78df2114cb82acb
2018-07-02 01:19:35 -07:00
Pascal Hartig
167792e7d8 Remove NDK build from fbjni sub-project (#116)
Summary:
We're already building this as dependency via CMake of sonar itself and
bundle the resulting `.so` files in there.

This project only contains the java files so we can ship them as
separate JAR.

Importantly, this avoids having to use `pickFirst` as we bundle multiple
incompatible `.so` files in both AARs.
Closes https://github.com/facebook/Sonar/pull/116

Reviewed By: priteshrnandgaonkar

Differential Revision: D8691119

Pulled By: passy

fbshipit-source-id: 82303d6c2b5d7e12dcd8f49300090ce8e4570e47
2018-06-29 06:47:31 -07:00
John Knox
f8c79b55dc Back out "[sonar] Stop using folly Future::delayedUnsafe()"
Summary: Original commit changeset: 51ab3224b93e

Reviewed By: priteshrnandgaonkar

Differential Revision: D8676855

fbshipit-source-id: 38282f642d8497ce7715017127368445132454fa
2018-06-28 04:32:32 -07:00
Pascal Hartig
fc184812f6 Update Litho dependencies (#112)
Summary:
There's been a new stable release and we no longer need to depend on the
snapshot releases.
Closes https://github.com/facebook/Sonar/pull/112

Reviewed By: danielbuechele

Differential Revision: D8659035

Pulled By: passy

fbshipit-source-id: 83763e521ffd53e031664e3b1d2714df769d1557
2018-06-27 08:17:46 -07:00
Pascal Hartig
1060542f64 Add note about current android release issues
Summary: Per title

Reviewed By: danielbuechele

Differential Revision: D8659337

fbshipit-source-id: 3415dfa34b7a4918e9df2abd7f226f62eb63c4d7
2018-06-27 08:04:11 -07:00
Daniel Ruf
85a0e1d24f chore: add Node.js 10
Summary: Closes https://github.com/facebook/Sonar/pull/100

Differential Revision: D8618047

Pulled By: danielbuechele

fbshipit-source-id: 12215bcbd12a9afef88de3d4979931481ff2e7d9
2018-06-27 04:17:23 -07:00
Peter van der Zee
7246e8404b Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:33:24 -07:00
John Knox
266af3e274 Display message when "Operation Not Permitted" bug is seen
Summary:
On certain samsung devices, the 'run-as' command, inside adb shell doesn't work.
We don't yet have a workaround for this, otherwise potentially upgrading to android 8.
Distinguish these errors (log them so we'll see how often it happens), and tell the user why it's not working.

Reviewed By: danielbuechele

Differential Revision: D8638728

fbshipit-source-id: f4764120cc27187330a3f236636292a5e63e8ec9
2018-06-26 13:02:17 -07:00
Pascal Hartig
46df0b25a0 Set up Maven packaging and Bintray upload (#104)
Summary:
This make use of the the setup we have at Litho, which should make
it easier to keep them in sync.

It creates proper source jars, AARs (without bundling in unwanted
transitive deps) and POMs.
Closes https://github.com/facebook/Sonar/pull/104

Reviewed By: priteshrnandgaonkar

Differential Revision: D8638912

Pulled By: passy

fbshipit-source-id: ff4921c0683e9b6f859085b542ceae840a7e8291
2018-06-26 08:18:23 -07:00
Pritesh Nandgaonkar
110ff1c353 Package prebuilt libraries in android target (#105)
Summary:
package prebuilt libraries in `:android` rather than in sample app
Closes https://github.com/facebook/Sonar/pull/105

Reviewed By: passy

Differential Revision: D8639064

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4da20b046e2e55f0f605f91bf8809a4efd6848d9
2018-06-26 07:32:46 -07:00
Daniel Büchele
5edb8bd770 clean up dynamic plugin loading
Summary:
There are 3 sources where plugins can be loaded from:
* `src/plugins`
* `src/fb/plugins`
* any path specified in `~/.sonar/config.json`

Plugins found in the first two directories are bundled with the app when building.

Reviewed By: jknoxville

Differential Revision: D8636061

fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087
2018-06-26 07:17:39 -07:00
John Knox
70e11e8269 Stop using folly Future::delayedUnsafe()
Summary:
delayedUnsafe() is unsafe because it disregards the executor you have specified, and uses the default one.
Depending on the context, this can sometimes be an InlineExecutor, and since some of the scheduled jobs, schedule instances of themselves, this can cause infinite recursion to occur.
Fixing this by using the safe variant of delayed, and also using a new instance of IOExecutor.
We need a new Executor for the Sonar loop, because if we use the same worker thread as is provided to RSocket, we get deadlock when we wait for rsocket to connect.

Reviewed By: danielbuechele

Differential Revision: D8617679

fbshipit-source-id: 51ab3224b93e774596a8799338e7391e2eb956cb
2018-06-25 16:03:18 -07:00
John Knox
361a4cca76 Fix Logger issue in OSS build (#102)
Summary:
We've replaced the global console.* methods with those in the Logger.
The OSS Logger uses a different implementation to the internal fb one, and it still calls back to console.*, causing a stack overflow.
Fix it by removing the console calls from Logger.js.
Logging to the original console methods is done by the Proxy in App.js.

Fixes #101
Closes https://github.com/facebook/Sonar/pull/102

Reviewed By: priteshrnandgaonkar

Differential Revision: D8617042

Pulled By: jknoxville

fbshipit-source-id: 055bf0e1a2fba8ad5312c88fa97a44389eb52390
2018-06-25 14:05:03 -07:00
Pritesh Nandgaonkar
64a61a37d4 Fix Broken sample app (#103)
Summary:
With this fix the entire android setup builds with gradle . To try out the sample app, run `./gradlew :sample:installDebug`
Closes https://github.com/facebook/Sonar/pull/103

Reviewed By: danielbuechele

Differential Revision: D8618622

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e
2018-06-25 11:33:44 -07:00
Daniel Büchele
cbab597236 show only one device in sidbar
Summary:
Refactors the plugin architecture of Sonar:
- Before plugin rendering had it's own implementation of the react lifecycle. This means the `render`-function was not called by react, but rather by the application it self. In this diff, the render method is now called from react, which enables better debugging and allows react to do optimizations.
- Business logic for querying emulators is moved away from the view components into its own dispatcher
- All plugin handling is moved from `App.js` to `PluginContainer`.
- The sidebar only shows one selected device. This allows us to add the screenshot feature as part of the Sonar main app and not a plugin.
- This also fixes the inconsistency between the devices button and the sidebar

Reviewed By: jknoxville

Differential Revision: D8186933

fbshipit-source-id: 46404443025bcf18d6eeba0679e098d5440822d5
2018-06-25 10:04:00 -07:00
Daniel Büchele
0c2f4d7cff split Client/Server
Summary: The `Client` and `Server` code was in one file, which was messy. This splits it into two separate files.

Reviewed By: emilsjolander

Differential Revision: D8186932

fbshipit-source-id: faa79d7dccd867d69ccd1bccd43a2cf85314b1b3
2018-06-25 10:04:00 -07:00
Pritesh Nandgaonkar
452dfd7ecc Remove armeabi arch from gradle
Summary: Currently while building thru gradle got the error that armeabi is not supported.The supported ABI's by ndk are x86, x86_64, armeabi-v71, arm64

Reviewed By: danielbuechele

Differential Revision: D8611628

fbshipit-source-id: 80d9449c35a69aab020412b523f5c21fe6661de8
2018-06-25 06:02:32 -07:00
Daniel Buchele
6fda334a00 fbshipit-source-id: 5d9ecf33fca19e4a6b8c979b879ec9dd82af1ef9 2018-06-25 04:33:04 -07:00
Daniel Büchele
ec0b3829e2 Merge pull request #86 from facebook/Fix-Android
[WIP][HELP]Fix android
2018-06-25 12:26:45 +01:00
John Knox
992c032fe7 Fix infinite recursion issue when can't connect
Summary:
There's an issue with folly's delayedUnsafe(), where it drops your executor and effectively
runs all futures inline, in this case instead of scheduling tasks for the future, it grows the stack indefinitely.

This fixes the issue by using the safe delayed(), which preserves the executor, so the jobs get shceduled on a different thread as intended.

Reviewed By: LeeHowes

Differential Revision: D8575956

fbshipit-source-id: c5b2ced43a70505c51883281f202ac947ae6723f
2018-06-21 13:18:25 -07:00
Pritesh Nandgaonkar
730bf6d08f Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-21 16:28:35 +01:00
Pritesh Nandgaonkar
edfdd64950 [WIP] gradle builds but app freezes, updated fbjni so file is the possible culprit 2018-06-21 16:27:18 +01:00
Pritesh Nandgaonkar
f520486c2d Fix the xcodeproj of SonarKit (#96)
Summary:
This diff repaces the faulty sonarkit.xcodeproj with the current one. I think ship it synced the xcodeproj which was generated by buck.
Closes https://github.com/facebook/Sonar/pull/96

Reviewed By: emilsjolander

Differential Revision: D8538609

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 9eb049a9770c40b652f999ace9b82207e3a395e5
2018-06-21 06:47:28 -07:00
John Knox
94f03f182b Add nullifyNanAndInf parameter to FBCxxUtils
Summary:
There was an issue with syncing our internal files to github. A change was made in the utils that wasn't synced out, despite the sonar code using the new API.
This brings the util update to github, while I fix the syncing issue. After that there will be a single source of truth so no more sync issues like this can occur.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8541128

fbshipit-source-id: d8509b65035569c4ee9707e5d7eab99fa325da88
2018-06-20 08:37:33 -07:00
John Knox
54fa6aa8f2 Replace usages of ErrorReporter with Logger
Summary:
At the moment, in sonar we have an error reporter and a Logger.
ErrorReporter can be encapsulated into Logger, so users don't have to decide between logging and reporting errors.

Reviewed By: danielbuechele

Differential Revision: D8531902

fbshipit-source-id: 3986f51ea163ac939f3baffd4db3ab968f2a0762
2018-06-20 06:18:26 -07:00
Pritesh Nandgaonkar
58b31fdc6c Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-19 18:31:23 +01:00
Pritesh Nandgaonkar
a49d31a12d Remove comments 2018-06-19 18:31:18 +01:00
Pritesh Nandgaonkar
3a6d7928be Case sensitive path 2018-06-19 18:28:36 +01:00
Louis Lagrange
3d27dc2004 Fix wrong paths in iOS setup doc (#78)
Summary:
Fixes #70
Closes https://github.com/facebook/Sonar/pull/78

Reviewed By: jknoxville

Differential Revision: D8476975

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 2d478cbf31c560ff5a6062bf1e029e4c7fa4c172
2018-06-19 10:03:13 -07:00
Pritesh Nandgaonkar
88a6cff373 Fix merge conflicts 2018-06-19 15:31:33 +01:00
Pritesh Nandgaonkar
7405cd268a Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-19 14:13:59 +01:00
Pritesh Nandgaonkar
ffa6e744c2 update 2018-06-19 14:08:12 +01:00
Pascal Hartig
2076fc8fd1 Fix Android getting started docs
Summary:
`SoLoader.init(Context, int)` isn't what we want as it can raise an `IOException` (checked) and implies exo-package. I suppose this was meant to be
`(Context, boolean)`.

Reviewed By: jknoxville

Differential Revision: D8512345

fbshipit-source-id: 7fad2a3788e64149fc02e3446db2c71412ccb43d
2018-06-19 06:03:22 -07:00
Pascal Hartig
0768c9a43a Add Electron link to README
Summary:
Resubmit D8378726. Previous import stalled.

Closes #18

Original Author: alexeykuzmin

Reviewed By: jknoxville

Differential Revision: D8510131

fbshipit-source-id: 732318b919f00d16c2f7fc2385bae7bf11411085
2018-06-19 04:45:39 -07:00
Daniel Büchele
e70ebc4c59 check android emulator names
Summary: maliciously named Android emulators could execute arbitrary commands. This checks makes sure the emulator name only has valid characters and puts them in quotes to prevent executing other commands.

Reviewed By: jknoxville

Differential Revision: D8489024

fbshipit-source-id: d91011ceaa8abf0ac53a308089cbdd0b0db03b54
2018-06-19 04:02:20 -07:00
Daniel Büchele
7406af9c3a old version check
Summary:
Remove old version number check. `AutoUpdateVersion` is used instead for macOS, we currently do not support auto-updates on other platforms.
This also removes the leaked Intern Graph secret.

Reviewed By: emilsjolander

Differential Revision: D8488849

fbshipit-source-id: 0853e8f868137972f718847c49038304525e1e06
2018-06-18 11:07:16 -07:00
Hilal Alsibai
51ac6a1f8f Ignore yarn error log (#54)
Summary:
No need to include this in commits.
Closes https://github.com/facebook/Sonar/pull/54

Differential Revision: D8466428

Pulled By: xiphirx

fbshipit-source-id: f24c4afe30dd74a17dbf42535ba92e7467c9e33a
2018-06-18 10:48:24 -07:00
Pritesh Nandgaonkar
88ecb9b494 app builds but not with sonarfb 2018-06-18 18:45:37 +01:00
Pascal Hartig
16a3e2fa27 Rename isInternalComponent to canResolve
Summary:
I'm sure there's a better way to describe what this does in the Javadoc, but I
can't really come up with one.

Also inlined one method which made another call which is now redundant.

I'd also really like to make this call entirely unnecessary by moving the logic
to `resolve()` so that overriding it automatically implies `canResolve` but the
edge cases for commonProps and treeProps make this rather unpleasant.

Reviewed By: IanChilds

Differential Revision: D8476911

fbshipit-source-id: 33c6a20da03e50cd1c1d4994e64ef8b43b2c68bc
2018-06-18 07:32:26 -07:00
John Knox
8b2a2b12a3 Add LibreSSL support (and other openssl implementations)
Summary:
Common Name extraction by regex was failing on LibreSSL.
Now using RFC2253 to unamiguously format distinguished name subject strings.

Reviewed By: emilsjolander

Differential Revision: D8452825

fbshipit-source-id: a18d4162a7aed3b5bd8c2996ff3832877dac90db
2018-06-18 03:47:21 -07:00
Igor Randjelovic
0984103696 Add screenshot to the readme (#46)
Summary:
To make it more appealing for people landing on the GitHub page - seeing a nice screenshot is always a plus!
Closes https://github.com/facebook/Sonar/pull/46

Differential Revision: D8476809

Pulled By: danielbuechele

fbshipit-source-id: d26b10069ab5745342156669ff627dd4fdad2fdb
2018-06-18 03:32:10 -07:00
Yossi Elkrief
6cf1c0d173 Update getting-started.md (#61)
Summary:
Using debugImplementation instead of deprecated debugCompile
Closes https://github.com/facebook/Sonar/pull/61

Differential Revision: D8466425

Pulled By: passy

fbshipit-source-id: b3dd4185b307933c0781a798385a66ab128b43f2
2018-06-16 08:17:39 -07:00
Pascal Hartig
e820beba83 Centralize sample dependencies (#77)
Summary:
The support libraries where out of sync between the projects, causing
the sample build to fail with

```
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution
```

This makes sure that the sample submodule uses the top-level
dependencies and same versions.
Closes https://github.com/facebook/Sonar/pull/77

Reviewed By: emilsjolander

Differential Revision: D8447186

Pulled By: passy

fbshipit-source-id: e391501edd97fdbe6456b32cd7305d8be26e20db
2018-06-15 09:40:22 -07:00
Pritesh Nandgaonkar
85731a2f5f refer dependencies from central place 2018-06-15 17:12:29 +01:00
Pritesh Nandgaonkar
4cbaeb3e32 Android target and sample builds 👏 2018-06-15 16:53:58 +01:00
Pritesh Nandgaonkar
72045da4be Use the latest fbjni 2018-06-15 15:55:10 +01:00