Skip to content

Commit 45d2569

Browse files
committed
Fixes ios macos native unit tests
1 parent b465459 commit 45d2569

27 files changed

Lines changed: 96 additions & 220 deletions

auth0_flutter/darwin/auth0_flutter/Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ let package = Package(
88
.macOS("11.0"),
99
],
1010
products: [
11-
.library(name: "auth0_flutter", targets: ["auth0_flutter"]),
11+
.library(name: "auth0-flutter", targets: ["auth0_flutter"]),
1212
],
1313
dependencies: [
1414
.package(url: "https://github.com/auth0/Auth0.swift", exact: "2.18.0"),
1515
.package(url: "https://github.com/auth0/JWTDecode.swift", exact: "3.3.0"),
1616
.package(url: "https://github.com/auth0/SimpleKeychain", exact: "1.3.0"),
17+
.package(name: "FlutterFramework", path: "../FlutterFramework"),
1718
],
1819
targets: [
1920
.target(
@@ -22,6 +23,7 @@ let package = Package(
2223
.product(name: "Auth0", package: "Auth0.swift"),
2324
.product(name: "JWTDecode", package: "JWTDecode.swift"),
2425
.product(name: "SimpleKeychain", package: "SimpleKeychain"),
26+
.product(name: "FlutterFramework", package: "FlutterFramework"),
2527
],
2628
path: "Sources/auth0_flutter"
2729
),

auth0_flutter/example/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.3.0" apply false
21+
id "com.android.application" version "8.6.0" apply false
2222
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
2323
}
2424

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
21
#include "Generated.xcconfig"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
21
#include "Generated.xcconfig"

auth0_flutter/example/ios/Podfile

Lines changed: 0 additions & 49 deletions
This file was deleted.

auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
2D82163828F9A89300467FD1 /* AuthAPILoginWithOTPMethodHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D82163728F9A89300467FD1 /* AuthAPILoginWithOTPMethodHandlerTests.swift */; };
12+
A1B2C3D42AECB46A00862998 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = A1B2C3D32AECB46A00862998 /* FlutterGeneratedPluginSwiftPackage */; };
1213
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1314
5C08DBC8288A7646000D2F37 /* CredentialsManagerExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C08DBC7288A7646000D2F37 /* CredentialsManagerExtensionsTests.swift */; };
1415
5C328B4827F7822600451E70 /* WebAuthHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C328B4727F7822600451E70 /* WebAuthHandlerTests.swift */; };
@@ -121,13 +122,17 @@
121122
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
122123
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
123124
A09B2E3F1D4C7891BA000001 /* CredentialsManagerSSOCredentialsMethodHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsManagerSSOCredentialsMethodHandlerTests.swift; sourceTree = "<group>"; };
125+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
126+
784666492D4C4C64000A1A5F /* FlutterFramework */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterFramework; path = Flutter/ephemeral/Packages/.packages/FlutterFramework; sourceTree = "<group>"; };
127+
78DABEA22ED26510000E7860 /* auth0_flutter */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = auth0_flutter; path = ../../darwin/auth0_flutter; sourceTree = "<group>"; };
124128
/* End PBXFileReference section */
125129

126130
/* Begin PBXFrameworksBuildPhase section */
127131
5C328B4227F7822600451E70 /* Frameworks */ = {
128132
isa = PBXFrameworksBuildPhase;
129133
buildActionMask = 2147483647;
130134
files = (
135+
A1B2C3D42AECB46A00862998 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
131136
);
132137
runOnlyForDeploymentPostprocessing = 0;
133138
};
@@ -219,6 +224,9 @@
219224
9740EEB11CF90186004384FC /* Flutter */ = {
220225
isa = PBXGroup;
221226
children = (
227+
78DABEA22ED26510000E7860 /* auth0_flutter */,
228+
784666492D4C4C64000A1A5F /* FlutterFramework */,
229+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
222230
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
223231
9740EEB21CF90195004384FC /* Debug.xcconfig */,
224232
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -281,6 +289,9 @@
281289
5C328B4A27F7822600451E70 /* PBXTargetDependency */,
282290
);
283291
name = RunnerTests;
292+
packageProductDependencies = (
293+
A1B2C3D32AECB46A00862998 /* FlutterGeneratedPluginSwiftPackage */,
294+
);
284295
productName = Tests;
285296
productReference = 5C328B4527F7822600451E70 /* RunnerTests.xctest */;
286297
productType = "com.apple.product-type.bundle.unit-test";
@@ -621,7 +632,6 @@
621632
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
622633
SWIFT_VERSION = 5.0;
623634
TARGETED_DEVICE_FAMILY = "1,2";
624-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
625635
};
626636
name = Debug;
627637
};
@@ -648,7 +658,6 @@
648658
SWIFT_EMIT_LOC_STRINGS = NO;
649659
SWIFT_VERSION = 5.0;
650660
TARGETED_DEVICE_FAMILY = "1,2";
651-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
652661
};
653662
name = Release;
654663
};
@@ -675,7 +684,6 @@
675684
SWIFT_EMIT_LOC_STRINGS = NO;
676685
SWIFT_VERSION = 5.0;
677686
TARGETED_DEVICE_FAMILY = "1,2";
678-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
679687
};
680688
name = Profile;
681689
};
@@ -971,6 +979,10 @@
971979
isa = XCSwiftPackageProductDependency;
972980
productName = FlutterGeneratedPluginSwiftPackage;
973981
};
982+
A1B2C3D32AECB46A00862998 /* FlutterGeneratedPluginSwiftPackage */ = {
983+
isa = XCSwiftPackageProductDependency;
984+
productName = FlutterGeneratedPluginSwiftPackage;
985+
};
974986
/* End XCSwiftPackageProductDependency section */
975987
};
976988
rootObject = 97C146E61CF9000F007C117D /* Project object */;

auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth0_flutter/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import UIKit
22
import Flutter
3-
import Auth0
43

54
@main
65
@objc class AppDelegate: FlutterAppDelegate {
@@ -15,12 +14,4 @@ import Auth0
1514
}
1615
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1716
}
18-
19-
override func application(
20-
_ application: UIApplication,
21-
open url: URL,
22-
options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
23-
WebAuthentication.resume(with: url)
24-
return super.application(application, open: url, options: options);
25-
}
2617
}

auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import XCTest
22
import Auth0
33

4+
#if os(iOS)
5+
import Flutter
6+
#else
7+
import FlutterMacOS
8+
#endif
9+
410
@testable import auth0_flutter
511

612
class AuthAPIExtensionsTests: XCTestCase {

0 commit comments

Comments
 (0)