Pod.swift 2.2 KB

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