Skip to content

Commit 887db45

Browse files
authored
Merge pull request #116 from morganchen12/build
bump podspec version to 0.5.0, update sample project with new changes
2 parents 6ef7be1 + 38f0af9 commit 887db45

File tree

14 files changed

+241
-185
lines changed

14 files changed

+241
-185
lines changed

Diff for: FirebaseUI.podspec

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseUI'
3-
s.version = '0.4.0'
3+
s.version = '0.5.0'
44
s.summary = 'UI binding libraries for Firebase.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
6-
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
6+
s.license = { :type => 'Apache 2.0' }
77
s.author = 'Firebase'
8-
s.source = { :http => 'https://dl.google.com/firebase/firebaseui/ios/0_4_0/FirebaseUIFrameworks.zip' }
8+
s.source = { :http => 'https://dl.google.com/dl/firebase/firebaseui/ios/0_5_0/FirebaseUIFrameworks.zip' }
99
s.platform = :ios
10-
s.ios.deployment_target = '7.0'
10+
s.ios.deployment_target = '8.0'
1111
s.ios.framework = 'UIKit'
1212
s.requires_arc = true
1313
s.default_subspecs = 'All'
14+
s.ios.vendored_frameworks = 'FirebaseUIFrameworks/*/Frameworks/*.framework'
1415

1516
s.subspec 'All' do |all|
1617
all.dependency 'FirebaseUI/Database'

Diff for: FirebaseUI.xcodeproj/project.pbxproj

+42-71
Large diffs are not rendered by default.

Diff for: FirebaseUI/Auth/AuthProviderUI/Facebook/Source/FIRFacebookAuthUI.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
// limitations under the License.
1515
//
1616

17-
#import <Foundation/Foundation.h>
18-
19-
#import "FIRAuthProviderUI.h"
17+
#import "FirebaseAuthUI.h"
2018

2119
NS_ASSUME_NONNULL_BEGIN
2220

Diff for: FirebaseUI/Auth/AuthProviderUI/Facebook/Source/FIRFacebookAuthUI.m

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#import <FirebaseAuth/FIRFacebookAuthProvider.h>
2020
#import <FirebaseAuth/FIRUserInfo.h>
21-
#import "FIRAuthUIErrorUtils.h"
2221
#import <FBSDKCoreKit/FBSDKCoreKit.h>
2322
#import <FBSDKLoginKit/FBSDKLoginKit.h>
2423

Diff for: FirebaseUI/Auth/AuthProviderUI/Google/Source/FIRGoogleAuthUI.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
// limitations under the License.
1515
//
1616

17-
#import <Foundation/Foundation.h>
18-
19-
#import "FIRAuthProviderUI.h"
17+
#import "FirebaseAuthUI.h"
2018

2119
NS_ASSUME_NONNULL_BEGIN
2220

Diff for: FirebaseUI/Auth/AuthProviderUI/Google/Source/FIRGoogleAuthUI.m

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#import <GoogleSignIn/GoogleSignIn.h>
2020
#import <FirebaseAuth/FIRGoogleAuthProvider.h>
2121
#import <FirebaseAuth/FIRUserInfo.h>
22-
#import "FIRAuthUIErrorUtils.h"
2322

2423
/** @var kGoogleGamesScope
2524
@brief The OAuth scope string for the "Games" scope.

Diff for: FirebaseUI/Auth/AuthUI/Source/FIRAuthUIErrorUtils.h

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// limitations under the License.
1515
//
1616

17-
#import <Foundation/Foundation.h>
18-
1917
#import "FIRAuthUIErrors.h"
2018

2119
NS_ASSUME_NONNULL_BEGIN

Diff for: FirebaseUI/Auth/AuthUI/Source/FIRAuthUIErrors.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
// limitations under the License.
1515
//
1616

17-
#import <Foundation/Foundation.h>
17+
@import Foundation;
18+
19+
NS_ASSUME_NONNULL_BEGIN
1820

1921
/** @var FIRAuthUIErrorDomain
2022
@brief The standard Firebase error domain.
@@ -41,3 +43,5 @@ typedef NS_ENUM(NSUInteger, FIRAuthUIErrorCode) {
4143
*/
4244
FIRAuthUIErrorCodeProviderError = 2,
4345
};
46+
47+
NS_ASSUME_NONNULL_END

