@@ -59,6 +59,39 @@ func cp(from source: String, to destination: String) -> Void {
59
59
guard task. terminationStatus == 0 else { exit ( task. terminationStatus) }
60
60
}
61
61
62
+ func ln( from source: String , to destination: String ) -> Void {
63
+ let task = Process ( )
64
+ task. launchPath = " /bin/ln "
65
+ task. arguments = [ " -s " , source, destination]
66
+ task. launch ( )
67
+ task. waitUntilExit ( )
68
+ guard task. terminationStatus == 0 else { exit ( task. terminationStatus) }
69
+ }
70
+
71
+ /// Moves files to trash
72
+ func rm( _ path: String , isDirectory: Bool , isStrict: Bool ) -> Void {
73
+ let url = URL ( fileURLWithPath: path, isDirectory: isDirectory)
74
+ let fileManager = FileManager ( )
75
+ do {
76
+ try fileManager. trashItem ( at: url, resultingItemURL: nil )
77
+ } catch ( let error) {
78
+ if ( isStrict) {
79
+ print ( fileManager. currentDirectoryPath)
80
+ print ( error)
81
+ exit ( 1 )
82
+ }
83
+ }
84
+ }
85
+
86
+ func zip( _ input: String , output: String ) -> Void {
87
+ let task = Process ( )
88
+ task. launchPath = " /usr/bin/zip "
89
+ task. arguments = [ " -r " , " -9 " , " -y " , output, input]
90
+ task. launch ( )
91
+ task. waitUntilExit ( )
92
+ guard task. terminationStatus == 0 else { exit ( task. terminationStatus) }
93
+ }
94
+
62
95
mkdir ( DerivedDataDir)
63
96
mkdir ( BuiltProductsDir)
64
97
@@ -223,34 +256,25 @@ cp(from: "README.md", to: BuiltProductsDir)
223
256
224
257
// copy sample projects
225
258
cp ( from: " samples " , to: BuiltProductsDir)
259
+ cp ( from: " FirebaseUI_dev_auth.podspec " , to: BuiltProductsDir)
260
+ cp ( from: " FirebaseUI_dev_db.podspec " , to: BuiltProductsDir)
261
+ cp ( from: " FirebaseUI_dev_fb.podspec " , to: BuiltProductsDir)
262
+ cp ( from: " FirebaseUI_dev_ggl.podspec " , to: BuiltProductsDir)
263
+ cp ( from: " FirebaseUI_dev_storage.podspec " , to: BuiltProductsDir)
264
+ cp ( from: " FirebaseUI_dev_tw.podspec " , to: BuiltProductsDir)
265
+ rm ( BuiltProductsDir + " samples/objc/Pods " , isDirectory: true , isStrict: false )
266
+ rm ( BuiltProductsDir + " samples/objc/Podfile.lock " , isDirectory: false , isStrict: false )
267
+ rm ( BuiltProductsDir + " samples/objc/GoogleService-Info.plist " , isDirectory: false , isStrict: false )
268
+ rm ( BuiltProductsDir + " samples/swift/Pods " , isDirectory: true , isStrict: false )
269
+ rm ( BuiltProductsDir + " samples/swift/Podfile.lock " , isDirectory: false , isStrict: false )
270
+ rm ( BuiltProductsDir + " samples/swift/GoogleService-Info.plist " , isDirectory: false , isStrict: false )
271
+ ln ( from: " ./objc/FirebaseUIChat.xcworkspace " , to: BuiltProductsDir + " samples/FirebaseUI-demo-objc.xcworkspace " )
272
+ ln ( from: " ./swift/uidemo.xcworkspace " , to: BuiltProductsDir + " samples/FirebaseUI-demo-swift.xcworkspace " )
226
273
227
274
// clean up build artifacts afterward
228
-
229
- /// Moves files to trash
230
- func rm( _ path: String , isDirectory: Bool ) -> Void {
231
- let url = URL ( fileURLWithPath: path, isDirectory: isDirectory)
232
- let fileManager = FileManager ( )
233
- do {
234
- try fileManager. trashItem ( at: url, resultingItemURL: nil )
235
- } catch ( let error) {
236
- print ( fileManager. currentDirectoryPath)
237
- print ( error)
238
- exit ( 1 )
239
- }
240
- }
241
-
242
- func zip( _ input: String , output: String ) -> Void {
243
- let task = Process ( )
244
- task. launchPath = " /usr/bin/zip "
245
- task. arguments = [ " -r " , " -9 " , output, input]
246
- task. launch ( )
247
- task. waitUntilExit ( )
248
- guard task. terminationStatus == 0 else { exit ( task. terminationStatus) }
249
- }
250
-
251
275
zip ( " FirebaseUIFrameworks " , output: " FirebaseUIFrameworks.zip " )
252
276
253
- rm ( DerivedDataDir, isDirectory: true )
254
- rm ( BuiltProductsDir, isDirectory: true )
277
+ rm ( DerivedDataDir, isDirectory: true , isStrict : true )
278
+ rm ( BuiltProductsDir, isDirectory: true , isStrict : true )
255
279
256
280
exit ( 0 )
0 commit comments