Pod.swift 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. public let name: String
  20. public let isClosedSource: Bool
  21. public let isBeta: Bool
  22. public let allowWarnings: Bool // Allow validation warnings. Ideally these should all be false
  23. public let platforms: Set<String> // Set of platforms to build this pod for
  24. public let releasing: Bool // Non-Firebase pods may not release
  25. public let zip: Bool // Top level pod in Zip Distribution
  26. init(_ name: String,
  27. isClosedSource: Bool = false,
  28. isBeta: Bool = false,
  29. allowWarnings: Bool = false,
  30. platforms: Set<String> = ["ios", "macos", "tvos"],
  31. podVersion: String? = nil,
  32. releasing: Bool = true,
  33. zip: Bool = false) {
  34. self.name = name
  35. self.isClosedSource = isClosedSource
  36. self.isBeta = isBeta
  37. self.allowWarnings = allowWarnings
  38. self.platforms = platforms
  39. self.releasing = releasing
  40. self.zip = zip
  41. }
  42. public func podspecName() -> String {
  43. return isClosedSource ? "\(name).podspec.json" : "\(name).podspec"
  44. }
  45. /// Closed source pods do not validate on Xcode 12 until they support the ARM simulator slice.
  46. public func skipImportValidation() -> String {
  47. if isClosedSource || name == "Firebase" {
  48. return "--skip-import-validation"
  49. } else {
  50. return ""
  51. }
  52. }
  53. }