2025-03-23 00:27:49 -03:00
|
|
|
// swift-tools-version: 6.0
|
|
|
|
|
import PackageDescription
|
2025-07-29 11:59:11 -03:00
|
|
|
import Foundation
|
|
|
|
|
|
2026-05-24 10:26:25 -03:00
|
|
|
let isLocalDevelopment = false //FileManager.default.fileExists(atPath: "../LCECryptoKit/PrivateLib/LCECryptoKitBinary")
|
2026-02-06 12:25:34 -03:00
|
|
|
let enableCryptoBinary = ProcessInfo.processInfo.environment["LCE_ENABLE_CRYPTO_BINARY"] != "0"
|
|
|
|
|
|
|
|
|
|
let cryptoPackageURL = isLocalDevelopment
|
|
|
|
|
? "../LCECryptoKit/PrivateLib/LCECryptoKitBinary"
|
|
|
|
|
: "https://60c260c85d3a2fe840411b0ff98f521b5eca3c56@git.loverde.com.br/Loverde-Company-LTDA/LCECryptoKitBinary.git"
|
|
|
|
|
|
|
|
|
|
let packageDependencies: [Package.Dependency] = enableCryptoBinary
|
|
|
|
|
? [
|
2026-08-22 11:26:38 -03:00
|
|
|
.package(url: cryptoPackageURL, exact: "1.0.4")
|
2026-02-06 12:25:34 -03:00
|
|
|
]
|
|
|
|
|
: []
|
|
|
|
|
|
|
|
|
|
let targetDependencies: [Target.Dependency] = enableCryptoBinary
|
|
|
|
|
? [
|
|
|
|
|
.product(name: "LCECryptoKit", package: "lcecryptokitbinary")
|
|
|
|
|
]
|
|
|
|
|
: []
|
2025-03-23 00:27:49 -03:00
|
|
|
|
|
|
|
|
let package = Package(
|
|
|
|
|
name: "LCEssentials",
|
2025-07-29 11:59:11 -03:00
|
|
|
platforms: [
|
2026-08-29 18:51:45 -03:00
|
|
|
.iOS(.v15),
|
2025-07-29 11:59:11 -03:00
|
|
|
.macOS(.v10_15),
|
|
|
|
|
.tvOS(.v13),
|
2026-08-29 18:51:45 -03:00
|
|
|
.watchOS(.v8)
|
2025-07-29 11:59:11 -03:00
|
|
|
],
|
2025-03-23 00:27:49 -03:00
|
|
|
products: [
|
|
|
|
|
.library(
|
|
|
|
|
name: "LCEssentials",
|
|
|
|
|
targets: ["LCEssentials"]),
|
|
|
|
|
],
|
2026-02-06 12:25:34 -03:00
|
|
|
dependencies: packageDependencies,
|
2025-03-23 00:27:49 -03:00
|
|
|
targets: [
|
|
|
|
|
.target(
|
2025-07-05 12:34:25 -03:00
|
|
|
name: "LCEssentials",
|
2026-02-06 12:25:34 -03:00
|
|
|
dependencies: targetDependencies),
|
[api-upload-refactor] Add test target, relax decode constraints, add HTTPBody + MultipartForm
- Package: new LCEssentialsTests target (runs on iOS simulator)
- JSONDecoder.decode: T: Codable -> T: Decodable & Sendable (4 overloads);
remove try! in decode(fromURL:); honour encoding param in decode(_:using:)
- Propagate & Sendable to Data.object, Dictionary.toObjetct, API.request return
- LCEHTTPBody: HTTPBody protocol, JSONBody, FormURLEncodedBody, RawBody, factories
- LCEMultipartForm: multipart builder, OutputStream-streamed serialize(),
in-memory + on-disk file parts, ported mimeType(for:)
- Tests: StubURLProtocol harness + 15 tests
2026-08-29 16:59:08 -03:00
|
|
|
.testTarget(
|
|
|
|
|
name: "LCEssentialsTests",
|
|
|
|
|
dependencies: ["LCEssentials"]),
|
2025-03-23 00:27:49 -03:00
|
|
|
]
|
|
|
|
|
)
|