Skip to content

Commit 80b1c30

Browse files
authored
Merge pull request #155 from sersoft-gmbh/spm_support
Add Swift Package Manager support
2 parents 45c2517 + 626460f commit 80b1c30

29 files changed

+499
-328
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ DerivedData
3333
# Carthage/Checkouts
3434

3535
Carthage/Build
36+
37+
# Swift Package Manager
38+
.build/
39+
.swiftpm/
40+
Packages/

.swift-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1
1+
5.1

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
osx_image: xcode11
2-
language: objective-c
2+
language: swift
33
env:
44
global:
55
- LC_CTYPE=en_US.UTF-8
@@ -9,6 +9,7 @@ before_install:
99
install: echo "<3"
1010
env:
1111
- MODE=framework
12+
- MODE=spm
1213
- MODE=examples
1314
script: ./build.sh $MODE
1415

LinuxMain.swift

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import XCTest
2+
3+
import ZipTests
4+
5+
var tests = [XCTestCaseEntry]()
6+
tests += ZipTests.__allTests()
7+
8+
XCTMain(tests)

Package.swift

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "Zip",
7+
products: [
8+
.library(name: "Zip", targets: ["Zip"])
9+
],
10+
targets: [
11+
.target(
12+
name: "Minizip",
13+
dependencies: [],
14+
path: "Zip/minizip",
15+
exclude: ["module"],
16+
linkerSettings: [
17+
.linkedLibrary("z")
18+
]),
19+
.target(
20+
name: "Zip",
21+
dependencies: ["Minizip"],
22+
path: "Zip",
23+
exclude: ["minizip", "zlib"]),
24+
.testTarget(
25+
name: "ZipTests",
26+
dependencies: ["Zip"],
27+
path: "ZipTests"),
28+
]
29+
)

[email protected]

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// swift-tools-version:4.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "Zip",
7+
products: [
8+
.library(name: "Zip", targets: ["Zip"])
9+
],
10+
targets: [
11+
.systemLibrary(
12+
name: "CZlib",
13+
path: "Zip/zlib",
14+
pkgConfig: "zlib"),
15+
.target(
16+
name: "Minizip",
17+
dependencies: ["CZlib"],
18+
path: "Zip/minizip",
19+
exclude: ["module"]),
20+
.target(
21+
name: "Zip",
22+
dependencies: ["Minizip"],
23+
path: "Zip",
24+
exclude: ["minizip", "zlib"]),
25+
.testTarget(
26+
name: "ZipTests",
27+
dependencies: ["Zip"],
28+
path: "ZipTests"),
29+
]
30+
)

[email protected]

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "Zip",
7+
products: [
8+
.library(name: "Zip", targets: ["Zip"])
9+
],
10+
targets: [
11+
.target(
12+
name: "Minizip",
13+
dependencies: [],
14+
path: "Zip/minizip",
15+
exclude: ["module"],
16+
linkerSettings: [
17+
.linkedLibrary("z")
18+
]),
19+
.target(
20+
name: "Zip",
21+
dependencies: ["Minizip"],
22+
path: "Zip",
23+
exclude: ["minizip", "zlib"]),
24+
.testTarget(
25+
name: "ZipTests",
26+
dependencies: ["Zip"],
27+
path: "ZipTests"),
28+
]
29+
)

README.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![Zip - Zip and unzip files in Swift](https://cloud.githubusercontent.com/assets/889949/12374908/252373d0-bcac-11e5-8ece-6933aeae8222.png)
22

3-
[![Build Status](https://travis-ci.org/marmelroy/Zip.svg?branch=master)](https://travis-ci.org/marmelroy/Zip) [![Version](http://img.shields.io/cocoapods/v/Zip.svg)](http://cocoapods.org/?q=Zip)
4-
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
3+
[![Build Status](https://travis-ci.org/marmelroy/Zip.svg?branch=master)](https://travis-ci.org/marmelroy/Zip) [![Version](http://img.shields.io/cocoapods/v/Zip.svg)](http://cocoapods.org/?q=Zip) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![SPM supported](https://img.shields.io/badge/SPM-supported-brightgreen.svg?style=flat)](https://swift.org/package-manager)
4+
55

66
# Zip
77
A Swift 4.0 framework for zipping and unzipping files. Simple and quick to use. Built on top of [minizip](https://github.com/nmoinvaz/minizip).
@@ -53,7 +53,7 @@ catch {
5353
## Custom File Extensions
5454

5555
Zip supports '.zip' and '.cbz' files out of the box. To support additional zip-derivative file extensions:
56-
```
56+
```swift
5757
Zip.addCustomFileExtension("file-extension-here")
5858
```
5959

@@ -63,19 +63,15 @@ source 'https://github.com/CocoaPods/Specs.git'
6363
pod 'Zip', '~> 1.1'
6464
```
6565

66-
### Setting up with Carthage
67-
68-
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
69-
70-
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
71-
72-
```bash
73-
$ brew update
74-
$ brew install carthage
75-
```
76-
66+
### Setting up with [Carthage](https://github.com/Carthage/Carthage)
7767
To integrate Zip into your Xcode project using Carthage, specify it in your `Cartfile`:
7868

7969
```ogdl
80-
github "marmelroy/Zip"
70+
github "marmelroy/Zip" ~> 1.1
71+
```
72+
73+
### Setting up with [Swift Package Manager](https://swift.org/package-manager)
74+
To use Zip with Swift Package Manager, add it to your package's dependencies:
75+
```swift
76+
.package(url: "https://github.com/marmelroy/Zip.git", .upToNextMinor(from: "1.1.0"))
8177
```

0 commit comments

Comments
 (0)