Package.swift 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // swift-tools-version:6.0
  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 = "9.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: "2.0.0"),
  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: "5.0.0"),
  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: "AppAuthCore", package: "AppAuth"),
  71. .product(name: "AppCheckCore", package: "AppCheck"),
  72. .product(name: "GTMAppAuth", package: "GTMAppAuth"),
  73. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  74. ],
  75. path: "GoogleSignIn/Sources",
  76. resources: [
  77. .process("Resources"),
  78. .process("Strings"),
  79. ],
  80. publicHeadersPath: "Public",
  81. cSettings: [
  82. .headerSearchPath("../../"),
  83. .define("GID_SDK_VERSION", to: googleSignInVersion),
  84. ],
  85. linkerSettings: [
  86. .linkedFramework("CoreGraphics"),
  87. .linkedFramework("CoreText"),
  88. .linkedFramework("Foundation"),
  89. .linkedFramework("LocalAuthentication"),
  90. .linkedFramework("Security"),
  91. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  92. .linkedFramework("UIKit", .when(platforms: [.iOS])),
  93. ]
  94. ),
  95. .target(
  96. name: "GoogleSignInSwift",
  97. dependencies: [
  98. "GoogleSignIn",
  99. ],
  100. path: "GoogleSignInSwift/Sources",
  101. resources: [
  102. .copy("Resources/PrivacyInfo.xcprivacy")
  103. ]
  104. ),
  105. .testTarget(
  106. name: "GoogleSignIn-UnitTests",
  107. dependencies: [
  108. "GoogleSignIn",
  109. "OCMock",
  110. .product(name: "AppAuth", package: "AppAuth"),
  111. .product(name: "AppCheckCore", package: "AppCheck"),
  112. .product(name: "GTMAppAuth", package: "GTMAppAuth"),
  113. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  114. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  115. .product(name: "GULSwizzlerTestHelpers", package: "GoogleUtilities"),
  116. ],
  117. path: "GoogleSignIn/Tests/Unit",
  118. cSettings: [
  119. .headerSearchPath("../../../"),
  120. .define("GID_SDK_VERSION", to: googleSignInVersion),
  121. ]
  122. ),
  123. .testTarget(
  124. name: "GoogleSignInSwift-UnitTests",
  125. dependencies: ["GoogleSignInSwift"],
  126. path: "GoogleSignInSwift/Tests/Unit"
  127. )
  128. ]
  129. )