Skip to content

Commit 760d39b

Browse files
committed
Update swift-tools to 6.0 by default, adding Package@swift-5.5.swift to support older versions.
1 parent f4b2935 commit 760d39b

File tree

2 files changed

+135
-3
lines changed

2 files changed

+135
-3
lines changed

Package.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
// Copyright 2021 Google LLC
@@ -129,6 +129,5 @@ let package = Package(
129129
dependencies: ["GoogleSignInSwift"],
130130
path: "GoogleSignInSwift/Tests/Unit"
131131
)
132-
],
133-
swiftLanguageVersions: [.version("6"), .v5]
132+
]
134133
)

Package@swift-5.5.swift

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// swift-tools-version:5.5
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
// Copyright 2021 Google LLC
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
18+
import PackageDescription
19+
20+
let googleSignInVersion = "9.0.0"
21+
22+
let package = Package(
23+
name: "GoogleSignIn",
24+
defaultLocalization: "en",
25+
platforms: [
26+
.macOS(.v10_15),
27+
.iOS(.v12)
28+
],
29+
products: [
30+
.library(
31+
name: "GoogleSignIn",
32+
targets: [
33+
"GoogleSignIn",
34+
]
35+
),
36+
.library(
37+
name: "GoogleSignInSwift",
38+
targets: [
39+
"GoogleSignInSwift",
40+
]
41+
),
42+
],
43+
dependencies: [
44+
.package(
45+
name: "AppAuth",
46+
url: "https://github.com/openid/AppAuth-iOS.git",
47+
from: "2.0.0"),
48+
.package(
49+
name: "AppCheck",
50+
url: "https://github.com/google/app-check.git",
51+
from: "11.0.0"),
52+
.package(
53+
name: "GTMAppAuth",
54+
url: "https://github.com/google/GTMAppAuth.git",
55+
from: "5.0.0"),
56+
.package(
57+
name: "GTMSessionFetcher",
58+
url: "https://github.com/google/gtm-session-fetcher.git",
59+
from: "3.3.0"),
60+
.package(
61+
name: "OCMock",
62+
url: "https://github.com/firebase/ocmock.git",
63+
.revision("7291762d3551c5c7e31c49cce40a0e391a52e889")),
64+
.package(
65+
name: "GoogleUtilities",
66+
url: "https://github.com/google/GoogleUtilities.git",
67+
from: "8.0.0"),
68+
],
69+
targets: [
70+
.target(
71+
name: "GoogleSignIn",
72+
dependencies: [
73+
.product(name: "AppAuth", package: "AppAuth"),
74+
.product(name: "AppAuthCore", package: "AppAuth"),
75+
.product(name: "AppCheckCore", package: "AppCheck"),
76+
.product(name: "GTMAppAuth", package: "GTMAppAuth"),
77+
.product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
78+
],
79+
path: "GoogleSignIn/Sources",
80+
resources: [
81+
.process("Resources"),
82+
.process("Strings"),
83+
],
84+
publicHeadersPath: "Public",
85+
cSettings: [
86+
.headerSearchPath("../../"),
87+
.define("GID_SDK_VERSION", to: googleSignInVersion),
88+
],
89+
linkerSettings: [
90+
.linkedFramework("CoreGraphics"),
91+
.linkedFramework("CoreText"),
92+
.linkedFramework("Foundation"),
93+
.linkedFramework("LocalAuthentication"),
94+
.linkedFramework("Security"),
95+
.linkedFramework("AppKit", .when(platforms: [.macOS])),
96+
.linkedFramework("UIKit", .when(platforms: [.iOS])),
97+
]
98+
),
99+
.target(
100+
name: "GoogleSignInSwift",
101+
dependencies: [
102+
"GoogleSignIn",
103+
],
104+
path: "GoogleSignInSwift/Sources",
105+
resources: [
106+
.copy("Resources/PrivacyInfo.xcprivacy")
107+
]
108+
),
109+
.testTarget(
110+
name: "GoogleSignIn-UnitTests",
111+
dependencies: [
112+
"GoogleSignIn",
113+
"OCMock",
114+
.product(name: "AppAuth", package: "AppAuth"),
115+
.product(name: "AppCheckCore", package: "AppCheck"),
116+
.product(name: "GTMAppAuth", package: "GTMAppAuth"),
117+
.product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
118+
.product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
119+
.product(name: "GULSwizzlerTestHelpers", package: "GoogleUtilities"),
120+
],
121+
path: "GoogleSignIn/Tests/Unit",
122+
cSettings: [
123+
.headerSearchPath("../../../"),
124+
.define("GID_SDK_VERSION", to: googleSignInVersion),
125+
]
126+
),
127+
.testTarget(
128+
name: "GoogleSignInSwift-UnitTests",
129+
dependencies: ["GoogleSignInSwift"],
130+
path: "GoogleSignInSwift/Tests/Unit"
131+
)
132+
]
133+
)

0 commit comments

Comments
 (0)