mirror of
https://github.com/nsomar/Swiftline.git
synced 2024-09-11 13:45:31 +03:00
Adding SPM example
This commit is contained in:
parent
321ab14390
commit
c19a88ad06
2
.gitignore
vendored
2
.gitignore
vendored
@ -170,3 +170,5 @@ crashlytics.properties
|
|||||||
crashlytics-build.properties
|
crashlytics-build.properties
|
||||||
|
|
||||||
Examples/Rome/
|
Examples/Rome/
|
||||||
|
TestPackage/.build
|
||||||
|
.build/
|
||||||
|
8
Makefile
8
Makefile
@ -23,3 +23,11 @@ build_help:
|
|||||||
|
|
||||||
test:
|
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
|
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
|
||||||
|
15
Readme.md
15
Readme.md
@ -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"]`
|
`Args.parsed.flags` returns a dictinary of flags `["f1": "val1", "f2", "val2"]`
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
You can install Swiftline using cocoapods,
|
You can install Swiftline using cocoapods, carthage and Swift package manager
|
||||||
|
|
||||||
### Cocoapods
|
### Cocoapods
|
||||||
use_frameworks!
|
use_frameworks!
|
||||||
@ -276,6 +276,19 @@ You can install Swiftline using cocoapods,
|
|||||||
### Carthage
|
### Carthage
|
||||||
github 'swiftline/swiftline'
|
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
|
### 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.
|
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.
|
||||||
|
|
||||||
|
7
TestPackage/Package.swift
Normal file
7
TestPackage/Package.swift
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(name: "TestPackage",
|
||||||
|
dependencies: [
|
||||||
|
.Package(url: "../", majorVersion: 0, minor: 3),
|
||||||
|
]
|
||||||
|
)
|
9
TestPackage/Source/main.swift
Normal file
9
TestPackage/Source/main.swift
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import Swiftline
|
||||||
|
|
||||||
|
let res = ask("How are you doing?")
|
||||||
|
|
||||||
|
if res == "Good" {
|
||||||
|
print("Cool!")
|
||||||
|
} else {
|
||||||
|
print("Oh, bad!")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user