forked from marmelroy/Zip
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows support and other various changes (#10)
### Issue #9 Originally authored by @compnerd in marmelroy#246 - Add support for Windows - Add Windows CI tests - Drop support for Swift 5.8 - Adopt `swift-format` - Add CI for iOS and MUSL - Various bug fixes
- Loading branch information
1 parent
567d515
commit f38e9a9
Showing
40 changed files
with
727 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Sources/Minizip/* linguist-vendored | ||
Sources/CMinizip/* linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @fpseverino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"fileScopedDeclarationPrivacy": { | ||
"accessLevel": "private" | ||
}, | ||
"indentation": { | ||
"spaces": 4 | ||
}, | ||
"indentConditionalCompilationBlocks": true, | ||
"indentSwitchCaseLabels": false, | ||
"lineBreakAroundMultilineExpressionChainComponents": false, | ||
"lineBreakBeforeControlFlowKeywords": false, | ||
"lineBreakBeforeEachArgument": false, | ||
"lineBreakBeforeEachGenericRequirement": false, | ||
"lineLength": 140, | ||
"maximumBlankLines": 1, | ||
"multiElementCollectionTrailingCommas": true, | ||
"noAssignmentInExpressions": { | ||
"allowedFunctions": [ | ||
"XCTAssertNoThrow" | ||
] | ||
}, | ||
"prioritizeKeepingFunctionOutputTogether": false, | ||
"respectsExistingLineBreaks": true, | ||
"rules": { | ||
"AllPublicDeclarationsHaveDocumentation": false, | ||
"AlwaysUseLiteralForEmptyCollectionInit": false, | ||
"AlwaysUseLowerCamelCase": false, | ||
"AmbiguousTrailingClosureOverload": true, | ||
"BeginDocumentationCommentWithOneLineSummary": false, | ||
"DoNotUseSemicolons": true, | ||
"DontRepeatTypeInStaticProperties": true, | ||
"FileScopedDeclarationPrivacy": true, | ||
"FullyIndirectEnum": true, | ||
"GroupNumericLiterals": true, | ||
"IdentifiersMustBeASCII": true, | ||
"NeverForceUnwrap": false, | ||
"NeverUseForceTry": false, | ||
"NeverUseImplicitlyUnwrappedOptionals": false, | ||
"NoAccessLevelOnExtensionDeclaration": true, | ||
"NoAssignmentInExpressions": true, | ||
"NoBlockComments": true, | ||
"NoCasesWithOnlyFallthrough": true, | ||
"NoEmptyTrailingClosureParentheses": true, | ||
"NoLabelsInCasePatterns": true, | ||
"NoLeadingUnderscores": false, | ||
"NoParensAroundConditions": true, | ||
"NoPlaygroundLiterals": true, | ||
"NoVoidReturnOnFunctionSignature": true, | ||
"OmitExplicitReturns": false, | ||
"OneCasePerLine": true, | ||
"OneVariableDeclarationPerLine": true, | ||
"OnlyOneTrailingClosureArgument": true, | ||
"OrderedImports": true, | ||
"ReplaceForEachWithForLoop": true, | ||
"ReturnVoidInsteadOfEmptyTuple": true, | ||
"TypeNamesShouldBeCapitalized": true, | ||
"UseEarlyExits": false, | ||
"UseExplicitNilCheckInConditions": true, | ||
"UseLetInEveryBoundCaseVariable": true, | ||
"UseShorthandTypeNames": true, | ||
"UseSingleLinePropertyGetter": true, | ||
"UseSynthesizedInitializer": true, | ||
"UseTripleSlashForDocumentationComments": true, | ||
"UseWhereClausesInForLoops": false, | ||
"ValidateDocumentationComments": false | ||
}, | ||
"spacesAroundRangeFormationOperators": false, | ||
"tabWidth": 8, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,68 @@ | ||
// swift-tools-version:5.8 | ||
// swift-tools-version:5.9 | ||
import PackageDescription | ||
|
||
#if canImport(Darwin) || compiler(<6.0) | ||
import Foundation | ||
#else | ||
import FoundationEssentials | ||
#endif | ||
|
||
let package = Package( | ||
name: "Zip", | ||
products: [ | ||
.library(name: "Zip", targets: ["Zip"]) | ||
], | ||
targets: [ | ||
.target( | ||
name: "Minizip", | ||
exclude: ["module"], | ||
swiftSettings: [ | ||
.enableUpcomingFeature("ConciseMagicFile"), | ||
name: "CMinizip", | ||
cSettings: [ | ||
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])) | ||
], | ||
linkerSettings: [ | ||
.linkedLibrary("z") | ||
] | ||
swiftSettings: swiftSettings | ||
), | ||
.target( | ||
name: "Zip", | ||
dependencies: [ | ||
.target(name: "Minizip"), | ||
.target(name: "CMinizip") | ||
], | ||
cSettings: [ | ||
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])) | ||
], | ||
swiftSettings: [ | ||
.enableUpcomingFeature("ConciseMagicFile"), | ||
] | ||
swiftSettings: swiftSettings | ||
), | ||
.testTarget( | ||
name: "ZipTests", | ||
dependencies: [ | ||
.target(name: "Zip"), | ||
.target(name: "Zip") | ||
], | ||
resources: [ | ||
.copy("Resources"), | ||
.copy("TestResources") | ||
], | ||
swiftSettings: [ | ||
.enableUpcomingFeature("ConciseMagicFile"), | ||
] | ||
swiftSettings: swiftSettings | ||
), | ||
] | ||
) | ||
|
||
var swiftSettings: [SwiftSetting] { | ||
[ | ||
.enableUpcomingFeature("ExistentialAny"), | ||
.enableUpcomingFeature("ConciseMagicFile"), | ||
.enableUpcomingFeature("ForwardTrailingClosures"), | ||
.enableUpcomingFeature("DisableOutwardActorInference"), | ||
.enableUpcomingFeature("StrictConcurrency"), | ||
.enableExperimentalFeature("StrictConcurrency=complete"), | ||
] | ||
} | ||
|
||
if let target = package.targets.filter({ $0.name == "CMinizip" }).first { | ||
#if os(Windows) | ||
if ProcessInfo.processInfo.environment["ZIP_USE_DYNAMIC_ZLIB"] == nil { | ||
target.cSettings?.append(contentsOf: [.define("ZLIB_STATIC")]) | ||
target.linkerSettings = [.linkedLibrary("zlibstatic")] | ||
} else { | ||
target.linkerSettings = [.linkedLibrary("zlib")] | ||
} | ||
#else | ||
target.linkerSettings = [.linkedLibrary("z")] | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// CMinizip.h | ||
// Zip | ||
// | ||
// Created by Florian Friedrich on 3/27/19. | ||
// Copyright © 2019 Roy Marmelstein. All rights reserved. | ||
// | ||
|
||
#ifndef CMinizip_h | ||
#define CMinizip_h | ||
|
||
#include "ioapi.h" | ||
#include "crypt.h" | ||
#include "unzip.h" | ||
#include "zip.h" | ||
|
||
#endif /* CMinizip_h */ |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module CMinizip [system][extern_c] { | ||
header "CMinizip.h" | ||
export * | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.