diff --git a/packages/shorebird_cli/lib/src/artifact_manager.dart b/packages/shorebird_cli/lib/src/artifact_manager.dart index 89dad782..f5fb7d89 100644 --- a/packages/shorebird_cli/lib/src/artifact_manager.dart +++ b/packages/shorebird_cli/lib/src/artifact_manager.dart @@ -260,4 +260,29 @@ Failed to create diff (exit code ${result.exitCode}). return ipaFiles.single; } + + static const String appXcframeworkName = 'App.xcframework'; + + /// Returns the path to the App.xcframework generated by + /// `shorebird release ios-framework` or + /// `shorebird patch ios-framework`. + String getAppXcframeworkPath() { + return p.join(getAppXcframeworkDirectory().path, appXcframeworkName); + } + + /// Returns the [Directory] containing the App.xcframework generated by + /// `shorebird release ios-framework` or + /// `shorebird patch ios-framework`. + Directory getAppXcframeworkDirectory() { + final projectRoot = shorebirdEnv.getShorebirdProjectRoot()!; + return Directory( + p.join( + projectRoot.path, + 'build', + 'ios', + 'framework', + 'Release', + ), + ); + } } diff --git a/packages/shorebird_cli/test/src/artifact_manager_test.dart b/packages/shorebird_cli/test/src/artifact_manager_test.dart index 7ed2c753..d7e4b0b0 100644 --- a/packages/shorebird_cli/test/src/artifact_manager_test.dart +++ b/packages/shorebird_cli/test/src/artifact_manager_test.dart @@ -559,5 +559,40 @@ void main() { }); }); }); + + group('getAppXcframeworkPath', () { + test('returns path to App.xcframework', () { + expect( + runWithOverrides(artifactManager.getAppXcframeworkPath), + equals( + p.join( + projectRoot.path, + 'build', + 'ios', + 'framework', + 'Release', + ArtifactManager.appXcframeworkName, + ), + ), + ); + }); + }); + + group('getAppXcframeworkDirectory', () { + test('returns directory containing App.xcframework', () { + expect( + runWithOverrides(artifactManager.getAppXcframeworkDirectory).path, + equals( + p.join( + projectRoot.path, + 'build', + 'ios', + 'framework', + 'Release', + ), + ), + ); + }); + }); }); }