Diff for: FirebaseUI/Auth/AuthUI/Source/FirebaseAuthUI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
#import "FIRAuthProviderUI.h"
1919
#import "FIRAuthUI.h"
2020
#import "FIRAuthUIBaseViewController.h"
21-
#import "FIRAuthUIErrors.h"
21+
#import "FIRAuthUIErrorUtils.h"

Diff for: build.swift

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
#!/usr/bin/env xcrun swift
2+
3+
// This script builds and lipos static libraries, but doesn't
4+
// bundle assets for any of them.
5+
6+
import Foundation
7+
8+
// TODO: Use NSFileManager instead of all these awful
9+
// manual path appendings and mkdir/mv/cp
10+
11+
let DerivedDataDir = "artifacts/"
12+
let BuiltProductsDir = DerivedDataDir + "FirebaseUIFrameworks/"
13+
14+
// TODO: DRY out these NSTask functions
15+
16+
func mkdir(dirname: String) -> Void {
17+
let task = NSTask()
18+
task.launchPath = "/bin/mkdir"
19+
task.arguments = ["-p", dirname]
20+
task.launch()
21+
task.waitUntilExit()
22+
}
23+
24+
func mv(from source: String, to destination: String) -> Void {
25+
let task = NSTask()
26+
task.launchPath = "/bin/mv"
27+
task.arguments = ["-n", "-v", source, destination]
28+
task.launch()
29+
task.waitUntilExit()
30+
guard task.terminationStatus == 0 else { exit(task.terminationStatus) }
31+
}
32+
33+
mkdir(DerivedDataDir)
34+
mkdir(BuiltProductsDir)
35+
36+
// Build
37+
38+
// TODO: use xcrun to invoke dev tool commands
39+
40+
func buildTask(args args: [String] = []) -> NSTask {
41+
let task = NSTask()
42+
task.launchPath = "/usr/bin/xcodebuild"
43+
task.arguments = args
44+
return task
45+
}
46+
47+
/// A value type representing an xcodebuild call.
48+
/// param keys are parameters and expect leading dashes,
49+
/// i.e. `-workspace`
50+
struct Build {
51+
52+
var params: [String: String]
53+
54+
init(_ params: [String: String]) {
55+
self.params = params
56+
}
57+
58+
var args: [String] {
59+
var params: [String] = []
60+
let keys = self.params.keys
61+
for key in keys {
62+
params.append(key)
63+
// can't remember what this line is supposed to do
64+
let value = self.params[key].flatMap { return $0 }
65+
if let value = value {
66+
params.append(value)
67+
}
68+
}
69+
return params
70+
}
71+
72+
func launch() {
73+
let task = buildTask(args: self.args)
74+
task.launch()
75+
task.waitUntilExit()
76+
guard task.terminationStatus == 0 else {
77+
exit(task.terminationStatus)
78+
}
79+
}
80+
}
81+
82+
let sdks = ["iphoneos", "iphonesimulator"]
83+
let frameworkMapping = [
84+
"Database": "FirebaseDatabaseUI",
85+
"Auth": "FirebaseAuthUI",
86+
"Facebook": "FirebaseFacebookAuthUI",
87+
"Google": "FirebaseGoogleAuthUI",
88+
]
89+
let schemes = Array(frameworkMapping.keys)
90+
print("Schemes: \(schemes)")
91+
92+
// Create folder structure for built products
93+
schemes.forEach { scheme in
94+
let schemeDir = BuiltProductsDir + scheme
95+
mkdir(schemeDir)
96+
mkdir(schemeDir + "/Frameworks")
97+
mkdir(schemeDir + "/Resources")
98+
99+
let frameworkDir = schemeDir + "/Frameworks/"
100+
+ frameworkMapping[scheme]! + ".framework"
101+
mkdir(frameworkDir + "/Modules")
102+
}
103+
104+
// Create xcodebuild tasks from schemes and target sdks
105+
let builds = sdks.flatMap { sdk in
106+
return schemes.map { scheme in
107+
return Build([
108+
"-workspace" : "FirebaseUI.xcworkspace",
109+
"-scheme" : scheme,
110+
"-configuration" : "Release",
111+
"-sdk" : sdk,
112+
"-derivedDataPath": DerivedDataDir
113+
])
114+
}
115+
}
116+
117+
// build everything in release
118+
builds.forEach { build in
119+
build.launch()
120+
121+
let scheme = build.params["-scheme"]!
122+
let sdk = build.params["-sdk"]!
123+
let headerPath = DerivedDataDir + "Build/Products/Release-"
124+
+ sdk + "/usr/local/include"
125+
let framework = frameworkMapping[scheme]! + ".framework"
126+
let destination = BuiltProductsDir + scheme + "/Frameworks/"
127+
+ framework + "/Headers"
128+
129+
// Headers only need to be moved once.
130+
if (sdk == "iphoneos") {
131+
mv(from: headerPath, to: destination)
132+
}
133+
}
134+
135+
// Lipo
136+
137+
/// A value type representing an invocation of `lipo -create`.
138+
struct Lipo {
139+
var inputs: [String]
140+
var output: String
141+
142+
func launch() {
143+
print("lipo \(output)")
144+
let task = NSTask()
145+
task.launchPath = "/usr/bin/lipo"
146+
task.arguments = ["-create"] + self.inputs
147+
+ ["-output"] + [output]
148+
task.launch()
149+
task.waitUntilExit()
150+
guard task.terminationStatus == 0 else {
151+
exit(task.terminationStatus)
152+
}
153+
}
154+
}
155+
156+
let productsPaths = sdks.map {
157+
return DerivedDataDir + "Build/Products/Release-" + $0 + "/"
158+
}
159+
160+
// create lipo tasks from built products
161+
let lipos: [Lipo] = schemes.map { scheme in
162+
let lib = "lib" + scheme + ".a"
163+
let chunks = productsPaths.map { path in
164+
return path + lib
165+
}
166+
167+
let framework = frameworkMapping[scheme]! + ".framework"
168+
let binary = frameworkMapping[scheme]!
169+
170+
let output = "\(BuiltProductsDir)\(scheme)/Frameworks/\(framework)/\(binary)"
171+
return Lipo(inputs: chunks, output: output)
172+
}
173+
174+
// lipo everything
175+
lipos.forEach { $0.launch() }
176+
177+
exit(0)
178+

Diff for: build_database.sh

-88
This file was deleted.

Diff for: samples/swift/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
target 'uidemo' do
22
use_frameworks!
33

4-
pod 'FirebaseUI'
4+
pod 'FirebaseUI', :podspec => '../../FirebaseUI.podspec'
55

66
target 'uidemoTests' do
77
inherit! :search_paths

Diff for: samples/swift/uidemo/AppDelegate.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import UIKit
1818
import Firebase
19-
import FirebaseAuthUI
19+
import FirebaseAuthUI.FIRAuthUI
2020

2121
@UIApplicationMain
2222
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -36,7 +36,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3636

3737
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
3838
let sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey] as! String?
39-
if FIRAuthUI.authUI()?.handleOpenURL(url, sourceApplication: sourceApplication ?? "") ?? false {
39+
if FIRAuthUI.defaultAuthUI()?.handleOpenURL(url, sourceApplication: sourceApplication) ?? false {
4040
return true
4141
}
4242
// other URL handling goes here.

0 commit comments

Comments
 (0)