|
|
|
|
@@ -18,6 +18,7 @@ enum Artifact {
|
|
|
|
|
/// The flutter tester binary.
|
|
|
|
|
flutterTester,
|
|
|
|
|
flutterFramework,
|
|
|
|
|
flutterXcframework,
|
|
|
|
|
/// The framework directory of the macOS desktop.
|
|
|
|
|
flutterMacOSFramework,
|
|
|
|
|
vmSnapshotData,
|
|
|
|
|
@@ -94,6 +95,8 @@ String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMo
|
|
|
|
|
return 'flutter_tester$exe';
|
|
|
|
|
case Artifact.flutterFramework:
|
|
|
|
|
return 'Flutter.framework';
|
|
|
|
|
case Artifact.flutterXcframework:
|
|
|
|
|
return 'Flutter.xcframework';
|
|
|
|
|
case Artifact.flutterMacOSFramework:
|
|
|
|
|
return 'FlutterMacOS.framework';
|
|
|
|
|
case Artifact.vmSnapshotData:
|
|
|
|
|
@@ -208,8 +211,13 @@ abstract class Artifacts {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Returns the requested [artifact] for the [platform] and [mode] combination.
|
|
|
|
|
String getArtifactPath(Artifact artifact, { TargetPlatform platform, BuildMode mode });
|
|
|
|
|
/// Returns the requested [artifact] for the [platform], [mode], and [environmentType] combination.
|
|
|
|
|
String getArtifactPath(
|
|
|
|
|
Artifact artifact, {
|
|
|
|
|
TargetPlatform platform,
|
|
|
|
|
BuildMode mode,
|
|
|
|
|
EnvironmentType environmentType,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Returns which set of engine artifacts is currently used for the [platform]
|
|
|
|
|
// and [mode] combination.
|
|
|
|
|
@@ -235,7 +243,12 @@ class CachedArtifacts implements Artifacts {
|
|
|
|
|
final Cache _cache;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String getArtifactPath(Artifact artifact, { TargetPlatform platform, BuildMode mode }) {
|
|
|
|
|
String getArtifactPath(
|
|
|
|
|
Artifact artifact, {
|
|
|
|
|
TargetPlatform platform,
|
|
|
|
|
BuildMode mode,
|
|
|
|
|
EnvironmentType environmentType,
|
|
|
|
|
}) {
|
|
|
|
|
switch (platform) {
|
|
|
|
|
case TargetPlatform.android_arm:
|
|
|
|
|
case TargetPlatform.android_arm64:
|
|
|
|
|
@@ -243,7 +256,7 @@ class CachedArtifacts implements Artifacts {
|
|
|
|
|
case TargetPlatform.android_x86:
|
|
|
|
|
return _getAndroidArtifactPath(artifact, platform, mode);
|
|
|
|
|
case TargetPlatform.ios:
|
|
|
|
|
return _getIosArtifactPath(artifact, platform, mode);
|
|
|
|
|
return _getIosArtifactPath(artifact, platform, mode, environmentType);
|
|
|
|
|
case TargetPlatform.darwin_x64:
|
|
|
|
|
case TargetPlatform.linux_x64:
|
|
|
|
|
case TargetPlatform.windows_x64:
|
|
|
|
|
@@ -288,10 +301,12 @@ class CachedArtifacts implements Artifacts {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String _getIosArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) {
|
|
|
|
|
String _getIosArtifactPath(Artifact artifact, TargetPlatform platform,
|
|
|
|
|
BuildMode mode, EnvironmentType environmentType) {
|
|
|
|
|
switch (artifact) {
|
|
|
|
|
case Artifact.genSnapshot:
|
|
|
|
|
case Artifact.flutterFramework:
|
|
|
|
|
case Artifact.flutterXcframework:
|
|
|
|
|
case Artifact.frontendServerSnapshotForEngineDartSdk:
|
|
|
|
|
final String artifactFileName = _artifactToFileName(artifact);
|
|
|
|
|
final String engineDir = _getEngineArtifactsPath(platform, mode);
|
|
|
|
|
@@ -534,7 +549,12 @@ class LocalEngineArtifacts implements Artifacts {
|
|
|
|
|
final Platform _platform;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String getArtifactPath(Artifact artifact, { TargetPlatform platform, BuildMode mode }) {
|
|
|
|
|
String getArtifactPath(
|
|
|
|
|
Artifact artifact, {
|
|
|
|
|
TargetPlatform platform,
|
|
|
|
|
BuildMode mode,
|
|
|
|
|
EnvironmentType environmentType,
|
|
|
|
|
}) {
|
|
|
|
|
platform ??= _currentHostPlatform(_platform);
|
|
|
|
|
final bool isDirectoryArtifact = artifact == Artifact.flutterWebSdk || artifact == Artifact.flutterPatchedSdkPath;
|
|
|
|
|
final String artifactFileName = isDirectoryArtifact ? null : _artifactToFileName(artifact, platform, mode);
|
|
|
|
|
@@ -547,6 +567,8 @@ class LocalEngineArtifacts implements Artifacts {
|
|
|
|
|
case Artifact.vmSnapshotData:
|
|
|
|
|
return _fileSystem.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', artifactFileName);
|
|
|
|
|
case Artifact.icuData:
|
|
|
|
|
case Artifact.flutterXcframework:
|
|
|
|
|
case Artifact.flutterMacOSFramework:
|
|
|
|
|
return _fileSystem.path.join(engineOutPath, artifactFileName);
|
|
|
|
|
case Artifact.platformKernelDill:
|
|
|
|
|
if (platform == TargetPlatform.fuchsia_x64 || platform == TargetPlatform.fuchsia_arm64) {
|
|
|
|
|
@@ -557,8 +579,6 @@ class LocalEngineArtifacts implements Artifacts {
|
|
|
|
|
return _fileSystem.path.join(_getFlutterPatchedSdkPath(mode), 'lib', artifactFileName);
|
|
|
|
|
case Artifact.flutterFramework:
|
|
|
|
|
return _fileSystem.path.join(engineOutPath, artifactFileName);
|
|
|
|
|
case Artifact.flutterMacOSFramework:
|
|
|
|
|
return _fileSystem.path.join(engineOutPath, artifactFileName);
|
|
|
|
|
case Artifact.flutterPatchedSdkPath:
|
|
|
|
|
// When using local engine always use [BuildMode.debug] regardless of
|
|
|
|
|
// what was specified in [mode] argument because local engine will
|
|
|
|
|
@@ -712,7 +732,12 @@ class OverrideArtifacts implements Artifacts {
|
|
|
|
|
final File flutterPatchedSdk;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String getArtifactPath(Artifact artifact, { TargetPlatform platform, BuildMode mode }) {
|
|
|
|
|
String getArtifactPath(
|
|
|
|
|
Artifact artifact, {
|
|
|
|
|
TargetPlatform platform,
|
|
|
|
|
BuildMode mode,
|
|
|
|
|
EnvironmentType environmentType,
|
|
|
|
|
}) {
|
|
|
|
|
if (artifact == Artifact.frontendServerSnapshotForEngineDartSdk && frontendServer != null) {
|
|
|
|
|
return frontendServer.path;
|
|
|
|
|
}
|
|
|
|
|
@@ -725,7 +750,12 @@ class OverrideArtifacts implements Artifacts {
|
|
|
|
|
if (artifact == Artifact.flutterPatchedSdkPath && flutterPatchedSdk != null) {
|
|
|
|
|
return flutterPatchedSdk.path;
|
|
|
|
|
}
|
|
|
|
|
return parent.getArtifactPath(artifact, platform: platform, mode: mode);
|
|
|
|
|
return parent.getArtifactPath(
|
|
|
|
|
artifact,
|
|
|
|
|
platform: platform,
|
|
|
|
|
mode: mode,
|
|
|
|
|
environmentType: environmentType,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@@ -742,7 +772,12 @@ String _dartSdkPath(FileSystem fileSystem) {
|
|
|
|
|
|
|
|
|
|
class _TestArtifacts implements Artifacts {
|
|
|
|
|
@override
|
|
|
|
|
String getArtifactPath(Artifact artifact, {TargetPlatform platform, BuildMode mode}) {
|
|
|
|
|
String getArtifactPath(
|
|
|
|
|
Artifact artifact, {
|
|
|
|
|
TargetPlatform platform,
|
|
|
|
|
BuildMode mode,
|
|
|
|
|
EnvironmentType environmentType,
|
|
|
|
|
}) {
|
|
|
|
|
final StringBuffer buffer = StringBuffer();
|
|
|
|
|
buffer.write(artifact);
|
|
|
|
|
if (platform != null) {
|
|
|
|
|
@@ -751,6 +786,9 @@ class _TestArtifacts implements Artifacts {
|
|
|
|
|
if (mode != null) {
|
|
|
|
|
buffer.write('.$mode');
|
|
|
|
|
}
|
|
|
|
|
if (environmentType != null) {
|
|
|
|
|
buffer.write('.$environmentType');
|
|
|
|
|
}
|
|
|
|
|
return buffer.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|