diff --git a/Sources/Scipio/main.swift b/Sources/Scipio/main.swift index c798b8e..10e7cd2 100644 --- a/Sources/Scipio/main.swift +++ b/Sources/Scipio/main.swift @@ -10,7 +10,7 @@ extension Command { .init( commandName: "Scipio", abstract: "A program to pre-build and cache Swift packages", - version: "0.1.22", + version: "0.1.24", subcommands: [ Command.Build.self, Command.Upload.self, diff --git a/Sources/ScipioKit/Models/SwiftPackageFile.swift b/Sources/ScipioKit/Models/SwiftPackageFile.swift index cea9263..b174bd9 100644 --- a/Sources/ScipioKit/Models/SwiftPackageFile.swift +++ b/Sources/ScipioKit/Models/SwiftPackageFile.swift @@ -51,7 +51,7 @@ public struct SwiftPackageFile { .sorted { $0.name < $1.name } products = sortedArtifacts - .map { Product(name: $0.name, targets: [$0.name]) } + .map { Product(name: $0.name, type: .dynamic, targets: [$0.name]) } targets = try sortedArtifacts .map { name, artifact, target in @@ -123,8 +123,14 @@ let package = Package( } extension SwiftPackageFile { + public enum ProductType: String { + case dynamic + case `static` + } + public struct Product { public var name: String + public var type: ProductType public var targets: [String] func asString(indenting: String) -> String { @@ -132,7 +138,7 @@ extension SwiftPackageFile { .map { "\"\($0)\"" } .joined(separator: ", ") - return #"\#(indenting).library(name: "\#(name)", targets: [\#(targetsString)])"# + return #"\#(indenting).library(name: "\#(name)", type: .\#(type.rawValue), targets: [\#(targetsString)])"# } }