Pod.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /// The Firebase pod does not support import validation with Xcode 12 because of the deprecated
  46. /// ML pods not supporting the ARM Mac slice.
  47. public func skipImportValidation() -> String {
  48. if name == "Firebase" {
  49. return "--skip-import-validation"
  50. } else {
  51. return ""
  52. }
  53. }
  54. }