Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Optimize the code #149

Open
wants to merge 100 commits into
base: bugfix/issue74
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
643317e
Merge pull request #75 from marmelroy/bugfix/issue74
marmelroy Mar 15, 2017
113fb6c
Release 0.7.0
marmelroy Mar 15, 2017
a9dacdf
Fix travis
marmelroy Mar 15, 2017
b2d625c
Fix Travis
marmelroy Mar 15, 2017
4a15a78
Fix Travis
marmelroy Mar 15, 2017
f8f690f
Zip, unzipFile, allow a progress handler to not be provided
piemonte Jun 13, 2017
3e33d0d
provide a file URL when unzipped
piemonte Jun 13, 2017
1ea5e96
Add fwrite() and uncompressed_size validation
Jul 14, 2017
6e16483
Merge pull request #89 from piemonte/master
marmelroy Jul 23, 2017
4a71be9
support swift 4.0
Sep 15, 2017
efbe72c
code style
Sep 15, 2017
8d1efb3
Release 0.8.0
marmelroy Sep 20, 2017
37433c9
Merge pull request #100 from jabez1314/master
marmelroy Sep 20, 2017
63cf422
Merge pull request #94 from bricklife/feature/uncompressed_size_valid…
marmelroy Sep 20, 2017
8c29772
Swift 4 and Xcode 9: fix Zip build issues and errors
marmelroy Sep 20, 2017
b888501
Fix example project
marmelroy Sep 20, 2017
16897d3
Release 1.0.0
marmelroy Sep 20, 2017
993f565
Fix build script
marmelroy Sep 20, 2017
0504840
String warnings
Nov 18, 2017
624a149
Fix Swift 4 string compiler deprecation warning.
peterboni Nov 25, 2017
8e282b6
Added includeRootDirectory logic.
peterboni Nov 25, 2017
c8cee3e
Merge pull request #113 from peterboni/patch-1
marmelroy Nov 26, 2017
f0d114f
Merge pull request #114 from peterboni/patch-2
marmelroy Nov 26, 2017
988f693
Merge pull request #112 from radianttap/stringupdate
marmelroy Nov 26, 2017
e0935dc
Release 1.1.0
marmelroy Nov 26, 2017
f19d14f
Aligned Minizip module name with official repository
simonseyer Jan 19, 2018
8167a47
Fixes #121
Jan 26, 2018
d569d65
Fixed issue with address sanitizer
buscarini Feb 21, 2018
1a310d0
Update swift version to 4.1 for Xcode 9.3.
chris-guidry Apr 16, 2018
580c59a
Update Zip.podspec
Workshed May 19, 2018
86c55a9
Merge pull request #122 from fassko/ISSUE_121_DOCUMENTS_DIR_TVOS
AvdLee Jun 15, 2018
c35468f
Merge pull request #128 from buscarini/master
AvdLee Jun 15, 2018
1e21dd9
Merge pull request #119 from cobi-bike/fix-minizip-reference
AvdLee Jun 15, 2018
66dfbc2
Merge pull request #135 from chris-guidry/patch-1
AvdLee Jun 15, 2018
be01e41
Merge pull request #140 from Workshed/master
AvdLee Jun 15, 2018
a40879b
Whitespaces handling for fileOutputHandler.
Jul 23, 2018
5afb94d
Functionality to zip files from memory
ryanmeasel Jul 27, 2018
00aa448
Merge pull request #146 from ryanmeasel/pull-request-zipFromMemory
marmelroy Jul 29, 2018
8069b61
Merge pull request #145 from matuslittva/master
marmelroy Jul 29, 2018
4b5bc70
Darn workspace check
Sep 17, 2018
f9272ac
Xcode 10 recommended settings
Sep 17, 2018
d9ebd57
Updated to Swift 4.2
Sep 17, 2018
4d9124d
Minimal accepted watchos deployment is 3.0 (with AppStore Connect)
Sep 25, 2018
000fb6b
Merge pull request #152 from radianttap/xcode10
AvdLee Nov 26, 2018
68e5bee
Add Swift Package Manager support
ffried Nov 21, 2018
c4deddb
Refactor test setup to work with Swift Package Manager
ffried Nov 21, 2018
128e18d
Update README
ffried Nov 22, 2018
dbd438d
Add spm testing to travis
ffried Nov 22, 2018
fec96e4
Update test OS
ffried Nov 22, 2018
932e50d
Update Badges in README
ffried Nov 22, 2018
025f25f
Fix tests on Linux
ffried Dec 13, 2018
3e3e33c
Fix linking on Linux
ffried Dec 13, 2018
53247af
Fix directory attributes on Linux
ffried Dec 13, 2018
76c1317
urls(for:in:) is not yet available on Linux
ffried Dec 13, 2018
36bc4f6
Fix document directory usage on Linux
ffried Dec 13, 2018
160441d
"Fix" test on Linux
ffried Dec 13, 2018
d9fdd07
Add ZLib as dependency
ffried Dec 13, 2018
ab49614
Add restructured header files to Xcode project
ffried Dec 13, 2018
80abfd2
Remove unneeded dependency
ffried Dec 13, 2018
7ce1b52
Updated for Swift 5, Xcode 10.2.
radianttap Mar 27, 2019
81b8315
Updated podspec
radianttap Mar 27, 2019
58fae77
Add support for using Zip in playgrounds. Only use modulemap for Xcode.
ffried Mar 27, 2019
b7721c0
Upgrade Swift version
ffried Mar 27, 2019
46ffa24
Update Travis
ffried Mar 27, 2019
c17ae8c
Fix compiler warnings on linux
ffried Mar 27, 2019
77802d0
Change travis image to xcode10.2
mflint Apr 2, 2019
0a80f5b
Change build/test platform to iOS 12.2
mflint Apr 2, 2019
9c2f557
Version changed to 1.2.0
mflint Apr 13, 2019
943ad84
Link 'z' directly with Swift 5.0
ffried May 3, 2019
d1aab95
Don't include zlib.h if it's already been included
ffried May 3, 2019
af80499
Regenerate XCTestManifests
ffried May 7, 2019
fbd7ba7
Updated to Swift 5.1
mflint Jul 7, 2019
45c2517
Merge pull request #173 from mflint/swift5.1
AvdLee Nov 6, 2019
757c60b
Merge branch 'master' into spm_support
AvdLee Jan 24, 2020
5108c78
Add Swift 5.1 support for SPM
ffried Jan 27, 2020
626460f
Update swift-version and gitignore
ffried Jan 27, 2020
80b1c30
Merge pull request #155 from sersoft-gmbh/spm_support
AvdLee Jan 27, 2020
e8cd3dd
fixed a bug where progress block was called twice with value 1.0 when…
stoqn4opm Jun 27, 2020
a63500f
Merge pull request #197 from stoqn4opm/master
marmelroy Sep 24, 2020
06bf89d
Zip: update for Xcode 12
marmelroyspotify Sep 24, 2020
be9a846
Update CI for Xcode 12
marmelroyspotify Sep 24, 2020
f1f27d4
Zip: move example to SPM
marmelroyspotify Sep 24, 2020
ecec6ac
Merge pull request #200 from marmelroy/xcode12
marmelroy Sep 24, 2020
5a9dd77
Build script update
marmelroyspotify Sep 24, 2020
1c68236
Update readme
marmelroyspotify Sep 24, 2020
644ea12
Release 2.1.0
marmelroyspotify Sep 24, 2020
e79fbe9
Readme update
marmelroyspotify Sep 24, 2020
3164688
Podspec update paths
marmelroyspotify Sep 26, 2020
bd19d97
Release 2.1.1
marmelroyspotify Sep 26, 2020
f34106f
Update README
marmelroyspotify Sep 26, 2020
76ecce6
Enable module stability support.
mingchen Oct 21, 2020
3d55cc2
Create build-universal-xcframework.sh
rohan-elear Jan 13, 2021
d8ac104
Hides implementation details to avoid use of modulemap in target
rohan-elear Jan 13, 2021
059e734
Xcode 13 RC compile fix
nighthawk Sep 15, 2021
35e61ae
Merge pull request #221 from maparoni/master
marmelroy Feb 23, 2022
747a771
Merge pull request #214 from rohan-elear/master
marmelroy Feb 23, 2022
061bcf9
Xcode: update last upgrade version
marmelroyspotify Feb 23, 2022
67fa558
Release 2.1.2
marmelroyspotify Feb 23, 2022
6940ceb
Protect against extracting files outside the destination directory.
Nov 23, 2023
bca30f6
Merge pull request #252 from Stannieman/bugfix/Fix_issue_245_path_tra…
AvdLee Feb 14, 2024
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Zip/minizip/* linguist-vendored
Zip/minizip/* linguist-vendored
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 @@
3.0
5.3
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
osx_image: xcode8
language: objective-c
osx_image: xcode12
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 [email protected]
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 [email protected]
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"),
]
)
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
![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 3.0 framework for zipping and unzipping files. Simple and quick to use. Built on top of [minizip](https://github.com/nmoinvaz/minizip).
A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of [minizip](https://github.com/nmoinvaz/minizip).

## Usage

Expand Down Expand Up @@ -53,29 +53,26 @@ 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")
```

### [Preferred] 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: "2.1"))
```

### Setting up with [CocoaPods](http://cocoapods.org/?q=Zip)
```ruby
source 'https://github.com/CocoaPods/Specs.git'
pod 'Zip', '~> 0.6'
```

### 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
pod 'Zip', '~> 2.1'
```

### 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" ~> 2.1
```

16 changes: 7 additions & 9 deletions Zip.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

Pod::Spec.new do |s|
s.name = "Zip"
s.version = "0.6.0"
s.version = "2.1.2"
s.summary = "Zip and unzip files in Swift."
s.swift_version = "5.3"
s.swift_versions = ["4.2", "5.0", "5.1", "5.3"]

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
Expand All @@ -21,24 +23,20 @@ Pod::Spec.new do |s|
DESC

s.homepage = "https://github.com/marmelroy/Zip"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT'
s.author = { "Roy Marmelstein" => "[email protected]" }
s.source = { :git => "https://github.com/marmelroy/Zip.git", :tag => s.version.to_s}
s.social_media_url = "http://twitter.com/marmelroy"

s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
s.watchos.deployment_target = '3.0'
s.osx.deployment_target = '10.9'
s.requires_arc = true

s.source_files = 'Zip/*.{swift,h}', 'Zip/minizip/*.{c,h}', 'Zip/minizip/aes/*.{c,h}'
s.source_files = 'Zip/*.{swift,h}', 'Zip/minizip/*.{c,h}', 'Zip/minizip/include/*.{c,h}'
s.public_header_files = 'Zip/*.h'
s.pod_target_xcconfig = {'SWIFT_INCLUDE_PATHS' => '$(SRCROOT)/Zip/Zip/minizip/**','LIBRARY_SEARCH_PATHS' => '$(SRCROOT)/Zip/Zip/'}
# s.public_header_files = 'Pod/Classes/**/*.h'
s.libraries = 'z'
s.preserve_paths = 'Zip/minizip/module.modulemap'

# s.dependency 'AFNetworking', '~> 2.3'
s.preserve_paths = 'Zip/minizip/module/module.modulemap'
end
Loading