Package.swift 3.9 KB

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