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)
- How to install flipper server on linux? HOT 4
- Question: FlipperKit on Mac M3 HOT 2
- Failed to start Flipper: TypeError [ERR_INVALID_ARG_TYPE]
- Unable to install plugin HOT 1
- GitHub Actions Workflow failed - Publish Android
- Network Plugin HTTP Response body always (Empty)
- Virus detected in published files HOT 1
- 无法打开“Flipper.app”,因为无法验证开发者。 HOT 2
- Watchman file watching service is not installed or not added to PATH HOT 1
- No matching version found for [email protected] HOT 4
- The downloaded flipper for mac m1 is always opened in the browser. Where can I download the local software? HOT 2
- Failed to start client connection: Failed to exchange certificate with /APP_NAME/ in android real device
- Discussion: Allow disabling running `klist.exe`. HOT 1
- GitHub Actions Workflow failed - Publish Android
- `flipper-common`, `flipper-pkg-lib` and `flipper-plugin-lib` version mismatch from their latest versions on npm (0.252.0) HOT 3
- Flipper totally sucks now. What did you guys do? HOT 1
- Android Gradle || Failed to resolve: com.facebook.flipper:flipper:0.252.0 HOT 2
- Question: I get NO DEVICES FOUND even though setup doctor says everthing is ok HOT 3
- How to Install .tgz file in windows?
- iOS - Privacy Manifest - Update OpenSSL dependency to 3.1.5001
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.