Skip to content

Commit

Permalink
Merge branch 'release-4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsolomko committed Nov 18, 2017
2 parents 7c03fc7 + e8064ae commit 36f068e
Show file tree
Hide file tree
Showing 243 changed files with 15,436 additions and 12,996 deletions.
8 changes: 0 additions & 8 deletions .codeclimate.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
Package.pins

# CocoaPods
#
Expand Down Expand Up @@ -68,3 +69,9 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

# Ignore symbolic link to swcomp executable built by SPM.
swcomp

# Ignore Package.resolved, because there is no dependencies by default for this package.
Package.resolved
18 changes: 14 additions & 4 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ clean: true
exclude: Tests/
author: Timofey Solomko
module: SWCompression
module_version: 3.4.0
module_version: 4.0.0
copyright: '© 2017 Timofey Solomko'
readme: README.md
github_url: https://github.com/tsolomko/SWCompression
github_file_prefix: https://github.com/tsolomko/SWCompression/tree/v3.4.0
github_file_prefix: https://github.com/tsolomko/SWCompression/tree/v4.0.0
theme: fullwidth

custom_categories:
Expand All @@ -31,24 +31,34 @@ custom_categories:
- SevenZipEntryInfo
- TarContainer
- TarEntry
- TarEntryInfo
- ZipContainer
- ZipEntry
- ZipEntryInfo
- name: Errors
children:
- BZip2Error
- DeflateError
- GzipError
- LZMAError
- LZMA2Error
- SevenZipError
- TarError
- ZipError
- GzipError
- XZError
- ZipError
- ZlibError
- name: Protocols
children:
- Archive
- Container
- ContainerEntry
- ContainerEntryInfo
- CompressionAlgorithm
- DecompressionAlgorithm
- name: Common Auxiliary Types
children:
- ContainerEntryType
- DosAttributes
- Permissions
- CompressionMethod
- FileSystemType
1 change: 1 addition & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"MD007": { "indent": 4 },
"MD013": { "line_length": 120 },
"MD024": false,
"MD026": { "punctuation": ".,;:!"},
"MD029": { "style": "ordered" }
}
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
4.0
4 changes: 4 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ disabled_rules:
- function_body_length
- type_body_length
opt_in_rules:
- array_init
- block_based_kvo
- conditional_returns_on_newline
- contains_over_first_not_nil
- discouraged_direct_init
- explicit_init
- fatal_error_message
- first_where
- implicit_return
- implicitly_unwrapped_optional
- joined_default_parameter
- literal_expression_end_indentation
- no_grouping_extension
- operator_usage_whitespace
- pattern_matching_keywords
- redundant_nil_coalescing
- single_test_class
- sorted_first_last
- strict_fileprivate
- switch_case_on_newline
- trailing_closure
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
env:
global:
- FRAMEWORK_NAME=SWCompression
- CC_TEST_REPORTER_ID=87379ba4ed4c1c2f6cd9ab95560364759898a0902effca0c23eddfc16a9ff5ff
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
matrix:
include:
- language: objective-c
osx_image: xcode8.3
osx_image: xcode9
xcode_project: SWCompression.xcodeproj
xcode_scheme: SWCompression
before_install:
- gem install slather
- brew update
- brew upgrade carthage
# `brew outdated` is necessary to prevent build error when there is no updates for Carthage.
- brew outdated carthage || brew upgrade carthage
- brew install git-lfs
- git lfs install
before_script:
- cd Tests/Test\ Files
- git lfs pull
- cd ../..
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
before_deploy:
- carthage build --no-skip-current
- carthage archive $FRAMEWORK_NAME
script:
- xcodebuild clean build test -project SWCompression.xcodeproj -scheme SWCompression
after_success:
- slather coverage -x --scheme SWCompression SWCompression.xcodeproj/
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
deploy:
provider: releases
api_key:
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# Changelog

## 4.0.0

- Reworked Container API:
- New protocol: `ContainerEntryInfo`.
- `ContainerEntry`:
- Now has an associated type `Info: ContainerEntryInfo`.
- Now has only two members: `info` and `data` properties; all previous members were removed.
- `Container`:
- Now has an associated type `Entry: ContainerEntry`.
- `open` function now returns an array of associated type `Entry`.
- Added new function `info`, which returns an array of `Entry.Info`.
- All existing ZIP, TAR and 7-Zip types now conform to these protocols.
- All `Entry` types now have only two members: `info` and `data` (see `ContainerEntry` protocol).
- Added missing types for ZIP, TAR and 7-Zip with conformance to these protocols.
- Standardized behavior when `ContainerEntry.data` can be `nil`:
- If entry is a directory.
- If data is unavailable, but error wasn't thrown for some reason.
- 7-Zip only: if entry is an anti-file.

