Skip to content

Commit

Permalink
SwiftPM support for the 5.x versions.
Browse files Browse the repository at this point in the history
Document the resources support that isn't working in SwiftPM 5.3, and create the
version specific files that will be needed to eventually use it.

Progress on #192
  • Loading branch information
thomasvl committed Sep 28, 2020
1 parent 7bb24db commit 2a3b526
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 2 deletions.
48 changes: 46 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

Expand Down Expand Up @@ -26,6 +26,18 @@ let package = Package(
.target(
name: "GTMSessionFetcherCore",
path: "Source",
exclude:[
"GTMSessionFetcherIOS",
"GTMSessionFetcherOSX",
"GTMSessionFetchertvOS",
"GTMSessionFetcherwatchOS",
"TestApps",
"UnitTests",
"GTMGatherInputStream.m",
"GTMMIMEDocument.m",
"GTMReadMonitorInputStream.m",
"GTMSessionFetcherLogViewController.m",
],
sources:[
"GTMSessionFetcher.h",
"GTMSessionFetcher.m",
Expand All @@ -42,6 +54,19 @@ let package = Package(
name: "GTMSessionFetcherFull",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
exclude:[
"GTMSessionFetcherIOS",
"GTMSessionFetcherOSX",
"GTMSessionFetchertvOS",
"GTMSessionFetcherwatchOS",
"TestApps",
"UnitTests",
"GTMSessionFetcher.m",
"GTMSessionFetcherLogging.m",
"GTMSessionFetcherLogViewController.m",
"GTMSessionFetcherService.m",
"GTMSessionUploadFetcher.m",
],
sources: [
"GTMGatherInputStream.h",
"GTMGatherInputStream.m",
Expand All @@ -56,6 +81,21 @@ let package = Package(
name: "GTMSessionFetcherLogView",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
exclude:[
"GTMSessionFetcherIOS",
"GTMSessionFetcherOSX",
"GTMSessionFetchertvOS",
"GTMSessionFetcherwatchOS",
"TestApps",
"UnitTests",
"GTMGatherInputStream.m",
"GTMMIMEDocument.m",
"GTMReadMonitorInputStream.m",
"GTMSessionFetcherService.m",
"GTMSessionFetcher.m",
"GTMSessionFetcherLogging.m",
"GTMSessionUploadFetcher.m",
],
sources: [
"GTMSessionFetcherLogViewController.h",
"GTMSessionFetcherLogViewController.m"
Expand All @@ -65,7 +105,11 @@ let package = Package(
.testTarget(
name: "GTMSessionFetcherCoreTests",
dependencies: ["GTMSessionFetcherFull", "GTMSessionFetcherCore"],
path: "Source/UnitTests"
path: "Source/UnitTests",
// Resources not working as of Swfit 5.3
// - https://forums.swift.org/t/5-3-resources-support-not-working-on-with-swift-test/40381
// - https://bugs.swift.org/browse/SR-13560
exclude: ["Data", "SupportingFiles"]
)
]
)
72 changes: 72 additions & 0 deletions Package@swift-5.1.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "GTMSessionFetcher",
products: [
.library(
name: "GTMSessionFetcher",
targets: ["GTMSessionFetcherCore", "GTMSessionFetcherFull"]
),
.library(
name: "GTMSessionFetcherCore",
targets: ["GTMSessionFetcherCore"]
),
.library(
name: "GTMSessionFetcherFull",
targets: ["GTMSessionFetcherFull"]
),
.library(
name: "GTMSessionFetcherLogView",
targets: ["GTMSessionFetcherLogView"]
)
],
targets: [
.target(
name: "GTMSessionFetcherCore",
path: "Source",
sources:[
"GTMSessionFetcher.h",
"GTMSessionFetcher.m",
"GTMSessionFetcherLogging.h",
"GTMSessionFetcherLogging.m",
"GTMSessionFetcherService.h",
"GTMSessionFetcherService.m",
"GTMSessionUploadFetcher.h",
"GTMSessionUploadFetcher.m"
],
publicHeadersPath: "SwiftPackage"
),
.target(
name: "GTMSessionFetcherFull",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
sources: [
"GTMGatherInputStream.h",
"GTMGatherInputStream.m",
"GTMMIMEDocument.h",
"GTMMIMEDocument.m",
"GTMReadMonitorInputStream.h",
"GTMReadMonitorInputStream.m",
],
publicHeadersPath: "SwiftPackage"
),
.target(
name: "GTMSessionFetcherLogView",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
sources: [
"GTMSessionFetcherLogViewController.h",
"GTMSessionFetcherLogViewController.m"
],
publicHeadersPath: "SwiftPackage"
),
.testTarget(
name: "GTMSessionFetcherCoreTests",
dependencies: ["GTMSessionFetcherFull", "GTMSessionFetcherCore"],
path: "Source/UnitTests"
// Resources hot wired in the source file themselves.
)
]
)
72 changes: 72 additions & 0 deletions Package@swift-5.2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "GTMSessionFetcher",
products: [
.library(
name: "GTMSessionFetcher",
targets: ["GTMSessionFetcherCore", "GTMSessionFetcherFull"]
),
.library(
name: "GTMSessionFetcherCore",
targets: ["GTMSessionFetcherCore"]
),
.library(
name: "GTMSessionFetcherFull",
targets: ["GTMSessionFetcherFull"]
),
.library(
name: "GTMSessionFetcherLogView",
targets: ["GTMSessionFetcherLogView"]
)
],
targets: [
.target(
name: "GTMSessionFetcherCore",
path: "Source",
sources:[
"GTMSessionFetcher.h",
"GTMSessionFetcher.m",
"GTMSessionFetcherLogging.h",
"GTMSessionFetcherLogging.m",
"GTMSessionFetcherService.h",
"GTMSessionFetcherService.m",
"GTMSessionUploadFetcher.h",
"GTMSessionUploadFetcher.m"
],
publicHeadersPath: "SwiftPackage"
),
.target(
name: "GTMSessionFetcherFull",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
sources: [
"GTMGatherInputStream.h",
"GTMGatherInputStream.m",
"GTMMIMEDocument.h",
"GTMMIMEDocument.m",
"GTMReadMonitorInputStream.h",
"GTMReadMonitorInputStream.m",
],
publicHeadersPath: "SwiftPackage"
),
.target(
name: "GTMSessionFetcherLogView",
dependencies: ["GTMSessionFetcherCore"],
path: "Source",
sources: [
"GTMSessionFetcherLogViewController.h",
"GTMSessionFetcherLogViewController.m"
],
publicHeadersPath: "SwiftPackage"
),
.testTarget(
name: "GTMSessionFetcherCoreTests",
dependencies: ["GTMSessionFetcherFull", "GTMSessionFetcherCore"],
path: "Source/UnitTests"
// Resources hot wired in the source file themselves.
)
]
)

0 comments on commit 2a3b526

Please sign in to comment.