Skip to content

Commit 4dc9a4a

Browse files
authored
Add SPM ObjC import test (#6191)
1 parent a22ac08 commit 4dc9a4a

File tree

6 files changed

+85
-5
lines changed

6 files changed

+85
-5
lines changed

Package.swift

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ let package = Package(
109109
],
110110
targets: [
111111
.testTarget(
112-
name: "firebase-test",
112+
name: "swift-test",
113113
dependencies: [
114114
"FirebaseAuth",
115115
"FirebaseABTesting",
@@ -136,7 +136,25 @@ let package = Package(
136136
"GoogleUtilities_Reachability",
137137
"GoogleUtilities_UserDefaults",
138138
.product(name: "nanopb", package: "nanopb"),
139-
]
139+
],
140+
path: "SwiftPMTests/swift-test"
141+
),
142+
.testTarget(
143+
name: "objc-import-test",
144+
dependencies: [
145+
"FirebaseAuth",
146+
"FirebaseABTesting",
147+
"FirebaseFunctions",
148+
"Firebase",
149+
"FirebaseCrashlytics",
150+
"FirebaseCore",
151+
"FirebaseDatabase",
152+
"FirebaseFirestore",
153+
"FirebaseInstallations",
154+
"FirebaseRemoteConfig",
155+
"FirebaseStorage",
156+
],
157+
path: "SwiftPMTests/objc-import-test"
140158
),
141159
.target(
142160
name: "GoogleUtilities_AppDelegateSwizzler",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#import "FirebaseABTesting/FirebaseABTesting.h"
16+
#import "FirebaseAuth/FirebaseAuth.h"
17+
//#import "FirebaseFunctions/FirebaseFunctions.h"
18+
#import "Firebase.h"
19+
#import "FirebaseCore/FirebaseCore.h"
20+
#import "FirebaseCrashlytics/FirebaseCrashlytics.h"
21+
#import "FirebaseDatabase/FirebaseDatabase.h"
22+
//#import "FirebaseFirestore/FirebaseFirestore."
23+
#import "FirebaseInstallations/FirebaseInstallations.h"
24+
#import "FirebaseRemoteConfig/FirebaseRemoteConfig.h"
25+
#import "FirebaseStorage/FirebaseStorage.h"
26+
27+
#import <FirebaseABTesting/FirebaseABTesting.h>
28+
#import <FirebaseAuth/FirebaseAuth.h>
29+
//#import <FirebaseFunctions/FirebaseFunctions.h>
30+
#import <Firebase.h>
31+
#import <FirebaseCore/FirebaseCore.h>
32+
#import <FirebaseCrashlytics/FirebaseCrashlytics.h>
33+
#import <FirebaseDatabase/FirebaseDatabase.h>
34+
//#import <FirebaseFirestore/FirebaseFirestore.>
35+
#import <FirebaseInstallations/FirebaseInstallations.h>
36+
#import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
37+
#import <FirebaseStorage/FirebaseStorage.h>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
@import FirebaseAuth;
16+
@import FirebaseABTesting;
17+
@import FirebaseFunctions;
18+
@import Firebase;
19+
@import FirebaseCrashlytics;
20+
@import FirebaseCore;
21+
@import FirebaseDatabase;
22+
@import FirebaseFirestore;
23+
@import FirebaseInstallations;
24+
@import FirebaseRemoteConfig;
25+
@import FirebaseStorage;
File renamed without changes.

scripts/check_imports.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ let skipDirPatterns = ["/Sample/", "/Pods/", "FirebaseStorage/Tests/Integration"
2929
"Example/InstanceID/App", "SymbolCollisionTest/", "/gen/",
3030
"CocoapodsIntegrationTest/"] +
3131
[
32-
"CoreOnly/Sources", // Skip Firebase.h
32+
"CoreOnly/Sources", // Skip Firebase.h.
33+
"SwiftPMTests", // The SwiftPM imports test module imports.
3334
] +
3435

3536
// The following are temporary skips pending working through a first pass of the repo:

scripts/check_no_module_imports.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function exit_with_error {
3030
git grep "${options[@]}" \
3131
-- ':(exclude,glob)**/Example/**' ':(exclude,glob)**/Sample/**' \
3232
':(exclude)FirebaseAuth/Sources/Backend/FIRAuthBackend.m' \
33-
':(exclude)FirebaseABTesting/Sources/Private/FirebaseABTestingInternal.h' \
34-
':(exclude)FirebaseCore/Sources/Private/FirebaseCoreInternal.h' \
3533
':(exclude)FirebaseInstallations/Source/Library/Private/FirebaseInstallationsInternal.h' \
3634
':(exclude,glob)Crashlytics/**' \
3735
':(exclude,glob)FirebaseStorage/**' \
36+
':(exclude,glob)SwiftPMTests/**' \
3837
':(exclude)Functions/FirebaseFunctions/FIRFunctions.m' \
3938
':(exclude)GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h' \
4039
':(exclude)GoogleUtilities/NSData+zlib/Private/GULNSDataInternal.h' \

0 commit comments

Comments
 (0)