@@ -18,10 +18,10 @@ import Foundation
18
18
19
19
/// CocoaPod related utility functions. The enum type is used as a namespace here instead of having
20
20
/// root functions, and no cases should be added to it.
21
- public enum CocoaPodUtils {
21
+ enum CocoaPodUtils {
22
22
// MARK: - Public API
23
23
24
- public struct VersionedPod : Decodable {
24
+ struct VersionedPod : Decodable {
25
25
/// Public name of the pod.
26
26
let name : String
27
27
@@ -30,7 +30,7 @@ public enum CocoaPodUtils {
30
30
}
31
31
32
32
/// Information associated with an installed pod.
33
- public struct PodInfo {
33
+ struct PodInfo {
34
34
/// The version of the generated pod.
35
35
let version : String
36
36
@@ -42,7 +42,7 @@ public enum CocoaPodUtils {
42
42
}
43
43
44
44
/// Executes the `pod cache clean --all` command to remove any cached CocoaPods.
45
- public static func cleanPodCache( ) {
45
+ static func cleanPodCache( ) {
46
46
let result = Shell . executeCommandFromScript ( " pod cache clean --all " , outputToConsole: false )
47
47
switch result {
48
48
case let . error( code) :
@@ -56,7 +56,7 @@ public enum CocoaPodUtils {
56
56
}
57
57
58
58
/// Gets metadata from installed Pods. Reads the `Podfile.lock` file and parses it.
59
- public static func installedPodsInfo( inProjectDir projectDir: URL ) -> [ String : PodInfo ] {
59
+ static func installedPodsInfo( inProjectDir projectDir: URL ) -> [ String : PodInfo ] {
60
60
// Read from the Podfile.lock to get the installed versions and names.
61
61
let podfileLock : String
62
62
do {
@@ -78,9 +78,9 @@ public enum CocoaPodUtils {
78
78
/// - customSpecRepos: Additional spec repos to check for installation.
79
79
/// - Returns: A dictionary of PodInfo's keyed by the pod name.
80
80
@discardableResult
81
- public static func installPods( _ pods: [ VersionedPod ] ,
82
- inDir directory: URL ,
83
- customSpecRepos: [ URL ] ? = nil ) -> [ String : PodInfo ] {
81
+ static func installPods( _ pods: [ VersionedPod ] ,
82
+ inDir directory: URL ,
83
+ customSpecRepos: [ URL ] ? = nil ) -> [ String : PodInfo ] {
84
84
let fileManager = FileManager . default
85
85
// Ensure the directory exists, otherwise we can't install all subspecs.
86
86
guard fileManager. directoryExists ( at: directory) else {
@@ -126,7 +126,7 @@ public enum CocoaPodUtils {
126
126
///
127
127
/// - Parameter contents: The contents of a `Podfile.lock` file.
128
128
/// - Returns: A dictionary of PodInfo structs keyed by the pod name.
129
- public static func loadPodInfoFromPodfileLock( contents: String ) -> [ String : PodInfo ] {
129
+ static func loadPodInfoFromPodfileLock( contents: String ) -> [ String : PodInfo ] {
130
130
// This pattern matches a pod name with its version (two to three components)
131
131
// Examples:
132
132
// - FirebaseUI/Google (4.1.1):
@@ -187,7 +187,7 @@ public enum CocoaPodUtils {
187
187
return installedPods
188
188
}
189
189
190
- public static func updateRepos( ) {
190
+ static func updateRepos( ) {
191
191
let result = Shell . executeCommandFromScript ( " pod repo update " )
192
192
switch result {
193
193
case let . error( _, output) :
@@ -197,7 +197,7 @@ public enum CocoaPodUtils {
197
197
}
198
198
}
199
199
200
- public static func podInstallPrepare( inProjectDir projectDir: URL ) {
200
+ static func podInstallPrepare( inProjectDir projectDir: URL ) {
201
201
do {
202
202
// Create the directory and all intermediate directories.
203
203
try FileManager . default. createDirectory ( at: projectDir, withIntermediateDirectories: true )
0 commit comments