1
1
mirror of https://github.com/nsomar/Swiftline.git synced 2024-08-16 00:50:38 +03:00

Adding SPM example

This commit is contained in:
Omar Abdelhafith 2016-02-14 18:05:13 +00:00
parent 321ab14390
commit c19a88ad06
5 changed files with 67 additions and 28 deletions

2
.gitignore vendored
View File

@ -170,3 +170,5 @@ crashlytics.properties
crashlytics-build.properties
Examples/Rome/
TestPackage/.build
.build/

View File

@ -23,3 +23,11 @@ build_help:
test:
cd SwiftlineTests; xctool -project Swiftline.xcodeproj -scheme Swiftline clean build test -sdk macosx GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
test-spm:
cd TestPackage && rm -rf .build
cd TestPackage && swift build
build-spm:
rm -rf .build
swift build

View File

@ -267,7 +267,7 @@ Returns the arguments passed to the script. For example when calling `script -f1
`Args.parsed.flags` returns a dictinary of flags `["f1": "val1", "f2", "val2"]`
## Installation
You can install Swiftline using cocoapods,
You can install Swiftline using cocoapods, carthage and Swift package manager
### Cocoapods
use_frameworks!
@ -276,6 +276,19 @@ You can install Swiftline using cocoapods,
### Carthage
github 'swiftline/swiftline'
### Swift Package Manager
Add swiftline as dependency in your `Package.swift`
```
import PackageDescription
let package = Package(name: "YourPackage",
dependencies: [
.Package(url: "https://github.com/Swiftline/Swiftline.git", majorVersion: 0, minor: 3),
]
)
```
### Cocoapods + Rome plugin
If you want to use swiftline in a script you can use [Rome](https://github.com/neonichu/Rome) cocoapod plugin. This plugin builds the framework from the pod file and place them in a Rome directory.

View File

@ -0,0 +1,7 @@
import PackageDescription
let package = Package(name: "TestPackage",
dependencies: [
.Package(url: "../", majorVersion: 0, minor: 3),
]
)

View File

@ -0,0 +1,9 @@
import Swiftline
let res = ask("How are you doing?")
if res == "Good" {
print("Cool!")
} else {
print("Oh, bad!")
}