From e30bf90981b32bdd8fbd127babdf604125ad0974 Mon Sep 17 00:00:00 2001 From: Sian January Date: Thu, 7 Sep 2017 14:10:02 +0100 Subject: [PATCH] Workaround for Swift PM bug --- Package.swift | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 932f91f..48d1c52 100644 --- a/Package.swift +++ b/Package.swift @@ -5,11 +5,51 @@ import PackageDescription #if os(Linux) let excludePortDir = "ibmras/common/port/osx" + + let package = Package( + name: "omr-agentcore", + products: [ + // omr-agentcore libraries. + .library(name: "agentcore", type: .dynamic, targets: ["agentcore"]), + .library(name: "hcapiplugin", type: .dynamic, targets: ["hcapiplugin"]), + .library(name: "memplugin", type: .dynamic, targets: ["memplugin"]), + .library(name: "cpuplugin", type: .dynamic, targets: ["cpuplugin"]), + .library(name: "envplugin", type: .dynamic, targets: ["envplugin"]), + .library(name: "mqttplugin", type: .dynamic, targets: ["mqttplugin"]), + .library(name: "paho", type: .dynamic, targets: ["paho"]) + ], + targets: [ + // omr-agentcore targets, one for each library. + .target(name: "agentcore", + exclude: [ "ibmras/common/port/aix", + "ibmras/common/port/windows", + "ibmras/common/data", + "ibmras/common/util/memUtils.cpp", + "ibmras/monitoring/connector/headless", + excludePortDir + ]), + .target(name: "paho", + exclude: [ "Windows Build", + "build", + "doc", + "test", + "src/MQTTClient.c", + "src/MQTTVersion.c", + "src/SSLSocket.c", + "src/samples", + ]), + .target(name: "mqttplugin", dependencies: ["paho"]), + .target(name: "cpuplugin"), + .target(name: "envplugin"), + .target(name: "memplugin"), +// Workaround for Swift bug https://bugs.swift.org/browse/SR-5849 + .target(name: "hcapiplugin") + ] +) #else let excludePortDir = "ibmras/common/port/linux" -#endif -let package = Package( + let package = Package( name: "omr-agentcore", products: [ // omr-agentcore libraries. @@ -48,3 +88,4 @@ let package = Package( .target(name: "hcapiplugin", dependencies: ["agentcore"]) ] ) +#endif