Skip to content

Commit a608663

Browse files
authored
Add AppDistribution to SwiftPM. (#7045)
* Add AppDistribution to SwiftPM. Tests aren't ported yet due to an import OCMock issue. * Embed public headers in correct directory * Fix podspec * Fixed new header imports. * Add beta designation to SwiftPM name. * Enable testing for AppDistro in SwiftPM * Style * Style * Added changelog * Add unit test scheme.
1 parent 6fffc81 commit a608663

File tree

19 files changed

+157
-6
lines changed

19 files changed

+157
-6
lines changed

.github/workflows/appdistribution.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ jobs:
2929
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
3030
--platforms=${{ matrix.target }}
3131
32+
spm:
33+
# Don't run on private repo unless it is a PR.
34+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
35+
36+
runs-on: macOS-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Xcode 12
40+
run: sudo xcode-select -s /Applications/Xcode_12.app/Contents/Developer
41+
- name: Initialize xcodebuild
42+
run: xcodebuild -list
43+
- name: iOS Unit Tests
44+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh AppDistributionUnit iOS spm
45+
3246
appdistribution-cron-only:
3347
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
3448

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1220"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "AppDistributionUnit"
20+
BuildableName = "AppDistributionUnit"
21+
BlueprintName = "AppDistributionUnit"
22+
ReferencedContainer = "container:">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>

FirebaseAppDistribution.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ iOS SDK for App Distribution for Firebase.
2727
'FirebaseInstallations/Source/Library/Private/*.h',
2828
'GoogleDataTransport/GDTCORLibrary/Internal/*.h',
2929
]
30-
s.public_header_files = base_dir + 'Public/*.h'
30+
s.public_header_files = base_dir + 'Public/FirebaseAppDistribution/*.h'
3131

3232
s.dependency 'FirebaseCore', '~> 7.0'
3333
s.dependency 'GoogleUtilities/AppDelegateSwizzler', '~> 7.0'

FirebaseAppDistribution/Sources/FIRAppDistributionUIService.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#import "FirebaseAppDistribution/Sources/FIRAppDistributionUIService.h"
1616
#import "FirebaseAppDistribution/Sources/FIRFADLogger.h"
17-
#import "FirebaseAppDistribution/Sources/Public/FIRAppDistribution.h"
17+
#import "FirebaseAppDistribution/Sources/Public/FirebaseAppDistribution/FIRAppDistribution.h"
1818
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
1919

2020
#import <AuthenticationServices/AuthenticationServices.h>

FirebaseAppDistribution/Sources/Private/FIRAppDistribution.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
#import "FirebaseAppDistribution/Sources/FIRAppDistributionUIService.h"
16-
#import "FirebaseAppDistribution/Sources/Public/FIRAppDistribution.h"
16+
#import "FirebaseAppDistribution/Sources/Public/FirebaseAppDistribution/FIRAppDistribution.h"
1717

1818
NS_ASSUME_NONNULL_BEGIN
1919

FirebaseAppDistribution/Sources/Private/FIRAppDistributionRelease.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#import "FirebaseAppDistribution/Sources/Public/FIRAppDistributionRelease.h"
15+
#import "FirebaseAppDistribution/Sources/Public/FirebaseAppDistribution/FIRAppDistributionRelease.h"
1616

1717
NS_ASSUME_NONNULL_BEGIN
1818

FirebaseAppDistribution/Tests/Unit/FIRAppDistributionMachOTests.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ @implementation FIRAppDistributionMachOTests
2525

2626
- (NSString*)resourcePath:(NSString*)path {
2727
NSBundle* bundle = [NSBundle bundleForClass:[self class]];
28+
29+
// Swift Package Manager uses a different bundle structure for resources, so explicitly get the
30+
// nested bundle. In Swift we could have used `Bundle.module` to access it, but that isn't
31+
// surfaced in ObjC.
32+
#if SWIFT_PACKAGE
33+
NSString* nestedBundlePath = [bundle pathForResource:@"Firebase_AppDistributionUnit"
34+
ofType:@"bundle"];
35+
bundle = [NSBundle bundleWithPath:nestedBundlePath];
36+
#endif // SWIFT_PACKAGE
37+
2838
NSString* resourcePath = [bundle resourcePath];
2939

3040
return [resourcePath stringByAppendingPathComponent:path];

0 commit comments

Comments
 (0)