Optional
This commit is contained in:
@@ -3,6 +3,23 @@ import PackageDescription
|
||||
import Foundation
|
||||
|
||||
let isLocalDevelopment = FileManager.default.fileExists(atPath: "../LCECryptoKit/PrivateLib/LCECryptoKitBinary")
|
||||
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
|
||||
? [
|
||||
.package(url: cryptoPackageURL, exact: "1.0.2")
|
||||
]
|
||||
: []
|
||||
|
||||
let targetDependencies: [Target.Dependency] = enableCryptoBinary
|
||||
? [
|
||||
.product(name: "LCECryptoKit", package: "lcecryptokitbinary")
|
||||
]
|
||||
: []
|
||||
|
||||
let package = Package(
|
||||
name: "LCEssentials",
|
||||
@@ -17,17 +34,10 @@ let package = Package(
|
||||
name: "LCEssentials",
|
||||
targets: ["LCEssentials"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(
|
||||
url: isLocalDevelopment ?
|
||||
"../LCECryptoKit/PrivateLib/LCECryptoKitBinary" :
|
||||
"https://60c260c85d3a2fe840411b0ff98f521b5eca3c56@git.loverde.com.br/Loverde-Company-LTDA/LCECryptoKitBinary.git",
|
||||
exact: "1.0.2"
|
||||
)
|
||||
],
|
||||
dependencies: packageDependencies,
|
||||
targets: [
|
||||
.target(
|
||||
name: "LCEssentials",
|
||||
dependencies: [.product(name: "LCECryptoKit", package: "lcecryptokitbinary")]),
|
||||
dependencies: targetDependencies),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user