Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ version: 2.1

orbs:
# This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs
ios: wordpress-mobile/ios@0.0.13
ios: wordpress-mobile/ios@0.0.23

workflows:
test_and_validate:
jobs:
- ios/test:
name: Test
xcode-version: "10.1.0"
workspace: WordPressAuthenticator.xcworkspace
scheme: WordPressAuthenticator
destination: "platform=iOS Simulator,name=iPhone XS,OS=latest"
device: iPhone XS
ios-version: "12.1"
- ios/validate-podspec:
name: Validate Podspec
xcode-version: "10.1.0"
podspec-path: WordPressAuthenticator.podspec
update-specs-repo: true
15 changes: 6 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
Expand All @@ -28,26 +28,24 @@ GEM
nap (~> 1.0)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-check (1.0.2)
cocoapods (~> 1.0)
cocoapods-core (1.5.3)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-deintegrate (1.0.3)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-repo-update (0.0.4)
cocoapods (~> 1.0, >= 1.3.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.5)
escape (0.0.4)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
Expand All @@ -60,11 +58,11 @@ GEM
nap (1.1.0)
netrc (0.11.0)
rouge (2.0.7)
ruby-macho (1.3.1)
ruby-macho (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.7.0)
xcodeproj (1.8.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -78,7 +76,6 @@ PLATFORMS

DEPENDENCIES
cocoapods (= 1.5.3)!
cocoapods-check!
cocoapods-repo-update!
xcpretty!

Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ target 'WordPressAuthenticator' do
pod '1PasswordExtension', '1.8.5'
pod 'Alamofire', '4.7.3'
pod 'CocoaLumberjack', '3.4.2'
pod 'GoogleSignInRepacked', '4.1.2'
pod 'GoogleSignIn', '4.1.2'
pod 'lottie-ios', '2.5.2'
pod 'NSURL+IDN', '0.3'
pod 'SVProgressHUD', '2.2.5'
Expand Down
23 changes: 18 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ PODS:
- FormatterKit/Resources (1.8.2)
- FormatterKit/TimeIntervalFormatter (1.8.2):
- FormatterKit/Resources
- GoogleSignInRepacked (4.1.2):
- GoogleSignIn (4.1.2):
- "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
- "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
- GTMOAuth2 (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- GoogleToolboxForMac/DebugUtils (2.2.0):
- GoogleToolboxForMac/Defines (= 2.2.0)
- GoogleToolboxForMac/Defines (2.2.0)
Expand All @@ -23,6 +25,13 @@ PODS:
- "GoogleToolboxForMac/NSString+URLArguments (= 2.2.0)"
- "GoogleToolboxForMac/NSString+URLArguments (2.2.0)"
- Gridicons (0.18)
- GTMOAuth2 (1.1.6):
- GTMSessionFetcher (~> 1.1)
- GTMSessionFetcher (1.2.1):
- GTMSessionFetcher/Full (= 1.2.1)
- GTMSessionFetcher/Core (1.2.1)
- GTMSessionFetcher/Full (1.2.1):
- GTMSessionFetcher/Core (= 1.2.1)
- lottie-ios (2.5.2)
- NSObject-SafeExpectations (0.0.3)
- "NSURL+IDN (0.3)"
Expand Down Expand Up @@ -63,7 +72,7 @@ DEPENDENCIES:
- Alamofire (= 4.7.3)
- CocoaLumberjack (= 3.4.2)
- Expecta (= 1.0.6)
- GoogleSignInRepacked (= 4.1.2)
- GoogleSignIn (= 4.1.2)
- Gridicons (~> 0.15)
- lottie-ios (= 2.5.2)
- "NSURL+IDN (= 0.3)"
Expand All @@ -83,9 +92,11 @@ SPEC REPOS:
- CocoaLumberjack
- Expecta
- FormatterKit
- GoogleSignInRepacked
- GoogleSignIn
- GoogleToolboxForMac
- Gridicons
- GTMOAuth2
- GTMSessionFetcher
- lottie-ios
- NSObject-SafeExpectations
- "NSURL+IDN"
Expand All @@ -105,9 +116,11 @@ SPEC CHECKSUMS:
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
FormatterKit: 4b8f29acc9b872d5d12a63efb560661e8f2e1b98
GoogleSignInRepacked: d357702618c555f38923576924661325eb1ef22b
GoogleSignIn: d9ef55b10f0aa401a5de2747f59b725e4b9732ac
GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
Gridicons: 04261236382e9c62c62c9a104f2f532c1bdf6a78
GTMOAuth2: e8b6512c896235149df975c41d9a36c868ab7fba
GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
lottie-ios: 3fef45d3fabe63e3c7c2eb603dd64ddfffc73062
NSObject-SafeExpectations: b989b68a8a9b7b9f2b264a8b52ba9d7aab8f3129
"NSURL+IDN": 82355a0afd532fe1de08f6417c134b49b1a1c4b3
Expand All @@ -121,6 +134,6 @@ SPEC CHECKSUMS:
WordPressUI: 44fe43a9c5c504dfd534286e39e1ce6ebcd69ff5
wpxmlrpc: 6ba55c773cfa27083ae4a2173e69b19f46da98e2

PODFILE CHECKSUM: 220853b585b7b73f8958c30e6f9c1c5760d4c7a3
PODFILE CHECKSUM: 81ee24d3e673c260c315ab899b9129f9ef5ba1c9

COCOAPODS: 1.5.3
13 changes: 11 additions & 2 deletions WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git", :tag => s.version.to_s }
s.source_files = 'WordPressAuthenticator/**/*.{h,m,swift}'
s.private_header_files = "WordPressAuthenticator/Private/*.h"
s.resources = [ 'WordPressAuthenticator/**/*.{xcassets,storyboard,xib,json}' ]
s.resource_bundles = {
'WordPressAuthenticatorResources': [
'WordPressAuthenticator/Resources/Assets.xcassets',
'WordPressAuthenticator/Resources/Animations/*.json'
]
}
s.resources = [
'WordPressAuthenticator/**/*.{storyboard,xib}'
]
s.requires_arc = true
s.static_framework = true # This is needed because GoogleSignIn vendors a static framework
s.header_dir = 'WordPressAuthenticator'

s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
Expand All @@ -32,7 +41,7 @@ Pod::Spec.new do |s|
s.dependency 'SVProgressHUD', '2.2.5'

s.dependency 'Gridicons', '~> 0.15'
s.dependency 'GoogleSignInRepacked', '4.1.2'
s.dependency 'GoogleSignIn', '4.1.2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably update this too since this is an old version but better to do one thing at a time 😄

s.dependency 'WordPressUI', '~> 1.0'
s.dependency 'WordPressKit', '~> 3.1'
s.dependency 'WordPressShared', '~> 1.4'
Expand Down
10 changes: 6 additions & 4 deletions WordPressAuthenticator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-WordPressAuthenticatorTests/Pods-WordPressAuthenticatorTests-resources.sh",
"${PODS_ROOT}/GoogleSignInRepacked/Resources/GoogleSignIn.bundle",
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
Expand All @@ -708,7 +708,7 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-WordPressAuthenticator/Pods-WordPressAuthenticator-resources.sh",
"${PODS_ROOT}/GoogleSignInRepacked/Resources/GoogleSignIn.bundle",
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand Down Expand Up @@ -770,7 +770,8 @@
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework",
"${BUILT_PRODUCTS_DIR}/FormatterKit/FormatterKit.framework",
"${PODS_ROOT}/GoogleSignInRepacked/Frameworks/GoogleSignIn.framework",
"${BUILT_PRODUCTS_DIR}/GTMOAuth2/GTMOAuth2.framework",
"${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework",
"${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",
"${BUILT_PRODUCTS_DIR}/Gridicons/Gridicons.framework",
"${BUILT_PRODUCTS_DIR}/NSObject-SafeExpectations/NSObject_SafeExpectations.framework",
Expand All @@ -793,7 +794,8 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FormatterKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleSignIn.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMOAuth2.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Gridicons.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NSObject_SafeExpectations.framework",
Expand Down
29 changes: 20 additions & 9 deletions WordPressAuthenticator/Authenticator/WordPressAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import WordPressUI
trackOpenedLogin()
}

let storyboard = UIStoryboard(name: "Login", bundle: bundle)
let storyboard = UIStoryboard(name: "Login", bundle: mainBundle)
if let controller = storyboard.instantiateInitialViewController() {
if let childController = controller.children.first as? LoginPrologueViewController {
childController.loginFields.restrictToWPCom = restrictToWPCom
Expand All @@ -149,7 +149,7 @@ import WordPressUI
trackOpenedLogin()
}

let storyboard = UIStoryboard(name: "Login", bundle: bundle)
let storyboard = UIStoryboard(name: "Login", bundle: mainBundle)
guard let controller = storyboard.instantiateViewController(withIdentifier: "emailEntry") as? LoginEmailViewController else {
return
}
Expand Down Expand Up @@ -183,7 +183,7 @@ import WordPressUI
/// Returns an instance of LoginSiteAddressViewController: allows the user to log into a WordPress.org website.
///
@objc public class func signinForWPOrg() -> UIViewController {
let storyboard = UIStoryboard(name: "Login", bundle: bundle)
let storyboard = UIStoryboard(name: "Login", bundle: mainBundle)
guard let controller = storyboard.instantiateViewController(withIdentifier: "siteAddress") as? LoginSiteAddressViewController else {
fatalError("unable to create wpcom password screen")
}
Expand All @@ -199,7 +199,7 @@ import WordPressUI
loginFields.emailAddress = dotcomEmailAddress ?? String()
loginFields.username = dotcomUsername ?? String()

let storyboard = UIStoryboard(name: "Login", bundle: bundle)
let storyboard = UIStoryboard(name: "Login", bundle: mainBundle)
guard let controller = storyboard.instantiateViewController(withIdentifier: "LoginWPcomPassword") as? LoginWPComViewController else {
fatalError("unable to create wpcom password screen")
}
Expand All @@ -215,7 +215,7 @@ import WordPressUI
/// it's features.
///
public class func signinForWPCom() -> LoginEmailViewController {
let storyboard = UIStoryboard(name: "Login", bundle: bundle)
let storyboard = UIStoryboard(name: "Login", bundle: mainBundle)
guard let controller = storyboard.instantiateViewController(withIdentifier: "emailEntry") as? LoginEmailViewController else {
fatalError()
}
Expand Down Expand Up @@ -256,7 +256,7 @@ import WordPressUI
return false
}

let storyboard = UIStoryboard(name: "EmailMagicLink", bundle: bundle)
let storyboard = UIStoryboard(name: "EmailMagicLink", bundle: mainBundle)
guard let loginController = storyboard.instantiateViewController(withIdentifier: "LinkAuthView") as? NUXLinkAuthViewController else {
DDLogInfo("App opened with authentication link but couldn't create login screen.")
return false
Expand Down Expand Up @@ -416,12 +416,23 @@ import WordPressUI
UIApplication.shared.open(forgotPasswordURL)
}

/// Returns the WordPressAuthenticator Bundle
/// Returns the WordPressAuthenticator main bundle
///
class var bundle: Bundle {
class var mainBundle: Bundle {
return Bundle(for: WordPressAuthenticator.self)
}


/// Returns the WordPressAuthenticatorResouces.bundle
///
class var resourcesBundle: Bundle {
// If installed with CocoaPods, resources will be in WordPressAuthenticatorResources.bundle
if let bundleURL = mainBundle.resourceURL,
let resourceBundle = Bundle(url: bundleURL.appendingPathComponent("WordPressAuthenticatorResources.bundle")) {
return resourceBundle
}
// Otherwise, the main bundle is used for resources
return mainBundle
}

// MARK: - 1Password Helper

Expand Down
2 changes: 1 addition & 1 deletion WordPressAuthenticator/Extensions/UIImage+Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ extension UIImage {
/// Returns WordPressAuthenticator's Bundle
///
private static var bundle: Bundle {
return Bundle(for: WordPressAuthenticator.self)
return WordPressAuthenticator.resourcesBundle
}
}
8 changes: 4 additions & 4 deletions WordPressAuthenticator/NUX/NUXButtonView.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--Button View Controller-->
<scene sceneID="Mo4-UQ-zlD">
<objects>
<viewController storyboardIdentifier="ButtonView" id="aOG-7h-6d9" customClass="NUXButtonViewController" customModule="WordPress" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="ButtonView" id="aOG-7h-6d9" customClass="NUXButtonViewController" customModule="WordPressAuthenticator" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="d2l-kB-WtE">
<rect key="frame" x="0.0" y="0.0" width="375" height="148"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -27,7 +27,7 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="xzf-f5-7zQ" userLabel="Button Stack View">
<rect key="frame" x="20" y="20" width="335" height="103"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="knN-O6-M86" customClass="NUXButton" customModule="WordPress" customModuleProvider="target">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="knN-O6-M86" customClass="NUXButton" customModule="WordPressAuthenticator" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="335" height="50"/>
<accessibility key="accessibilityConfiguration" identifier="connectSite"/>
<constraints>
Expand All @@ -41,7 +41,7 @@
<action selector="secondaryButtonPressed:" destination="aOG-7h-6d9" eventType="touchUpInside" id="UXk-DD-td0"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M7J-a3-klP" customClass="NUXButton" customModule="WordPress" customModuleProvider="target">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M7J-a3-klP" customClass="NUXButton" customModule="WordPressAuthenticator" customModuleProvider="target">
<rect key="frame" x="0.0" y="70" width="335" height="33"/>
<accessibility key="accessibilityConfiguration" identifier="continueToSites"/>
<constraints>
Expand All @@ -59,7 +59,7 @@
<action selector="primaryButtonPressed:" destination="aOG-7h-6d9" eventType="touchUpInside" id="W8M-wW-PhN"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uAF-kU-f7P" customClass="NUXButton" customModule="WordPress" customModuleProvider="target">
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uAF-kU-f7P" customClass="NUXButton" customModule="WordPressAuthenticator" customModuleProvider="target">
<rect key="frame" x="0.0" y="103" width="335" height="50"/>
<accessibility key="accessibilityConfiguration" identifier="continueToSites"/>
<constraints>
Expand Down
2 changes: 1 addition & 1 deletion WordPressAuthenticator/NUX/NUXButtonViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ extension NUXButtonViewController {
/// Returns a new NUXButtonViewController Instance
///
public class func instance() -> NUXButtonViewController {
let storyboard = UIStoryboard(name: "NUXButtonView", bundle: Bundle(for: self))
let storyboard = UIStoryboard(name: "NUXButtonView", bundle: WordPressAuthenticator.mainBundle)
guard let buttonViewController = storyboard.instantiateViewController(withIdentifier: "ButtonView") as? NUXButtonViewController else {
fatalError()
}
Expand Down
Loading