Commit Graph

211 Commits

Author SHA1 Message Date
Pascal Hartig
6a7a580db3 Import "Fix some typos (it's vs its)" (#175)
Summary:
Original author: noahsark769

Closes https://github.com/facebook/Sonar/pull/175

Reviewed By: jknoxville

Differential Revision: D8989724

fbshipit-source-id: 8e1c09196b0c6c0d0fb0446a2a4a595d09f21652
2018-07-25 07:18:54 -07:00
Pascal Hartig
16093222c0 Move Litho plugin to xplat//
Summary: Last one of the plugins.

Reviewed By: jknoxville

Differential Revision: D8966725

fbshipit-source-id: 1564042c45815d324f7dc0ef6d9d024307787b49
2018-07-25 06:33:29 -07:00
Pritesh Nandgaonkar
9f807cd0df Move core sonarkit code to xplat
Summary:
This diff only moves the core of sonarkit to the xplat.

- This diff uses `fb_xplat_cxx_library` as a buck rule in xplat as it is the recommended way
- Updated few imports in the files which were not compiling with new buck function
- Due to the new way of import the OSS would break, so fixed it by changing the `podspec` file

Reviewed By: passy

Differential Revision: D8937414

fbshipit-source-id: 6e12cd049bedb496e7a6820be85b2535e70ba09b
2018-07-25 01:43:23 -07:00
Thomson Thomas
65239838f2 Fix the crash from okhttp interceptor (#168)
Summary:
Add a null check before creating a new response
Fixes #166
Pull Request resolved: https://github.com/facebook/Sonar/pull/168

Reviewed By: jknoxville

Differential Revision: D8915871

Pulled By: passy

fbshipit-source-id: aa93273f6fe90a8160133331e0844f67ff7e620a
2018-07-24 08:33:14 -07:00
Pritesh Nandgaonkar
02cd3ba560 Add warning if plugin is ignored due to gatekeeper
Summary: Adds warning if plugin is ignored due to user not being the part of gatekeeper. As it will help us to better support our users

Reviewed By: passy

Differential Revision: D8952074

fbshipit-source-id: a5b995c778989deb08972081b19313303f8bfabb
2018-07-24 07:48:37 -07:00
Pascal Hartig
5b38cbdf76 Move OSS plugins
Summary:
This is a big one. Moves all oss plugins to a new place and leaves
stub targets in place. No logic changes. Everything apart from
BUCK files should be unchanged.

Reviewed By: jknoxville

Differential Revision: D8951045

fbshipit-source-id: 8054fb4028181d5cc4a240b1908dab6471cf0a27
2018-07-24 07:22:27 -07:00
Eldad Moneta
333ceac957 convertFollyDynamicToId - Don't crash if illegal value is return in one of the conversions
Summary:
Fixing T31692652.
I couldn't reproduce this on my local tests - (tried non-utf chars, deleted memory, onverted vectors that are erased).
My guess - an illegal string cannot be converted to NSSString and thus we return nil when the folly::dynamic type is STRING.

See task for additional details.

Reviewed By: nubbel

Differential Revision: D8952714

fbshipit-source-id: c87af523efca1b96a4cf3d5d26fa5c16ed5cd773
2018-07-24 06:48:26 -07:00
Pascal Hartig
c7ccff117f v0.6.13
Summary: Already released, linked against new versions of SoLoader.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931240

fbshipit-source-id: b525f5596778341a016808d3c61a3f5a382e4c79
2018-07-20 08:20:50 -07:00
Pascal Hartig
fb2b9cfc9f Update android lib build paths
Summary: Move manifest to correct place, update build.gradle accordingly.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931222

fbshipit-source-id: e2cf4b507de4ea984b5a2dce1bb9edee0c4e2558
2018-07-20 08:20:50 -07:00
Pascal Hartig
c3e8a2d22a Fix cpp build paths
Summary:
Those hadn't been updated as part of the move and cause runtime
failures.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931211

fbshipit-source-id: bc874eeea39134d6da9e16f6771bf0d3d3c02473
2018-07-20 08:20:50 -07:00
Pascal Hartig
2ec67bf801 Bump first-party dependencies
Summary:
Important because we still run into soloader incompatibilities due
to the transitive dependency of Litho on Yoga on SoLoader. Sigh.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931213

fbshipit-source-id: 7e2de85deb5975dbe3f25e8145a9226d6684357c
2018-07-20 08:20:49 -07:00
Marc Terns
da4d03758b Removing Yoga and YogaKit from the private CocoaPods repository (#156)
Summary:
This partially fixes [#132](https://github.com/facebook/Sonar/issues/132)

Yoga.podspec and YogaKit.podspec are being removed from the private repository since now they exist in the CocoaPods master repository
Pull Request resolved: https://github.com/facebook/Sonar/pull/156

Reviewed By: passy

Differential Revision: D8890062

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 15ae1345c9816c1fff324cbdaff188f8ee521373
2018-07-20 05:17:43 -07:00
Noah Gilmore
8177675465 Initial support for using Sonar in Swift projects (#106)
Summary:
This PR adds support for using SonarKit clients in Swift apps. Fixes #13, fixes #87

1. Swift can't import Obj-C modules which have C++ headers. For this reason, we use SonarKit as an Obj-C++ wrapper around Sonar, which is written in C++. Due to search path misconfiguration, trying to import SonarKit into a Swift project would import `xplat/Sonar/SonarPlugin.h` instead of `iOS/SonarKit/SonarPlugin.h`, which caused `file not found` errors for C++ stdlib imports like #28 because new projects don't have their search paths set up correctly.
2. The network and layout plugins have C++ definitions (struct methods, classes) in some of their headers. This causes the compiler to get confused for Swift projects, because it only supports importing Objective-C files in umbrella headers, meaning that the `SonarKit` won't build.

1. I updated the `HEADER_SEARCH_PATHS` of SonarKit.podspec's build configuration to include `${PODS_ROOT}/Headers/Private/SonarKit/**` first, which alleviates the search path issue. The Obj-C `Sample` project seems to have worked around this by including a hardcoded `${PODS_ROOT}/SonarKit/**` search path in the pbxproj, which is why Sample works but new projects (like those referenced in #28) don't. I removed this since it's no longer necessary.
2. I added a `SampleSwift` app to demonstrate using Sonar with a Swift project.
3. Because the Podfiles for `Sample` and `SampleSwift` referenced podspecs using `:podspec` instead of a concrete version, Cocoapods wouldn't copy local header files (instead, it downloads them from the source). To enable local development of these sample apps using `:path`, I added a symlink to SonarKit.podspec in the root of the directory.
4. I changed SonarKit.podspec to use a tag-based `source`, since v0.0.1 pulls from the master branch of this repo.

The layout and network plugins still don't work with Swift - in order to fix this, we'll need to work on extracting the C++ out of their headers and writing Obj-C++ wrappers for them. I decided to push this off to a later PR since this one is quite large already.

This means that we need to be able to `import SonarKit` without importing all the network/layout plugin headers. In order to make this work, I made "SonarKit/Core" the spec's `default_subspecs`.

priteshrnandgaonkar, let me know if you have any thoughts on this implementation. You can verify that the SampleSwift app works by checking out this branch, `pod install`ing in the SampleSwift directory, and building it :)

![image](https://user-images.githubusercontent.com/1168853/41928625-ac195bd8-792a-11e8-82b8-65d6233a1fbb.png)
Pull Request resolved: https://github.com/facebook/Sonar/pull/106

Reviewed By: jknoxville

Differential Revision: D8890010

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 449305bcc5cbeb5787c23f51b1ecb80a5cbdad32
2018-07-20 04:33:52 -07:00
Barney Huang
fcfa0409e4 fix null device reference
Summary:
Force device type from BaseDevice to AndroidDevice, because we need to access adb inside AndroidDevice.
In long term, we should use DeviceShell from BaseDevice, but that need much more changes.

Differential Revision: D8876082

fbshipit-source-id: 0772a0ac361c5e3eca9c7a590281ffa786501e15
2018-07-20 03:32:54 -07:00
Austen McRae
bfc8bfc164 Fix SonarConnectionMock by overriding virtual method
Summary: SonarConnection should have an `error` function; this stubs out the mock to have this, allowing creation for tests.

Reviewed By: jknoxville

Differential Revision: D8878130

fbshipit-source-id: 9e0f45dac4ba31ee650dfd46dcee51207cc7a9b4
2018-07-19 14:34:52 -07:00
Pascal Hartig
07b083e570 Move sample source and resources to gradle dirs
Summary: Follow standard Gradle paths.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8890133

fbshipit-source-id: 062331b6b3d5f118f07cb5ca14cdec871f75867b
2018-07-19 09:50:04 -07:00
Pascal Hartig
50affb0a25 Move android sample to xplat
Summary: Move to xplat while ensuring that the buck target alias is still valid from fbandroid.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8890129

fbshipit-source-id: 97ad8eac35780715e84a2620aae4e6ed566385c9
2018-07-19 09:50:04 -07:00
Pascal Hartig
f6b143135c Remove third-party from dependencies
Summary:
:third-party doesn't actually export anything. So we don't need to
explicitly depend on it as it messes with the POM generation otherwise.

Reviewed By: jknoxville

Differential Revision: D8913636

fbshipit-source-id: d0da6ed4c47e8d6b7986ec9f12960c9323ad1640
2018-07-19 08:48:13 -07:00
Pritesh Nandgaonkar
3e20ebe970 Move Sample app from iOS to xplat
Summary: Move Sample app from iOS to xplat

Reviewed By: jknoxville

Differential Revision: D8911835

fbshipit-source-id: 2fffff0db0d1193183ddb818438d1b72d8b63ccb
2018-07-19 04:31:00 -07:00
Pritesh Nandgaonkar
89d28d1188 Moved FBDefines to xplat
Summary: Moved FBDefines to xplat

Reviewed By: passy

Differential Revision: D8895202

fbshipit-source-id: 3edfcecade7c67a0ddfc5c64bb4454df65cbcc93
2018-07-19 04:31:00 -07:00
Pritesh Nandgaonkar
89d426113c Move cocoapod build files from fbobjc to xplat
Summary: Move cocoapod build files from fbobjc to xplat

Reviewed By: passy

Differential Revision: D8895097

fbshipit-source-id: 2cb314d54dc08a36aad1342af004384e264fa808
2018-07-19 04:30:59 -07:00
Pritesh Nandgaonkar
322a79b394 Scripts for podspec updation and github tag release
Summary:
This diff adds the support to automate iOS releases. This diff adds two scripts, one for updating all the `podspecs`, and `podfiles` with updated version number. The script also updates the version used in sample and getting started doc file.
The second script publishes a github tag.

Following will be the process for iOS release:-

1. From `fbobjc/Libraries/SonarKit/Scripts` run `sh public-ios-podspec-update.sh`, it will update all the podspecs, podfiles and docs with updated version number. Commit it and land this
2. Once the above changes are landed and synced to github, run `sh push-new-github-tag.sh` from `fbobjc/Libraries/SonarKit/Scripts` to push the tag on github

As a follow up on this diff, ideally, we should trigger second script automatically when the 1st task changes are synced to github.

Reviewed By: jknoxville

Differential Revision: D8879958

fbshipit-source-id: 8f0dc9200e8f64578af33e1446629f09c16c43f2
2018-07-19 04:30:59 -07:00
Austin Vandergon
5b0e742fe6 Call module init helpers on debug builds
Reviewed By: SeyelentEco

Differential Revision: D8879847

fbshipit-source-id: 812ff0098fc8e3c85ab0a33df5e4ade919209583
2018-07-18 17:24:35 -07:00
Sara Valderrama
0244f15dab Use views not components for Litho nodes in AX tree + more sidebar props
Summary: Switches the tree to use the view hierarchy for Litho nodes rather than Litho component hierarchy since Accessibility services interact with the views rendered. Includes a few more properties in the accessibility sidebar and updates to the segmented sidebar based on derived/non-derived properties for all views. Also adds functions to the AccessibilityUtil to be able to work on the accessibility sidebar while still leaving the non-accessibility sidebar unchanged. Eventually the accessibility panel will be removed from 'normal' mode and the original functions will no longer be necessary.

Reviewed By: blavalla

Differential Revision: D8881739

fbshipit-source-id: 9ce37e8f18025538cba2c86c0895ee38d13d024b
2018-07-18 17:03:32 -07:00
Pascal Hartig
b28e96624d v0.6.12 (#160)
Summary:
Version bump for the Android release. Mostly for soloader upgrade.
Pull Request resolved: https://github.com/facebook/Sonar/pull/160

Reviewed By: priteshrnandgaonkar

Differential Revision: D8892812

Pulled By: passy

fbshipit-source-id: 1942366838625d4703b7623533e115ae19fda2ca
2018-07-18 09:04:30 -07:00
Diego Sanchez
9e7c2b6982 Wraps receiving callback into an autoreleasepool
Summary: The receiving callbacks are executed from a thread that doesn't have an autorelease pool. That results in autoreleased objects leaking

Reviewed By: schaitoff

Differential Revision: D8889915

fbshipit-source-id: 07e9129954e6f9afea56473b590125c63ecd7092
2018-07-18 08:18:48 -07:00
Pascal Hartig
818c5e9dc5 Move android package to xplat
Summary: That's the android package and all references to it.

Reviewed By: jknoxville

Differential Revision: D8875423

fbshipit-source-id: 478bb380012bc1327199d51527a7fe376824fce2
2018-07-18 08:04:23 -07:00
Pascal Hartig
2987c32ed8 Bump SoLoader (#159)
Summary:
See https://github.com/facebook/SoLoader/issues/13.
Pull Request resolved: https://github.com/facebook/Sonar/pull/159

Reviewed By: jknoxville

Differential Revision: D8876179

Pulled By: passy

fbshipit-source-id: 0965f9c952410bf8f4fec80b715dd93b5c1a8918
2018-07-18 04:33:36 -07:00
Pascal Hartig
ec4fa12ddb Move Android third-party to xplat
Summary: That's the last one for the OSSProject folder.

Reviewed By: jknoxville

Differential Revision: D8875198

fbshipit-source-id: f54cb571463b4ac3176f028bcdbf0608dd5a3068
2018-07-18 03:48:32 -07:00
Pascal Hartig
c475aa257a Move Android OSSProject/libs to xplat
Summary: One more.

Reviewed By: jknoxville

Differential Revision: D8875186

fbshipit-source-id: 554d7bb2016741e3e48fde60069299f30880e593
2018-07-18 03:48:32 -07:00
Pascal Hartig
2d8ebc3143 Add caching (#155)
Summary:
Add some directories for caching. Also remove clean-up steps, which
aren't necessary.
Pull Request resolved: https://github.com/facebook/Sonar/pull/155

Reviewed By: jknoxville

Differential Revision: D8859224

Pulled By: passy

fbshipit-source-id: e8673504f5da74fbe5627c308ccd61fc28901116
2018-07-17 08:03:55 -07:00
Pascal Hartig
ee86ea0338 Move testing to xplat
Summary: More moving.

Reviewed By: jknoxville

Differential Revision: D8859751

fbshipit-source-id: 23dac3808715000d672f843d5eff34e81ccf637a
2018-07-17 07:49:33 -07:00
Pascal Hartig
bd719e6c9e Move sonar core to xplat
Reviewed By: jknoxville

Differential Revision: D8859681

fbshipit-source-id: 6613d6b62d4433aa3dde60b34affd48752c53366
2018-07-17 07:49:33 -07:00
Pascal Hartig
c0d1510d58 Move android build files to xplat
Summary:
This should work with our existing shipit config. Moves the build
files to xplat and sets up a standard gradle directory structure
that we will continue to move more files into.

Reviewed By: jknoxville

Differential Revision: D8859483

fbshipit-source-id: 5df5882a3bcaee36280af68aeaa740290288e0d3
2018-07-17 03:34:54 -07:00
Sara Valderrama
5ceb3e4ffe Include non-drawable litho components in AX tree + small sidebar edit
Summary:
Fixed issue with DebugComponentDescriptors being left out of accessibility tree so the AX tree now includes all Litho view nodes (not Litho accessibility nodes yet). Litho drawables have no accessibility properties so these are not included. Also changed default for getAXChildAt to do whatever the original view tree does for that node and added a getAXChildCount function to better customize the accessibility tree.

Segmented the ax sidebar into properties directly form the view and properties derived from the AccessibilityNodeInfo.

Differential Revision: D8861129

fbshipit-source-id: 987683ef45188aa9cb587cc0e5ffba8fbf40136d
2018-07-16 17:04:15 -07:00
John Knox
e83c8d31a2 Display warning to user when a physical iOS device is connected
Summary: At the moment sonar doesn't work with physical iOS devices. Until we add that feature, to avoid confusion, tell the user that it won't work.

Reviewed By: passy

Differential Revision: D8859223

fbshipit-source-id: 318777406877e0f769c6d0dc5bbe745ca0565f55
2018-07-16 11:03:53 -07:00
Chris Jenkins
3d0cd38f7a Grammar fix
Summary:
Noticed issues in https://fbsonar.com/docs/stetho.html - not sure if this will push there if accepted, but suggesting the changes in any case.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: jknoxville

Differential Revision: D8852241

fbshipit-source-id: 4a3e564e22ccb1edc43aa4cc335d3a8aeb916f3b
2018-07-16 10:26:10 -07:00
Pascal Hartig
cd6a5f9ff8 Reorganize native dep download and extraction (#154)
Summary:
This moves the native setup to a separate gradle file and unpacks everything outside the build folder. That way we don't throw everything away on every incremental build.

This is an intermediate step to get to a more declarative setup like Fresco has it and get rid of the individual hacks we have for every download.
Pull Request resolved: https://github.com/facebook/Sonar/pull/154

Reviewed By: jknoxville

Differential Revision: D8833812

Pulled By: passy

fbshipit-source-id: 2424c9d6e22e6092c04af344e06939b4a6aba041
2018-07-16 10:26:10 -07:00
Aaron Brady
d34aba9e21 Allow filesystem to decide path validity for cert dest folder (sonarCA.cert failing to write on windows)
Summary:
On windows when I used a more complicated path for the sonar directory (e.g. for writing sonarCA.cert to), it failed this regex but succeeded the node fs.writeFile call.

Unless I'm missing something else this regex does, we should just let the authority of the fs module decide if it can write something.

Reviewed By: jknoxville

Differential Revision: D8822094

fbshipit-source-id: 294c9a7b70080fefcfffdddd239d321ff7faa4e1
2018-07-16 08:33:37 -07:00
John Knox
e844e4bd34 Detect expired server certificates
Summary:
We have a check for whenever the server cert is expiring within 1 day, however this turns out it doesn't count certificates that have already expired.
So adding a check for those that have already expired, and regenerating them if so.

We can safely handle parse failures by assuming the cert has expired.

Reviewed By: passy

Differential Revision: D8858740

fbshipit-source-id: 6e06f9b267bcaec497b7eedd3d6c1974c788aea2
2018-07-16 07:19:34 -07:00
Pritesh Nandgaonkar
73c830fc1b Use tag in podspecs (#152)
Summary:
This diff uses `tag` instead of master branch and also updates the version number to the desktop sdk.
Pull Request resolved: https://github.com/facebook/Sonar/pull/152

Reviewed By: danielbuechele

Differential Revision: D8820016

Pulled By: priteshrnandgaonkar

fbshipit-source-id: ff2e554be55254b77c4e130b35b7299abbafa77d
2018-07-12 10:18:17 -07:00
John Knox
9a7017298c Add required permissions to android setup guide
Reviewed By: danielbuechele

Differential Revision: D8821115

fbshipit-source-id: 36949fc9ba5bdbd79d4e3e8349ef7daeebdaa074
2018-07-12 10:03:42 -07:00
Sara Valderrama
1c5ecce667 NodeInfo tree working (besides litho nodes)
Summary: The second tree has access to all AX NodeInfo properties (they are not in the sidebar yet). Infrastructure set up to customize displayed information bassed on what is most useful. Descriptors for views updated to include AX functionality and non-view descriptors AX functions defaulted to null/empty. Non-view nodes (like Fragments, Window, Appication) no longer included in AX tree. Corresponding nodes will be highlighted (although not expanded) on click in either tree.

Differential Revision: D8795800

fbshipit-source-id: cf2333f69bfecca3ff84aae62681c684dfa14bf3
2018-07-12 09:33:21 -07:00
Sara Valderrama
9e673a07a8 Small updates to Layout Extension code (committing to keep separate from larger changes)
Summary: Changed AXVisible checking, added AX specific hover

Reviewed By: danielbuechele

Differential Revision: D8795383

fbshipit-source-id: bb10b9e860629cfd385d97e79587c76460b516bc
2018-07-12 09:33:21 -07:00
Pascal Hartig
fcd1b1e773 Clean up dependencies (#153)
Summary:
Remove unused dependencies and centralise the remaining ones in the
global project config.
Pull Request resolved: https://github.com/facebook/Sonar/pull/153

Reviewed By: priteshrnandgaonkar

Differential Revision: D8820462

Pulled By: passy

fbshipit-source-id: 1c845898930eb62942379fddec6da39dbdc426d0
2018-07-12 09:05:55 -07:00
Pascal Hartig
c871496f8c Update build deps (#151)
Summary:
Update some build dependencies (gradle, android plugin) and make some
minor cleanups in the gradle files along the way.
Pull Request resolved: https://github.com/facebook/Sonar/pull/151

Reviewed By: priteshrnandgaonkar

Differential Revision: D8818841

Pulled By: passy

fbshipit-source-id: 78b6592dbf967553aadead57a60023a0b5ae79b6
2018-07-12 06:47:41 -07:00
Pascal Hartig
81e1b89b40 v0.6.11 (#150)
Summary:
Depends on #149.

Version bump for Android to bring it in line with the top-level version.
Pull Request resolved: https://github.com/facebook/Sonar/pull/150

Reviewed By: priteshrnandgaonkar

Differential Revision: D8804324

Pulled By: passy

fbshipit-source-id: 6c796f34cf064f117b6195b3c88d9b5c100f8dbb
2018-07-11 09:37:14 -07:00
Pascal Hartig
c7de8b8d37 Link against OpenSSL statically (#149)
Summary:
Compile against a static version of OpenSSL for better compatibility
with apps that already use OpenSSL in some fashion.
Pull Request resolved: https://github.com/facebook/Sonar/pull/149

Reviewed By: priteshrnandgaonkar

Differential Revision: D8804169

Pulled By: passy

fbshipit-source-id: 4de66a77806a3b3f01b2cf5f253916f2cf6f48e8
2018-07-11 08:42:02 -07:00
Daniel Büchele
2fa9cfe4e7 Fix patch version number in public build script
Summary: Accidentally the version number passed to the build script was not only the patch number but the full semver-number. The build script is expecting a single number and there for ignored the version number that was passed. This caused the build to always have patch version 0.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8804473

fbshipit-source-id: a116cac69066141fe8c8ed62020d16a1a7c40079
2018-07-11 08:42:02 -07:00
Aaron Brady
a223edafaa Get Sonar Running on Windows
Summary: Small tweaks so that Sonar can be started easily on windows.

Reviewed By: danielbuechele

Differential Revision: D8769592

fbshipit-source-id: 084dd50e5600a7e2e9c5544e3e79a18614933fdc
2018-07-11 08:18:25 -07:00