Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Swift Package Manager support #155

Merged
merged 25 commits into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ DerivedData
# Carthage/Checkouts

Carthage/Build

# Swift Package Manager
.build/
.swiftpm/
Packages/
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
5.1
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
osx_image: xcode11
language: objective-c
language: swift
env:
global:
- LC_CTYPE=en_US.UTF-8
Expand All @@ -9,6 +9,7 @@ before_install:
install: echo "<3"
env:
- MODE=framework
- MODE=spm
- MODE=examples
script: ./build.sh $MODE

Expand Down
8 changes: 8 additions & 0 deletions LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import XCTest

import ZipTests

var tests = [XCTestCaseEntry]()
tests += ZipTests.__allTests()

XCTMain(tests)
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "Zip",
products: [
.library(name: "Zip", targets: ["Zip"])
],
targets: [
.target(
name: "Minizip",
dependencies: [],
path: "Zip/minizip",
exclude: ["module"],
linkerSettings: [
.linkedLibrary("z")
]),
.target(
name: "Zip",
dependencies: ["Minizip"],
path: "Zip",
exclude: ["minizip", "zlib"]),
.testTarget(
name: "ZipTests",
dependencies: ["Zip"],
path: "ZipTests"),
]
)
30 changes: 30 additions & 0 deletions Package@swift-4.2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "Zip",
products: [
.library(name: "Zip", targets: ["Zip"])
],
targets: [
.systemLibrary(
name: "CZlib",
path: "Zip/zlib",
pkgConfig: "zlib"),
.target(
name: "Minizip",
dependencies: ["CZlib"],
path: "Zip/minizip",
exclude: ["module"]),
.target(
name: "Zip",
dependencies: ["Minizip"],
path: "Zip",
exclude: ["minizip", "zlib"]),
.testTarget(
name: "ZipTests",
dependencies: ["Zip"],
path: "ZipTests"),
]
)
29 changes: 29 additions & 0 deletions Package@swift-5.0.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "Zip",
products: [
.library(name: "Zip", targets: ["Zip"])
],
targets: [
.target(
name: "Minizip",
dependencies: [],
path: "Zip/minizip",
exclude: ["module"],
linkerSettings: [
.linkedLibrary("z")
]),
.target(
name: "Zip",
dependencies: ["Minizip"],
path: "Zip",
exclude: ["minizip", "zlib"]),
.testTarget(
name: "ZipTests",
dependencies: ["Zip"],
path: "ZipTests"),
]
)
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Zip - Zip and unzip files in Swift](https://cloud.githubusercontent.com/assets/889949/12374908/252373d0-bcac-11e5-8ece-6933aeae8222.png)

[![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)
[![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)


# Zip
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).
Expand Down Expand Up @@ -53,7 +53,7 @@ catch {
## Custom File Extensions

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

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

### Setting up with Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with [Homebrew](http://brew.sh/) using the following command:

```bash
$ brew update
$ brew install carthage
```

### Setting up with [Carthage](https://github.com/Carthage/Carthage)
To integrate Zip into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "marmelroy/Zip"
github "marmelroy/Zip" ~> 1.1
```

### Setting up with [Swift Package Manager](https://swift.org/package-manager)
To use Zip with Swift Package Manager, add it to your package's dependencies:
```swift
.package(url: "https://github.com/marmelroy/Zip.git", .upToNextMinor(from: "1.1.0"))
```
Loading