Adopt Flutter.xcframework in tool (#71495)
This commit is contained in:
@@ -42,9 +42,67 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('getArtifactPath', () {
|
||||
final String xcframeworkPath = artifacts.getArtifactPath(
|
||||
Artifact.flutterXcframework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterFramework, platform: TargetPlatform.ios, mode: BuildMode.release),
|
||||
fileSystem.path.join('root', 'bin', 'cache', 'artifacts', 'engine', 'ios-release', 'Flutter.framework'),
|
||||
xcframeworkPath,
|
||||
fileSystem.path.join(
|
||||
'root',
|
||||
'bin',
|
||||
'cache',
|
||||
'artifacts',
|
||||
'engine',
|
||||
'ios-release',
|
||||
'Flutter.xcframework',
|
||||
),
|
||||
);
|
||||
expect(
|
||||
() => artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator,
|
||||
),
|
||||
throwsToolExit(
|
||||
message:
|
||||
'No xcframework found at $xcframeworkPath. Try running "flutter build ios".'),
|
||||
);
|
||||
fileSystem.directory(xcframeworkPath).createSync(recursive: true);
|
||||
expect(
|
||||
() => artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator,
|
||||
),
|
||||
throwsToolExit(message: 'No iOS frameworks found in $xcframeworkPath'),
|
||||
);
|
||||
|
||||
fileSystem
|
||||
.directory(xcframeworkPath)
|
||||
.childDirectory('ios-x86_64-simulator')
|
||||
.childDirectory('Flutter.framework')
|
||||
.createSync(recursive: true);
|
||||
fileSystem
|
||||
.directory(xcframeworkPath)
|
||||
.childDirectory('ios-armv7_arm64')
|
||||
.childDirectory('Flutter.framework')
|
||||
.createSync(recursive: true);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator),
|
||||
fileSystem.path
|
||||
.join(xcframeworkPath, 'ios-x86_64-simulator', 'Flutter.framework'),
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios, mode: BuildMode.release, environmentType: EnvironmentType.physical),
|
||||
fileSystem.path.join(xcframeworkPath, 'ios-armv7_arm64', 'Flutter.framework'),
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterXcframework, platform: TargetPlatform.ios, mode: BuildMode.release),
|
||||
@@ -136,13 +194,78 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('getArtifactPath', () {
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterFramework, platform: TargetPlatform.ios, mode: BuildMode.release),
|
||||
fileSystem.path.join('/out', 'android_debug_unopt', 'Flutter.framework'),
|
||||
final String xcframeworkPath = artifacts.getArtifactPath(
|
||||
Artifact.flutterXcframework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterXcframework, platform: TargetPlatform.ios, mode: BuildMode.release),
|
||||
fileSystem.path.join('/out', 'android_debug_unopt', 'Flutter.xcframework'),
|
||||
xcframeworkPath,
|
||||
fileSystem.path
|
||||
.join('/out', 'android_debug_unopt', 'Flutter.xcframework'),
|
||||
);
|
||||
expect(
|
||||
() => artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator,
|
||||
),
|
||||
throwsToolExit(
|
||||
message:
|
||||
'No xcframework found at /out/android_debug_unopt/Flutter.xcframework. Try running "flutter build ios".'),
|
||||
);
|
||||
fileSystem.directory(xcframeworkPath).createSync(recursive: true);
|
||||
expect(
|
||||
() => artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator,
|
||||
),
|
||||
throwsToolExit(
|
||||
message:
|
||||
'No iOS frameworks found in /out/android_debug_unopt/Flutter.xcframework'),
|
||||
);
|
||||
|
||||
fileSystem
|
||||
.directory(xcframeworkPath)
|
||||
.childDirectory('ios-x86_64-simulator')
|
||||
.childDirectory('Flutter.framework')
|
||||
.createSync(recursive: true);
|
||||
fileSystem
|
||||
.directory(xcframeworkPath)
|
||||
.childDirectory('ios-armv7_arm64')
|
||||
.childDirectory('Flutter.framework')
|
||||
.createSync(recursive: true);
|
||||
expect(
|
||||
artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.simulator,
|
||||
),
|
||||
fileSystem.path
|
||||
.join(xcframeworkPath, 'ios-x86_64-simulator', 'Flutter.framework'),
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
environmentType: EnvironmentType.physical,
|
||||
),
|
||||
fileSystem.path
|
||||
.join(xcframeworkPath, 'ios-armv7_arm64', 'Flutter.framework'),
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(
|
||||
Artifact.flutterXcframework,
|
||||
platform: TargetPlatform.ios,
|
||||
mode: BuildMode.release,
|
||||
),
|
||||
fileSystem.path
|
||||
.join('/out', 'android_debug_unopt', 'Flutter.xcframework'),
|
||||
);
|
||||
expect(
|
||||
artifacts.getArtifactPath(Artifact.flutterTester),
|
||||
|
||||
Reference in New Issue
Block a user