Comments (13)
@bolismauro, @priteshrnandgaonkar you can try https://appspector.com instead. Works with swift and has more features :)
from flipper.
Quick update: I managed to get a Swift app talking to Sonar today. The main bug was a search paths issue: SonarKit/SonarClient.h
was including SonarPlugin.h
, but because of how Cocoapods does default search paths, it was including Sonar/SonarPlugin.h
, a C++ header, instead of SonarKit/SonarPlugin.h
, an Obj-C header.
This is also the cause of #28 - iosfwd
is part of the C++ standard library and imported in the C++ version of the header, Sonar/SonarPlugin.h
.
I'll try to get a PR up in the next couple of days with a Swift sample project and the necessary podspec changes :)
from flipper.
Is there any plan to fix this or an ETA? The tool seems extremely powerful and interesting and I have several use cases for it but unfortunately our projects are swift only
from flipper.
@bolismauro PR is up (#106), let me know if it works for you (you should be able to point your Podfile at the podspecs in my branch). Note that the Network and Layout plugins are not yet supported in Swift (decided to take care of implementing core client support first).
from flipper.
It works perfectly!
Thanks a lot for have worked on this, I struggled to find the proper time and it is great that you guys are pushing this forward :)
from flipper.
Looks very cool but it is not what I'm looking for :(
from flipper.
interesting, are you looking for some specific feature? @bolismauro
from flipper.
I want to play with layout editor and the ability of developing custom things within the tool.
Also I prefer not to go trough a 3rd party service I cannot control.
I think this isn't the proper place to discuss this though. Let's keep it clean for the sonar swift support
from flipper.
@bolismauro Currently its isn't in our internal roadmap.We would expect open source community to fix it. But seeing on how things pan out we may end up working on it. But I can't see that happen soon.
from flipper.
Gotcha. I unfortunately don't have strong c++ knowledge but I think I'll try anyway. Do you have some suggestions about how to proceed and what need to be fixed?
from flipper.
Just try and get rid off the c++ in the header files of sonar. In header files you may also find other inported dependency that has c++ in it. So one has to create a c wrapper over it and then use in the public headers of sonar.Basically we have to make sure that headers doesn't have c++ in it.
from flipper.
I took a look into building Sonar for use in Trestle, which is a Swift project. As far as I can see, Cocoapods should be able to configure the Sonar/SonarKit pods to build into modules which Swift can use using :modular_headers => true
. Swift projects use pods which have C++ in them all the time - Sentry is a good example of a pod which has no Swift and some C++ and is usuable from a Swift project.
Here's what my Podfile looks like:
pod 'RSocket', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/RSocket.podspec'
pod 'DoubleConversion', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/Folly.podspec'
pod 'PeerTalk', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/PeerTalk.podspec'
pod 'Yoga','~>1.8.1', :modular_headers => true
pod 'Sonar', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/xplat/Sonar/Sonar.podspec'
pod 'SonarKit', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/SonarKit.podspec', :modular_headers => true
pod 'SonarKit/SonarKitLayoutComponentKitSupport', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/SonarKit.podspec'
pod 'SonarKit/SKIOSNetworkPlugin', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/SonarKit.podspec'
pod 'ComponentKit', :podspec => 'https://raw.githubusercontent.com/facebook/Sonar/master/iOS/third-party-podspecs/ComponentKit.podspec'
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
if ['YogaKit'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0.2'
end
end
end
end
Not running into any errors due to C++ used in headers like @priteshrnandgaonkar said, however I'm seeing the same error as in #28 ('iosfwd' file not found
). Here's the full trace:
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/SonarKit/SonarCppBridgingConnection.h:8:9: note: while building module 'Sonar' imported from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/SonarKit/SonarCppBridgingConnection.h:8:
#import <Sonar/SonarConnection.h>
^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Sonar-umbrella.h"
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/Sonar-umbrella.h:14:9: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/Sonar-umbrella.h:14:
#import "SonarClient.h"
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarClient.h:11:10: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarClient.h:11:
#include <Sonar/SonarConnectionImpl.h>
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarConnectionImpl.h:11:10: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarConnectionImpl.h:11:
#include <Sonar/SonarConnection.h>
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarConnection.h:11:10: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarConnection.h:11:
#include <Sonar/SonarResponder.h>
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarResponder.h:11:10: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Sonar/SonarResponder.h:11:
#include <folly/json.h>
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/Folly/folly/json.h:43:10: error: 'iosfwd' file not found
#include <iosfwd>
^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "SonarKit-umbrella.h"
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/SonarKit/SonarKit-umbrella.h:13:9: note: in file included from /Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/SonarKit/SonarKit-umbrella.h:13:
#import "SonarCppBridgingConnection.h"
^
/Users/noahgilmore/code/trest-ios/Trest/../Pods/Headers/Public/SonarKit/SonarCppBridgingConnection.h:8:9: error: could not build module 'Sonar'
#import <Sonar/SonarConnection.h>
^
/Users/noahgilmore/code/trest-ios/Trest/Trest/AppDelegate.swift:16:8: error: could not build Objective-C module 'SonarKit'
import SonarKit
^
I could be wrong but the solution to this might just be an include path configuration fix. Any advice here is appreciated :) @bolismauro were you able to make any headway here?
from flipper.
Sorry for not having answered before, I took some time off and I didn't see the notification.
It is amazing that you managed to make it work :) can't wait to try your PR! Thanks a lot!
from flipper.
Related Issues (20)
- Flipper's latest release's mac's aarch64 build not opening up in mac sonoma HOT 1
- Flipper
- Seeking Help with Hermes Debugger (RN) Issue HOT 2
- npx flipper-server doesn't run HOT 7
- Watchman was not found HOT 5
- Discussion: New MacOS icon for Desktop app HOT 1
- npm i fails because of requested [email protected] is not available
- Device plugin 'Hermes Debugger (RN)' is not supported by the selected device 'iPhone 15 Pro' (iOS). HOT 3
- watchman and idb not detected in default locations (macOS)
- Flipper Doctor incorrectly reports "Android Studio is not installed." when using Jetbrains Toolbox on OSX HOT 4
- Question: I accidentally deleted the Network plug-in, how to restore it HOT 2
- Homebrew has outdated version of flipper HOT 1
- While chrome not installed, does not opening flipper page on default browser (I am using ARC Browser) HOT 1
- It's empty in Install Plugin Tab for 0.239.0 HOT 4
- Flipper is Unsupported HOT 1
- Question: FS_ACCESS error when trying to exchange certificates with Pocophone F1 (and android emulators)
- Not able to record and get results from React Devtool profiler
- Question: Title: Unable to Open React Native Debugger in Chrome or DevTools & How Remove Flipper Completly
- Question: Support for React Native 0.73 HOT 1
- Question: Support New Architecture C++ Turbo Native Modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipper.