refactor(shorebird_cli): copy ShorebirdArtifactMixin methods for ios-framework to ArtifactManager (#2012)
This commit is contained in:
@@ -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',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user