Pod.swift 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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", or "tvos") to build this pod for.
  28. public let platforms: Set<String>
  29. /// Whether or not the pod is planned for publicly releasing (as some pods are for
  30. /// internal/testing use).
  31. public let releasing: Bool
  32. /// Whether or not the pod is the top level pod in the zip distribution.
  33. public let zip: Bool
  34. init(_ name: String,
  35. isClosedSource: Bool = false,
  36. isBeta: Bool = false,
  37. allowWarnings: Bool = false,
  38. platforms: Set<String> = ["ios", "macos", "tvos"],
  39. podVersion: String? = nil,
  40. releasing: Bool = true,
  41. zip: Bool = false) {
  42. self.name = name
  43. self.isClosedSource = isClosedSource
  44. self.isBeta = isBeta
  45. self.allowWarnings = allowWarnings
  46. self.platforms = platforms
  47. self.releasing = releasing
  48. self.zip = zip
  49. }
  50. public func podspecName() -> String {
  51. return "\(name).podspec"
  52. }
  53. /// The Firebase pod does not support import validation with Xcode 12 because of the deprecated
  54. /// ML pods not supporting the ARM Mac slice.
  55. public func skipImportValidation() -> String {
  56. if name == "Firebase" {
  57. return "--skip-import-validation"
  58. } else {
  59. return ""
  60. }
  61. }
  62. }