Package.swift 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // swift-tools-version:5.3
  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 = "6.2.0"
  18. let package = Package(
  19. name: "GoogleSignIn",
  20. defaultLocalization: "en",
  21. platforms: [
  22. .macOS(.v10_15),
  23. .iOS(.v9)
  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. "1.5.0" ..< "2.0.0"),
  44. .package(
  45. name: "GTMAppAuth",
  46. url: "https://github.com/google/GTMAppAuth.git",
  47. "1.3.0" ..< "2.0.0"),
  48. .package(
  49. name: "GTMSessionFetcher",
  50. url: "https://github.com/google/gtm-session-fetcher.git",
  51. "1.5.0" ..< "2.0.0"),
  52. .package(
  53. name: "OCMock",
  54. url: "https://github.com/firebase/ocmock.git",
  55. .revision("7291762d3551c5c7e31c49cce40a0e391a52e889")),
  56. .package(
  57. name: "GoogleUtilities",
  58. url: "https://github.com/google/GoogleUtilities.git",
  59. "7.3.0" ..< "8.0.0"),
  60. ],
  61. targets: [
  62. .target(
  63. name: "GoogleSignIn",
  64. dependencies: [
  65. .product(name: "AppAuth", package: "AppAuth"),
  66. .product(name: "GTMAppAuth", package: "GTMAppAuth"),
  67. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  68. ],
  69. path: "GoogleSignIn/Sources",
  70. resources: [
  71. .process("Resources"),
  72. .process("Strings"),
  73. ],
  74. publicHeadersPath: "Public",
  75. cSettings: [
  76. .headerSearchPath("../../"),
  77. .define("GID_SDK_VERSION", to: googleSignInVersion),
  78. ],
  79. linkerSettings: [
  80. .linkedFramework("CoreGraphics"),
  81. .linkedFramework("CoreText"),
  82. .linkedFramework("Foundation"),
  83. .linkedFramework("LocalAuthentication"),
  84. .linkedFramework("Security"),
  85. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  86. .linkedFramework("UIKit", .when(platforms: [.iOS])),
  87. ]
  88. ),
  89. .target(
  90. name: "GoogleSignInSwift",
  91. dependencies: [
  92. "GoogleSignIn",
  93. ],
  94. path: "GoogleSignInSwift/Sources"
  95. ),
  96. .testTarget(
  97. name: "GoogleSignIn-UnitTests",
  98. dependencies: [
  99. "GoogleSignIn",
  100. "OCMock",
  101. .product(name: "AppAuth", package: "AppAuth"),
  102. .product(name: "GTMAppAuth", package: "GTMAppAuth"),
  103. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  104. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  105. .product(name: "GULSwizzlerTestHelpers", package: "GoogleUtilities"),
  106. ],
  107. path: "GoogleSignIn/Tests/Unit",
  108. cSettings: [
  109. .headerSearchPath("../../../"),
  110. .define("GID_SDK_VERSION", to: googleSignInVersion),
  111. ]
  112. ),
  113. .testTarget(
  114. name: "GoogleSignInSwift-UnitTests",
  115. dependencies: ["GoogleSignInSwift"],
  116. path: "GoogleSignInSwift/Tests/Unit"
  117. )
  118. ]
  119. )