Skip to content

Commit edbeaa3

Browse files
authored
Merge pull request weichsel#111 from weichsel/development
Prepare 0.9.9 Release
2 parents d9bb1c4 + 2d847ba commit edbeaa3

31 files changed

+592
-207
lines changed

.github/azure-pipelines.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
trigger:
2+
- master
3+
4+
jobs:
5+
- job: Linux_Swift_5_0
6+
pool:
7+
vmImage: 'Ubuntu 16.04'
8+
container: swift:5.0
9+
steps:
10+
- script: swift test -c release -Xswiftc -enable-testing
11+
displayName: Linux Swift 5.0
12+
13+
- job: Linux_Swift_4_2
14+
pool:
15+
vmImage: 'Ubuntu 16.04'
16+
container: swift:4.2
17+
steps:
18+
- script: swift test -c release -Xswiftc -enable-testing
19+
displayName: Linux Swift 4.2
20+
21+
- job: Linux_Swift_4_1
22+
pool:
23+
vmImage: 'Ubuntu 16.04'
24+
container: swift:4.1
25+
steps:
26+
- script: swift test -c release -Xswiftc -enable-testing
27+
displayName: Linux Swift 4.1
28+
29+
- job: Linux_Swift_4_0
30+
pool:
31+
vmImage: 'Ubuntu 16.04'
32+
container: swift:4.0
33+
steps:
34+
- script: swift test -c release -Xswiftc -enable-testing
35+
displayName: Linux Swift 4.0
36+
37+
- job: macOS_10_13
38+
pool:
39+
vmImage: 'macOS 10.13'
40+
variables:
41+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
42+
steps:
43+
- task: Xcode@5
44+
inputs:
45+
actions: 'test'
46+
packageApp: false
47+
exportMethod: 'development'
48+
exportOptionsPlist: ''
49+
configuration: 'Release'
50+
scheme: 'ZIPFoundation'
51+
sdk: 'macosx'
52+
destinationPlatformOption: 'macOS'
53+
useXcpretty: true
54+
publishJUnitResults: true
55+
- task: PublishTestResults@2
56+
inputs:
57+
testRunner: JUnit
58+
testResultsFiles: build/reports/**
59+
failTaskOnFailedTests: true
60+
61+
- job: iOS_12_1
62+
pool:
63+
vmImage: 'macOS 10.13'
64+
variables:
65+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
66+
steps:
67+
- task: Xcode@5
68+
inputs:
69+
actions: 'test'
70+
packageApp: false
71+
exportMethod: 'development'
72+
exportOptionsPlist: ''
73+
configuration: 'Release'
74+
scheme: 'ZIPFoundation'
75+
sdk: 'iphonesimulator'
76+
destinationPlatformOption: 'iOS'
77+
destinationTypeOption: 'simulators'
78+
destinationSimulators: 'iPhone X'
79+
useXcpretty: true
80+
publishJUnitResults: true
81+
- task: PublishTestResults@2
82+
inputs:
83+
testRunner: JUnit
84+
testResultsFiles: build/reports/**
85+
failTaskOnFailedTests: true
86+
87+
- job: watchOS_5_1
88+
pool:
89+
vmImage: 'macOS 10.13'
90+
variables:
91+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
92+
steps:
93+
# We currently only perform a build-only script for watchOS (xcodebuild test is unable to find the XCTest module)
94+
- task: Xcode@5
95+
inputs:
96+
actions: 'build'
97+
packageApp: false
98+
exportMethod: 'development'
99+
exportOptionsPlist: ''
100+
configuration: 'Release'
101+
scheme: 'ZIPFoundation'
102+
sdk: 'watchsimulator'
103+
destinationPlatformOption: 'custom'
104+
destinationTypeOption: 'simulators'
105+
destinationSimulators: 'Apple Watch Series 3 - 38mm'
106+
107+
- job: tvOS_12_1
108+
pool:
109+
vmImage: 'macOS 10.13'
110+
variables:
111+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
112+
steps:
113+
- task: Xcode@5
114+
inputs:
115+
actions: 'test'
116+
packageApp: false
117+
exportMethod: 'development'
118+
exportOptionsPlist: ''
119+
configuration: 'Release'
120+
scheme: 'ZIPFoundation'
121+
sdk: 'appletvsimulator'
122+
destinationPlatformOption: 'tvOS'
123+
destinationTypeOption: 'simulators'
124+
destinationSimulators: 'Apple TV 4K'
125+
useXcpretty: true
126+
publishJUnitResults: true
127+
- task: PublishTestResults@2
128+
inputs:
129+
testRunner: JUnit
130+
testResultsFiles: build/reports/**
131+
failTaskOnFailedTests: true
132+
133+
- job: SwiftLint
134+
pool:
135+
vmImage: 'macOS 10.13'
136+
variables:
137+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
138+
steps:
139+
- script: xcodebuild -scheme ZIPFoundation clean build-for-testing > xcodebuild.log
140+
displayName: Generate xcodebuild.log
141+
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install https://raw.github.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb
142+
displayName: Install SwiftLint
143+
- script: |
144+
set -o pipefail
145+
mkdir -p build/reports/
146+
swiftlint lint --reporter junit > build/reports/swiftlint.xml
147+
displayName: SwiftLint
148+
- task: PublishTestResults@2
149+
inputs:
150+
testRunner: JUnit
151+
testResultsFiles: build/reports/**
152+
failTaskOnFailedTests: true
153+
- script: swiftlint analyze --strict --compiler-log-path xcodebuild.log
154+
displayName: SwiftLint Analyze
155+
156+
- job: CodeCoverage
157+
pool:
158+
vmImage: 'macOS 10.13'
159+
variables:
160+
DEVELOPER_DIR: /Applications/Xcode_10.1.app
161+
steps:
162+
- script: xcodebuild test -destination 'platform=macOS,arch=x86_64' -scheme "ZIPFoundation" -derivedDataPath Build/
163+
displayName: Generate xccovreport
164+
- script: (xcrun xccov view --only-targets Build/Logs/Test/*.xcresult/*_Test/action.xccovreport | grep -Eq "ZIPFoundation.*100\.00%") && { exit 0; } || { echo '##vso[task.logissue type=error;]Please make sure that the test suite covers all framework code paths.'; exit 1; }
165+
displayName: Check for full line coverage

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [0.9.9](https://github.com/weichsel/ZIPFoundation/releases/tag/0.9.9)
4+
5+
### Added
6+
- Swift 5.0 support
7+
- Optional `preferredEncoding` parameter to explicitly configure an encoding for filepaths
8+
9+
### Updated
10+
- Fixed a library load error related to dylib versioning
11+
- Fixed a hang during read when decoding small, `.deflate` compressed entries
12+
- Improved Linux support
13+
- Improved test suite on non-Darwin platforms
14+
315
## [0.9.8](https://github.com/weichsel/ZIPFoundation/releases/tag/0.9.8)
416

517
### Updated
@@ -9,7 +21,7 @@
921

1022
### Added
1123
- App extension support
12-
- Optional `compressionMethod` paramter for `zipItem:`
24+
- Optional `compressionMethod` parameter for `zipItem:`
1325

1426
### Updated
1527
- Fixed a path traversal attack vulnerability

Package.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:5.0
22
import PackageDescription
33

4-
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
5-
let dependencies: [Package.Dependency] = []
4+
#if canImport(Compression)
5+
let targets: [Target] = [
6+
.target(name: "ZIPFoundation"),
7+
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
8+
]
69
#else
7-
let dependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/CZlib.git", .exact("0.1.2"))]
10+
let targets: [Target] = [
11+
.systemLibrary(name: "CZLib", pkgConfig: "zlib", providers: [.brew(["zlib"]), .apt(["zlib"])]),
12+
.target(name: "ZIPFoundation", dependencies: ["CZLib"]),
13+
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
14+
]
815
#endif
916

1017
let package = Package(
1118
name: "ZIPFoundation",
19+
platforms: [
20+
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2)
21+
],
1222
products: [
1323
.library(name: "ZIPFoundation", targets: ["ZIPFoundation"])
1424
],
15-
dependencies: dependencies,
16-
targets: [
17-
.target(name: "ZIPFoundation"),
18-
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
19-
]
25+
targets: targets,
26+
swiftLanguageVersions: [.v4, .v4_2, .v5]
2027
)

Package@swift-4.0.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// swift-tools-version:4.0
2+
import PackageDescription
3+
4+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
5+
let dependencies: [Package.Dependency] = []
6+
#else
7+
let dependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/CZlib.git", .exact("0.1.2"))]
8+
#endif
9+
10+
let package = Package(
11+
name: "ZIPFoundation",
12+
products: [
13+
.library(name: "ZIPFoundation", targets: ["ZIPFoundation"])
14+
],
15+
dependencies: dependencies,
16+
targets: [
17+
.target(name: "ZIPFoundation"),
18+
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
19+
]
20+
)

Package@swift-4.1.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// swift-tools-version:4.1
2+
import PackageDescription
3+
4+
#if canImport(Compression)
5+
let dependencies: [Package.Dependency] = []
6+
#else
7+
let dependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/CZlib.git", .exact("0.1.2"))]
8+
#endif
9+
10+
let package = Package(
11+
name: "ZIPFoundation",
12+
products: [
13+
.library(name: "ZIPFoundation", targets: ["ZIPFoundation"])
14+
],
15+
dependencies: dependencies,
16+
targets: [
17+
.target(name: "ZIPFoundation"),
18+
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
19+
]
20+
)

Package@swift-4.2.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// swift-tools-version:4.2
2+
import PackageDescription
3+
4+
#if canImport(Compression)
5+
let dependencies: [Package.Dependency] = []
6+
#else
7+
let dependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/CZlib.git", .exact("0.1.2"))]
8+
#endif
9+
10+
let package = Package(
11+
name: "ZIPFoundation",
12+
products: [
13+
.library(name: "ZIPFoundation", targets: ["ZIPFoundation"])
14+
],
15+
dependencies: dependencies,
16+
targets: [
17+
.target(name: "ZIPFoundation"),
18+
.testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"])
19+
],
20+
swiftLanguageVersions: [.v4, .v4_2]
21+
)

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,17 @@ To learn more about the performance characteristics of the framework, you can re
3939

4040
- iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
4141
- Or Linux with zlib development package
42-
- Xcode 9.0
42+
- Xcode 10.0
4343
- Swift 4.0
4444

4545
## Installation
4646

4747
### Swift Package Manager
4848
Swift Package Manager is a dependency manager currently under active development. To learn how to use the Swift Package Manager for your project, please read the [official documentation](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md).
49-
The ZIP Foundation package uses the [V4 Package Description API](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescriptionV4.md).
5049
To add ZIP Foundation as a dependency, you have to add it to the `dependencies` of your `Package.swift` file and refer to that dependency in your `target`.
5150

5251
```swift
53-
// swift-tools-version:4.0
52+
// swift-tools-version:5.0
5453
import PackageDescription
5554
let package = Package(
5655
name: "<Your Product Name>",

Sources/CZLib/module.modulemap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// module.modulemap
3+
// ZIPFoundation
4+
//
5+
// Copyright © 2017-2019 Thomas Zoechling, https://www.peakstep.com and the ZIP Foundation project authors.
6+
// Released under the MIT License.
7+
//
8+
// See https://github.com/weichsel/ZIPFoundation/blob/master/LICENSE for license information.
9+
//
10+
11+
module CZlib {
12+
header "shim.h"
13+
link "z"
14+
export *
15+
}

Sources/CZLib/shim.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// shim.h
3+
// ZIPFoundation
4+
//
5+
// Copyright © 2017-2019 Thomas Zoechling, https://www.peakstep.com and the ZIP Foundation project authors.
6+
// Released under the MIT License.
7+
//
8+
// See https://github.com/weichsel/ZIPFoundation/blob/master/LICENSE for license information.
9+
//
10+
11+
#ifndef zlib_shim_h
12+
#define zlib_shim_h
13+
14+
#import <stdio.h>
15+
#import <zlib.h>
16+
17+
#endif

0 commit comments

Comments
 (0)