Skip to content

Commit

Permalink
Merge pull request #155 from sersoft-gmbh/spm_support
Browse files Browse the repository at this point in the history
Add Swift Package Manager support
  • Loading branch information
AvdLee committed Jan 27, 2020
2 parents 45c2517 + 626460f commit 80b1c30
Show file tree
Hide file tree
Showing 29 changed files with 499 additions and 328 deletions.
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

0 comments on commit 80b1c30

Please sign in to comment.