Skip to content

Commit

Permalink
Merge pull request yagiz#12 from bguidolim/carthage-support
Browse files Browse the repository at this point in the history
Added Carthage support
  • Loading branch information
yagiz authored Jan 19, 2019
2 parents a19e796 + 3ab33a7 commit 08d0a5c
Show file tree
Hide file tree
Showing 12 changed files with 601 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ playground.xcworkspace
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Checkouts
Carthage/Build

# fastlane
Expand Down Expand Up @@ -126,7 +125,7 @@ iOSInjectionProject/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Checkouts


# fastlane
Expand Down
1 change: 1 addition & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "robbiehanson/CocoaAsyncSocket" "master"
1 change: 1 addition & 0 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "robbiehanson/CocoaAsyncSocket" "f33ea53c298fcad69d55f387ead174e30c2446cf"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

# Bagel
![Bagel](https://github.com/yagiz/Bagel/blob/master/assets/header.png?raw=true)

Expand Down Expand Up @@ -33,7 +35,7 @@ bagelConfig.project.projectName = "Custom Project Name"
bagelConfig.device.deviceName = "Custom Device Name"
bagelConfig.device.deviceDescription = "Custom Device Description"

Bagel.start(configuration: bagelConfig)
Bagel.start(bagelConfig)
```
Bagel framework communicates with the desktop client by using Bonjour protocol. You can also configure these Netservice parameters. Default values are:

Expand All @@ -45,7 +47,7 @@ bagelConfig.netserviceDomain = ""
bagelConfig.netserviceType = "_Bagel._tcp"
bagelConfig.netserviceName = ""

Bagel.start(configuration: bagelConfig)
Bagel.start(bagelConfig)
```
If you change Netservice parameters in your app, you should also change them on desktop client.

Expand Down
448 changes: 448 additions & 0 deletions iOS/Bagel.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
91 changes: 91 additions & 0 deletions iOS/Bagel.xcodeproj/xcshareddata/xcschemes/Bagel.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3760A43721F13817004D1E07"
BuildableName = "Bagel.framework"
BlueprintName = "Bagel"
ReferencedContainer = "container:Bagel.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3760A43721F13817004D1E07"
BuildableName = "Bagel.framework"
BlueprintName = "Bagel"
ReferencedContainer = "container:Bagel.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3760A43721F13817004D1E07"
BuildableName = "Bagel.framework"
BlueprintName = "Bagel"
ReferencedContainer = "container:Bagel.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3760A43721F13817004D1E07"
BuildableName = "Bagel.framework"
BlueprintName = "Bagel"
ReferencedContainer = "container:Bagel.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
22 changes: 22 additions & 0 deletions iOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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>
</dict>
</plist>
10 changes: 9 additions & 1 deletion iOS/Source/Bagel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRAmaNTY OF ANY KIND, EXPRESS OR
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <UIKit/UIKit.h>

//! Project version number for Bagel.
FOUNDATION_EXPORT double BagelVersionNumber;

//! Project version string for Bagel.
FOUNDATION_EXPORT const unsigned char BagelVersionString[];

#import <Foundation/Foundation.h>
#import "BagelConfiguration.h"

Expand Down
9 changes: 7 additions & 2 deletions iOS/Source/BagelBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ - (void)socket:(GCDAsyncSocket*)socket didConnectToHost:(NSString*)host port:(UI
- (void)sendPacket:(BagelRequestPacket*)packet
{
NSError *error;
NSData* packetData = [NSJSONSerialization dataWithJSONObject:[packet toJSON] options:0 error:nil];

NSData* packetData = [NSJSONSerialization dataWithJSONObject:[packet toJSON] options:0 error:&error];

if (error) {
NSLog(@"Bagel -> Error: %@", error.localizedDescription);
return;
}

if (packetData) {

NSMutableData* buffer = [[NSMutableData alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion mac/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: ebe70cf0430bb9673b9d2acef3c2a16142460de8

COCOAPODS: 1.6.0.beta.1
COCOAPODS: 1.6.0.beta.2

0 comments on commit 08d0a5c

Please sign in to comment.