Skip to content

Commit

Permalink
Merge pull request #23 from evandcoleman/release/0.1.24
Browse files Browse the repository at this point in the history
force dynamic products
  • Loading branch information
github-actions[bot] authored Sep 21, 2021
2 parents e5bcd64 + 50aa7d9 commit 5fe8f70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Scipio/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 8 additions & 2 deletions Sources/ScipioKit/Models/SwiftPackageFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -123,16 +123,22 @@ 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 {
let targetsString = targets
.map { "\"\($0)\"" }
.joined(separator: ", ")

return #"\#(indenting).library(name: "\#(name)", targets: [\#(targetsString)])"#
return #"\#(indenting).library(name: "\#(name)", type: .\#(type.rawValue), targets: [\#(targetsString)])"#
}
}

Expand Down

0 comments on commit 5fe8f70

Please sign in to comment.