Pod.swift 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright 2020 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import Foundation
  17. /// Struct describing Firebase pods to release.
  18. public struct Pod {
  19. /// The name of the pod.
  20. public let name: String
  21. /// Whether or not the pod is closed source.
  22. public let isClosedSource: Bool
  23. /// Whether or not the pod is in beta.
  24. public let isBeta: Bool
  25. /// Allow validation warnings. Ideally these should all be `false`.
  26. public let allowWarnings: Bool
  27. /// Set of platforms (e.g. "ios", "macos", "tvos", or "watchos") to build this pod for.
  28. public let platforms: Set<String>
  29. /// Allows overriding the ``Manifest/version`` for this pod; defaults to `nil`.
  30. public let podVersion: String?
  31. /// Whether or not the pod is planned for publicly releasing (as some pods are for
  32. /// internal/testing use).
  33. public let releasing: Bool
  34. /// Whether or not the pod is the top level pod in the zip distribution.
  35. public let zip: Bool
  36. init(_ name: String,
  37. isClosedSource: Bool = false,
  38. isBeta: Bool = false,
  39. allowWarnings: Bool = false,
  40. platforms: Set<String> = ["ios", "macos", "tvos", "watchos"],
  41. podVersion: String? = nil,
  42. releasing: Bool = true,
  43. zip: Bool = false) {
  44. self.name = name
  45. self.isClosedSource = isClosedSource
  46. self.isBeta = isBeta
  47. self.allowWarnings = allowWarnings
  48. self.platforms = platforms
  49. self.podVersion = podVersion
  50. self.releasing = releasing
  51. self.zip = zip
  52. }
  53. public func podspecName() -> String {
  54. return "\(name).podspec"
  55. }
  56. /// The Firebase pod does not support import validation with Xcode 12 because of the deprecated
  57. /// ML pods not supporting the ARM Mac slice.
  58. public func skipImportValidation() -> String {
  59. if name == "Firebase" {
  60. return "--skip-import-validation"
  61. } else {
  62. return ""
  63. }
  64. }
  65. }