Skip to content

Commit

Permalink
Android support (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino authored Feb 13, 2025
1 parent f38e9a9 commit 3fd4701
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with_linting: true
with_musl: true
ios_scheme_name: Zip
with_android: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -28,7 +29,7 @@ jobs:
include:
- { swift-version: 5.9, swift-branch: swift-5.9.2-release, swift-tag: 5.9.2-RELEASE }
- { swift-version: 5.10, swift-branch: swift-5.10.1-release, swift-tag: 5.10.1-RELEASE }
- { swift-version: 6.0, swift-branch: swift-6.0.1-release, swift-tag: 6.0.1-RELEASE }
- { swift-version: 6.0, swift-branch: swift-6.0.3-release, swift-tag: 6.0.3-RELEASE }
runs-on: windows-latest
timeout-minutes: 60
steps:
Expand Down
2 changes: 1 addition & 1 deletion Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public class Zip {
}

var writeBytes: UInt64 = 0
let filePointer: UnsafeMutablePointer<FILE>? = fopen(fullPath, "wb")
let filePointer = fopen(fullPath, "wb")
while let filePointer {
let readBytes = unzReadCurrentFile(zip, &buffer, UInt32(buffer.count))
guard readBytes > 0 else { break }
Expand Down
8 changes: 3 additions & 5 deletions Tests/ZipTests/ZipTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import XCTest

final class ZipTests: XCTestCase {
private func url(forResource resource: String, withExtension ext: String? = nil) -> URL? {
let resourcePath = URL(fileURLWithPath: #filePath)
.deletingLastPathComponent()
.appendingPathComponent("TestResources")
.appendingPathComponent(resource)
return ext.map { resourcePath.appendingPathExtension($0) } ?? resourcePath
Bundle.module.url(forResource: "TestResources/\(resource)", withExtension: ext)
}

private func autoRemovingSandbox() throws -> URL {
Expand Down Expand Up @@ -183,6 +179,8 @@ final class ZipTests: XCTestCase {
let expectedPermissions = 0o700
#elseif os(Windows) && compiler(>=6.0)
let expectedPermissions = 0o600
#elseif os(Android)
let expectedPermissions = 0o666
#else
let expectedPermissions = 0o644
#endif
Expand Down

0 comments on commit 3fd4701

Please sign in to comment.