- Added several new common types, which are used across the framework:
- `CompressionMethod`.
- Used in `GzipHeader.compressionMethod`, `ZlibHeader.compressionMethod`, `ZipEntryInfo.compressionMethod`.
- `ContainerEntryType`.
- Used in `ContainerEntryInfo.type` and types that conform to `ContainerEntryInfo` protocol.
- `DosAttributes`.
- It is the same as previous `SevenZipEntryInfo.DosAttributes` type.
- Used in `SevenZipEntryInfo.dosAttributes` and `ZipEntryInfo.dosAttributes`.
- `Permissions`.
- It is the same as previous `SevenZipEntryInfo.Permissions` type.
- Used in `ContainerEntryInfo.permissions` and types that conform to `ContainerEntryInfo` protocol.
- `FileSystemType`.
- Used in `GzipHeader.osType` and `ZipEntryInfo.fileSystemType`.
- Removed `GzipHeader.FileSystemType`.
- Removed `GzipHeader.CompressionMethod`.
- Removed `TarEntry.EntryType`.

- Removed following errors:
- `SevenZipError.dataIsUnavailable`
- `LZMAError.decoderIsNotInitialised`
- `LZMA2Error.wrongProperties` (`LZMA2Error.wrongDictionarySize` is thrown instead).
- `TarError.wrongUstarVersion`.
- `TarError.notAsciiString` (`TarError.wrongField` is thrown instead).
- `XZError.wrongFieldValue` (`XZError.wrongField` is thrown instead).
- Renamed following errors:
- `BZip2Error.wrongHuffmanLengthCode` to `BZip2Error.wrongHuffmanCodeLength`.
- `BZip2Error.wrongCompressionMethod` to `BZip2Error.wrongVersion`.
- `TarError.fieldIsNotNumber` to `TarError.wrongField`.
- `XZError.reservedFieldValue` to `XZError.wrongField`.
- Standardized behavior for errors named similar to `wrongCRC`:
- These errors mean that everything went well, except for comparing the checksum.
- Their associated values now contain all "successfully" unpacked data, including the one, which caused such an error.
- This change affects `BZip2.decompress`, `GzipArchive.multiUnarchive`, `XZArchive.unarchive`,
`XZArchive.splitUnarchive`, `ZipContainer.open`.
- Some of these errors now have arrays as associated values to account for the situations with unpacked data split.
- This change affects `GzipArchive.multiUnarchive`, `XZArchive.unarchive`, `XZArchive.splitUnarchive`, `ZipContainer.open`.

- Removed `SevenZipEntryInfo.isDirectory`. Use `type` property instead.
- `SevenZipEntryInfo.name` is no longer `Optional`.
- Now throws `SevenZipError.internalStructureError` when file names cannot be properly processed.
- Entries now have empty strings as names when no names were found in container.
- Renamed `XZArchive.multiUnarchive` to `XZArchive.splitUnarchive`.
- `XZArchive.unarchive` now processes all XZ streams similar to `splitUnarchive`, but combines them into one output `Data`.
- Fixed "bitReader is not aligned" precondition crash in Zlib.
- Fixed potential incorrect behavior when opening ZIP containers with size bigger than 4 GB..
- Updated to use Swift 4.
- Various improvements to documentation.
- "swcomp" is now included is as part of this repository.

## 3.4.0

- Added support for BZip2 compression.
Expand Down
28 changes: 23 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
// swift-tools-version:4.0
import PackageDescription

let package = Package(
name: "SWCompression",
swiftLanguageVersions: [3],
exclude: [
"Sources/Service/",
"Tests/"
]
products: [
.library(
name: "SWCompression",
targets: ["SWCompression"])
],
// SWCOMP: Uncomment the lines below to build swcomp example program.
// dependencies: [
// .package(url: "https://github.com/jakeheis/SwiftCLI", from: "4.0.0")
// ],
targets: [
// SWCOMP: Uncomment the lines below to build swcomp example program.
// .target(
// name: "swcomp",
// dependencies: ["SWCompression", "SwiftCLI"],
// path: "Sources",
// sources: ["swcomp"]),
.target(
name: "SWCompression",
path: "Sources",
sources: ["Common", "7-Zip", "BZip2", "Deflate", "GZip", "LZMA", "LZMA2", "TAR", "XZ", "ZIP", "Zlib"])
],
swiftLanguageVersions: [4]
)
Loading

0 comments on commit 36f068e

Please sign in to comment.