Unverified Commit 14992c59 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Revert "[flutter_tools] separate target platform, host platform, and...

Revert "[flutter_tools] separate target platform, host platform, and architecutre (#60119)" (#60147)

This reverts commit 30d97d89.
parent 37db92be
...@@ -38,9 +38,9 @@ class AotBuilder { ...@@ -38,9 +38,9 @@ class AotBuilder {
bool expectSo = false; bool expectSo = false;
switch (platform) { switch (platform) {
case TargetPlatform.android: case TargetPlatform.android:
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
case TargetPlatform.linux: case TargetPlatform.linux_x64:
case TargetPlatform.windows: case TargetPlatform.windows_x64:
case TargetPlatform.fuchsia_arm64: case TargetPlatform.fuchsia_arm64:
case TargetPlatform.tester: case TargetPlatform.tester:
case TargetPlatform.web_javascript: case TargetPlatform.web_javascript:
......
...@@ -52,7 +52,7 @@ class ApplicationPackageFactory { ...@@ -52,7 +52,7 @@ class ApplicationPackageFactory {
: IOSApp.fromPrebuiltApp(applicationBinary); : IOSApp.fromPrebuiltApp(applicationBinary);
case TargetPlatform.tester: case TargetPlatform.tester:
return FlutterTesterApp.fromCurrentDirectory(); return FlutterTesterApp.fromCurrentDirectory();
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
return applicationBinary == null return applicationBinary == null
? MacOSApp.fromMacOSProject(FlutterProject.current().macos) ? MacOSApp.fromMacOSProject(FlutterProject.current().macos)
: MacOSApp.fromPrebuiltApp(applicationBinary); : MacOSApp.fromPrebuiltApp(applicationBinary);
...@@ -61,11 +61,11 @@ class ApplicationPackageFactory { ...@@ -61,11 +61,11 @@ class ApplicationPackageFactory {
return null; return null;
} }
return WebApplicationPackage(FlutterProject.current()); return WebApplicationPackage(FlutterProject.current());
case TargetPlatform.linux: case TargetPlatform.linux_x64:
return applicationBinary == null return applicationBinary == null
? LinuxApp.fromLinuxProject(FlutterProject.current().linux) ? LinuxApp.fromLinuxProject(FlutterProject.current().linux)
: LinuxApp.fromPrebuiltApp(applicationBinary); : LinuxApp.fromPrebuiltApp(applicationBinary);
case TargetPlatform.windows: case TargetPlatform.windows_x64:
return applicationBinary == null return applicationBinary == null
? WindowsApp.fromWindowsProject(FlutterProject.current().windows) ? WindowsApp.fromWindowsProject(FlutterProject.current().windows)
: WindowsApp.fromPrebuiltApp(applicationBinary); : WindowsApp.fromPrebuiltApp(applicationBinary);
...@@ -436,13 +436,13 @@ class ApplicationPackageStore { ...@@ -436,13 +436,13 @@ class ApplicationPackageStore {
case TargetPlatform.fuchsia_x64: case TargetPlatform.fuchsia_x64:
fuchsia ??= FuchsiaApp.fromFuchsiaProject(FlutterProject.current().fuchsia); fuchsia ??= FuchsiaApp.fromFuchsiaProject(FlutterProject.current().fuchsia);
return fuchsia; return fuchsia;
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
macOS ??= MacOSApp.fromMacOSProject(FlutterProject.current().macos); macOS ??= MacOSApp.fromMacOSProject(FlutterProject.current().macos);
return macOS; return macOS;
case TargetPlatform.linux: case TargetPlatform.linux_x64:
linux ??= LinuxApp.fromLinuxProject(FlutterProject.current().linux); linux ??= LinuxApp.fromLinuxProject(FlutterProject.current().linux);
return linux; return linux;
case TargetPlatform.windows: case TargetPlatform.windows_x64:
windows ??= WindowsApp.fromWindowsProject(FlutterProject.current().windows); windows ??= WindowsApp.fromWindowsProject(FlutterProject.current().windows);
return windows; return windows;
case TargetPlatform.tester: case TargetPlatform.tester:
......
...@@ -69,7 +69,7 @@ enum Artifact { ...@@ -69,7 +69,7 @@ enum Artifact {
} }
String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) {
final String exe = platform == TargetPlatform.windows ? '.exe' : ''; final String exe = platform == TargetPlatform.windows_x64 ? '.exe' : '';
switch (artifact) { switch (artifact) {
case Artifact.genSnapshot: case Artifact.genSnapshot:
return 'gen_snapshot'; return 'gen_snapshot';
...@@ -211,9 +211,9 @@ class CachedArtifacts implements Artifacts { ...@@ -211,9 +211,9 @@ class CachedArtifacts implements Artifacts {
return _getAndroidArtifactPath(artifact, platform, mode); return _getAndroidArtifactPath(artifact, platform, mode);
case TargetPlatform.ios: case TargetPlatform.ios:
return _getIosArtifactPath(artifact, platform, mode); return _getIosArtifactPath(artifact, platform, mode);
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
case TargetPlatform.linux: case TargetPlatform.linux_x64:
case TargetPlatform.windows: case TargetPlatform.windows_x64:
return _getDesktopArtifactPath(artifact, platform, mode); return _getDesktopArtifactPath(artifact, platform, mode);
case TargetPlatform.fuchsia_arm64: case TargetPlatform.fuchsia_arm64:
case TargetPlatform.fuchsia_x64: case TargetPlatform.fuchsia_x64:
...@@ -390,9 +390,9 @@ class CachedArtifacts implements Artifacts { ...@@ -390,9 +390,9 @@ class CachedArtifacts implements Artifacts {
final String engineDir = _cache.getArtifactDirectory('engine').path; final String engineDir = _cache.getArtifactDirectory('engine').path;
final String platformName = getNameForTargetPlatform(platform); final String platformName = getNameForTargetPlatform(platform);
switch (platform) { switch (platform) {
case TargetPlatform.linux: case TargetPlatform.linux_x64:
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
case TargetPlatform.windows: case TargetPlatform.windows_x64:
// TODO(jonahwilliams): remove once debug desktop artifacts are uploaded // TODO(jonahwilliams): remove once debug desktop artifacts are uploaded
// under a separate directory from the host artifacts. // under a separate directory from the host artifacts.
// https://github.com/flutter/flutter/issues/38935 // https://github.com/flutter/flutter/issues/38935
...@@ -429,13 +429,13 @@ class CachedArtifacts implements Artifacts { ...@@ -429,13 +429,13 @@ class CachedArtifacts implements Artifacts {
TargetPlatform _currentHostPlatform(Platform platform) { TargetPlatform _currentHostPlatform(Platform platform) {
if (platform.isMacOS) { if (platform.isMacOS) {
return TargetPlatform.darwin; return TargetPlatform.darwin_x64;
} }
if (platform.isLinux) { if (platform.isLinux) {
return TargetPlatform.linux; return TargetPlatform.linux_x64;
} }
if (platform.isWindows) { if (platform.isWindows) {
return TargetPlatform.windows; return TargetPlatform.windows_x64;
} }
throw UnimplementedError('Host OS not supported.'); throw UnimplementedError('Host OS not supported.');
} }
......
...@@ -143,7 +143,7 @@ class AOTSnapshotter { ...@@ -143,7 +143,7 @@ class AOTSnapshotter {
} }
final String assembly = _fileSystem.path.join(outputDir.path, 'snapshot_assembly.S'); final String assembly = _fileSystem.path.join(outputDir.path, 'snapshot_assembly.S');
if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin) { if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin_x64) {
genSnapshotArgs.addAll(<String>[ genSnapshotArgs.addAll(<String>[
'--snapshot_kind=app-aot-assembly', '--snapshot_kind=app-aot-assembly',
'--assembly=$assembly', '--assembly=$assembly',
...@@ -207,7 +207,7 @@ class AOTSnapshotter { ...@@ -207,7 +207,7 @@ class AOTSnapshotter {
// On iOS and macOS, we use Xcode to compile the snapshot into a dynamic library that the // On iOS and macOS, we use Xcode to compile the snapshot into a dynamic library that the
// end-developer can link into their app. // end-developer can link into their app.
if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin) { if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin_x64) {
final RunResult result = await _buildFramework( final RunResult result = await _buildFramework(
appleArch: darwinArch, appleArch: darwinArch,
isIOS: platform == TargetPlatform.ios, isIOS: platform == TargetPlatform.ios,
...@@ -297,9 +297,9 @@ class AOTSnapshotter { ...@@ -297,9 +297,9 @@ class AOTSnapshotter {
TargetPlatform.android_arm64, TargetPlatform.android_arm64,
TargetPlatform.android_x64, TargetPlatform.android_x64,
TargetPlatform.ios, TargetPlatform.ios,
TargetPlatform.darwin, TargetPlatform.darwin_x64,
TargetPlatform.linux, TargetPlatform.linux_x64,
TargetPlatform.windows, TargetPlatform.windows_x64,
].contains(platform); ].contains(platform);
} }
} }
...@@ -273,7 +273,7 @@ String validatedBuildNumberForPlatform(TargetPlatform targetPlatform, String bui ...@@ -273,7 +273,7 @@ String validatedBuildNumberForPlatform(TargetPlatform targetPlatform, String bui
return null; return null;
} }
if (targetPlatform == TargetPlatform.ios || if (targetPlatform == TargetPlatform.ios ||
targetPlatform == TargetPlatform.darwin) { targetPlatform == TargetPlatform.darwin_x64) {
// See CFBundleVersion at https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html // See CFBundleVersion at https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
final RegExp disallowed = RegExp(r'[^\d\.]'); final RegExp disallowed = RegExp(r'[^\d\.]');
String tmpBuildNumber = buildNumber.replaceAll(disallowed, ''); String tmpBuildNumber = buildNumber.replaceAll(disallowed, '');
...@@ -320,7 +320,7 @@ String validatedBuildNameForPlatform(TargetPlatform targetPlatform, String build ...@@ -320,7 +320,7 @@ String validatedBuildNameForPlatform(TargetPlatform targetPlatform, String build
return null; return null;
} }
if (targetPlatform == TargetPlatform.ios || if (targetPlatform == TargetPlatform.ios ||
targetPlatform == TargetPlatform.darwin) { targetPlatform == TargetPlatform.darwin_x64) {
// See CFBundleShortVersionString at https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html // See CFBundleShortVersionString at https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
final RegExp disallowed = RegExp(r'[^\d\.]'); final RegExp disallowed = RegExp(r'[^\d\.]');
String tmpBuildName = buildName.replaceAll(disallowed, ''); String tmpBuildName = buildName.replaceAll(disallowed, '');
...@@ -370,11 +370,8 @@ bool isEmulatorBuildMode(BuildMode mode) { ...@@ -370,11 +370,8 @@ bool isEmulatorBuildMode(BuildMode mode) {
enum HostPlatform { enum HostPlatform {
darwin_x64, darwin_x64,
darwin_arm64,
linux_x64, linux_x64,
linux_arm64,
windows_x64, windows_x64,
windows_arm64,
} }
String getNameForHostPlatform(HostPlatform platform) { String getNameForHostPlatform(HostPlatform platform) {
...@@ -385,12 +382,6 @@ String getNameForHostPlatform(HostPlatform platform) { ...@@ -385,12 +382,6 @@ String getNameForHostPlatform(HostPlatform platform) {
return 'linux-x64'; return 'linux-x64';
case HostPlatform.windows_x64: case HostPlatform.windows_x64:
return 'windows-x64'; return 'windows-x64';
case HostPlatform.darwin_arm64:
return 'darwin-arm64';
case HostPlatform.linux_arm64:
return 'linux-arm64';
case HostPlatform.windows_arm64:
return 'windows-arm64';
} }
assert(false); assert(false);
return null; return null;
...@@ -399,9 +390,9 @@ String getNameForHostPlatform(HostPlatform platform) { ...@@ -399,9 +390,9 @@ String getNameForHostPlatform(HostPlatform platform) {
enum TargetPlatform { enum TargetPlatform {
android, android,
ios, ios,
darwin, darwin_x64,
linux, linux_x64,
windows, windows_x64,
fuchsia_arm64, fuchsia_arm64,
fuchsia_x64, fuchsia_x64,
tester, tester,
...@@ -416,16 +407,6 @@ enum TargetPlatform { ...@@ -416,16 +407,6 @@ enum TargetPlatform {
android_x86, android_x86,
} }
enum WindowsArch {
x86_64,
arm64,
}
enum LinuxArch {
x86_64,
arm64,
}
/// iOS and macOS target device architecture. /// iOS and macOS target device architecture.
// //
// TODO(cbracken): split TargetPlatform.ios into ios_armv7, ios_arm64. // TODO(cbracken): split TargetPlatform.ios into ios_armv7, ios_arm64.
...@@ -491,11 +472,11 @@ String getNameForTargetPlatform(TargetPlatform platform, {DarwinArch darwinArch} ...@@ -491,11 +472,11 @@ String getNameForTargetPlatform(TargetPlatform platform, {DarwinArch darwinArch}
return 'ios-${getNameForDarwinArch(darwinArch)}'; return 'ios-${getNameForDarwinArch(darwinArch)}';
} }
return 'ios'; return 'ios';
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
return 'darwin-x64'; return 'darwin-x64';
case TargetPlatform.linux: case TargetPlatform.linux_x64:
return 'linux-x64'; return 'linux-x64';
case TargetPlatform.windows: case TargetPlatform.windows_x64:
return 'windows-x64'; return 'windows-x64';
case TargetPlatform.fuchsia_arm64: case TargetPlatform.fuchsia_arm64:
return 'fuchsia-arm64'; return 'fuchsia-arm64';
...@@ -531,11 +512,11 @@ TargetPlatform getTargetPlatformForName(String platform) { ...@@ -531,11 +512,11 @@ TargetPlatform getTargetPlatformForName(String platform) {
case 'ios': case 'ios':
return TargetPlatform.ios; return TargetPlatform.ios;
case 'darwin-x64': case 'darwin-x64':
return TargetPlatform.darwin; return TargetPlatform.darwin_x64;
case 'linux-x64': case 'linux-x64':
return TargetPlatform.linux; return TargetPlatform.linux_x64;
case 'windows-x64': case 'windows-x64':
return TargetPlatform.windows; return TargetPlatform.windows_x64;
case 'web-javascript': case 'web-javascript':
return TargetPlatform.web_javascript; return TargetPlatform.web_javascript;
} }
......
...@@ -223,9 +223,9 @@ class KernelSnapshot extends Target { ...@@ -223,9 +223,9 @@ class KernelSnapshot extends Target {
// See https://github.com/flutter/flutter/issues/44724 // See https://github.com/flutter/flutter/issues/44724
bool forceLinkPlatform; bool forceLinkPlatform;
switch (targetPlatform) { switch (targetPlatform) {
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
case TargetPlatform.windows: case TargetPlatform.windows_x64:
case TargetPlatform.linux: case TargetPlatform.linux_x64:
forceLinkPlatform = true; forceLinkPlatform = true;
break; break;
default: default:
......
...@@ -48,13 +48,13 @@ class UnpackLinux extends Target { ...@@ -48,13 +48,13 @@ class UnpackLinux extends Target {
.getArtifactPath( .getArtifactPath(
Artifact.linuxDesktopPath, Artifact.linuxDesktopPath,
mode: buildMode, mode: buildMode,
platform: TargetPlatform.linux, platform: TargetPlatform.linux_x64,
); );
final String headersPath = environment.artifacts final String headersPath = environment.artifacts
.getArtifactPath( .getArtifactPath(
Artifact.linuxHeaders, Artifact.linuxHeaders,
mode: buildMode, mode: buildMode,
platform: TargetPlatform.linux, platform: TargetPlatform.linux_x64,
); );
final Directory outputDirectory = environment.fileSystem.directory( final Directory outputDirectory = environment.fileSystem.directory(
environment.fileSystem.path.join( environment.fileSystem.path.join(
...@@ -71,7 +71,7 @@ class UnpackLinux extends Target { ...@@ -71,7 +71,7 @@ class UnpackLinux extends Target {
clientSourcePaths: <String>[headersPath], clientSourcePaths: <String>[headersPath],
icuDataPath: environment.artifacts.getArtifactPath( icuDataPath: environment.artifacts.getArtifactPath(
Artifact.icuData, Artifact.icuData,
platform: TargetPlatform.linux, platform: TargetPlatform.linux_x64,
) )
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
...@@ -127,7 +127,7 @@ abstract class BundleLinuxAssets extends Target { ...@@ -127,7 +127,7 @@ abstract class BundleLinuxAssets extends Target {
final Depfile depfile = await copyAssets( final Depfile depfile = await copyAssets(
environment, environment,
outputDirectory, outputDirectory,
targetPlatform: TargetPlatform.linux, targetPlatform: TargetPlatform.linux_x64,
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
fileSystem: environment.fileSystem, fileSystem: environment.fileSystem,
...@@ -206,7 +206,7 @@ class ProfileBundleLinuxAssets extends BundleLinuxAssets { ...@@ -206,7 +206,7 @@ class ProfileBundleLinuxAssets extends BundleLinuxAssets {
@override @override
List<Target> get dependencies => <Target>[ List<Target> get dependencies => <Target>[
...super.dependencies, ...super.dependencies,
const LinuxAotBundle(AotElfProfile(TargetPlatform.linux)), const LinuxAotBundle(AotElfProfile(TargetPlatform.linux_x64)),
]; ];
} }
...@@ -222,6 +222,6 @@ class ReleaseBundleLinuxAssets extends BundleLinuxAssets { ...@@ -222,6 +222,6 @@ class ReleaseBundleLinuxAssets extends BundleLinuxAssets {
@override @override
List<Target> get dependencies => <Target>[ List<Target> get dependencies => <Target>[
...super.dependencies, ...super.dependencies,
const LinuxAotBundle(AotElfRelease(TargetPlatform.linux)), const LinuxAotBundle(AotElfRelease(TargetPlatform.linux_x64)),
]; ];
} }
...@@ -211,7 +211,7 @@ class CompileMacOSFramework extends Target { ...@@ -211,7 +211,7 @@ class CompileMacOSFramework extends Target {
buildMode: buildMode, buildMode: buildMode,
mainPath: environment.buildDir.childFile('app.dill').path, mainPath: environment.buildDir.childFile('app.dill').path,
outputPath: environment.buildDir.path, outputPath: environment.buildDir.path,
platform: TargetPlatform.darwin, platform: TargetPlatform.darwin_x64,
darwinArch: DarwinArch.x86_64, darwinArch: DarwinArch.x86_64,
packagesPath: environment.projectDir.childFile('.packages').path, packagesPath: environment.projectDir.childFile('.packages').path,
splitDebugInfo: splitDebugInfo, splitDebugInfo: splitDebugInfo,
...@@ -232,7 +232,7 @@ class CompileMacOSFramework extends Target { ...@@ -232,7 +232,7 @@ class CompileMacOSFramework extends Target {
List<Source> get inputs => const <Source>[ List<Source> get inputs => const <Source>[
Source.pattern('{BUILD_DIR}/app.dill'), Source.pattern('{BUILD_DIR}/app.dill'),
Source.pattern('{FLUTTER_ROOT}/packages/flutter_tools/lib/src/build_system/targets/macos.dart'), Source.pattern('{FLUTTER_ROOT}/packages/flutter_tools/lib/src/build_system/targets/macos.dart'),
Source.artifact(Artifact.genSnapshot, mode: BuildMode.release, platform: TargetPlatform.darwin), Source.artifact(Artifact.genSnapshot, mode: BuildMode.release, platform: TargetPlatform.darwin_x64),
]; ];
@override @override
...@@ -296,7 +296,7 @@ abstract class MacOSBundleFlutterAssets extends Target { ...@@ -296,7 +296,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
final Depfile assetDepfile = await copyAssets( final Depfile assetDepfile = await copyAssets(
environment, environment,
assetDirectory, assetDirectory,
targetPlatform: TargetPlatform.darwin, targetPlatform: TargetPlatform.darwin_x64,
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
fileSystem: globals.fs, fileSystem: globals.fs,
...@@ -346,9 +346,9 @@ abstract class MacOSBundleFlutterAssets extends Target { ...@@ -346,9 +346,9 @@ abstract class MacOSBundleFlutterAssets extends Target {
// Copy precompiled runtimes. // Copy precompiled runtimes.
try { try {
final String vmSnapshotData = globals.artifacts.getArtifactPath(Artifact.vmSnapshotData, final String vmSnapshotData = globals.artifacts.getArtifactPath(Artifact.vmSnapshotData,
platform: TargetPlatform.darwin, mode: BuildMode.debug); platform: TargetPlatform.darwin_x64, mode: BuildMode.debug);
final String isolateSnapshotData = globals.artifacts.getArtifactPath(Artifact.isolateSnapshotData, final String isolateSnapshotData = globals.artifacts.getArtifactPath(Artifact.isolateSnapshotData,
platform: TargetPlatform.darwin, mode: BuildMode.debug); platform: TargetPlatform.darwin_x64, mode: BuildMode.debug);
globals.fs.file(vmSnapshotData).copySync( globals.fs.file(vmSnapshotData).copySync(
assetDirectory.childFile('vm_snapshot_data').path); assetDirectory.childFile('vm_snapshot_data').path);
globals.fs.file(isolateSnapshotData).copySync( globals.fs.file(isolateSnapshotData).copySync(
...@@ -409,8 +409,8 @@ class DebugMacOSBundleFlutterAssets extends MacOSBundleFlutterAssets { ...@@ -409,8 +409,8 @@ class DebugMacOSBundleFlutterAssets extends MacOSBundleFlutterAssets {
List<Source> get inputs => <Source>[ List<Source> get inputs => <Source>[
...super.inputs, ...super.inputs,
const Source.pattern('{BUILD_DIR}/app.dill'), const Source.pattern('{BUILD_DIR}/app.dill'),
const Source.artifact(Artifact.isolateSnapshotData, platform: TargetPlatform.darwin, mode: BuildMode.debug), const Source.artifact(Artifact.isolateSnapshotData, platform: TargetPlatform.darwin_x64, mode: BuildMode.debug),
const Source.artifact(Artifact.vmSnapshotData, platform: TargetPlatform.darwin, mode: BuildMode.debug), const Source.artifact(Artifact.vmSnapshotData, platform: TargetPlatform.darwin_x64, mode: BuildMode.debug),
]; ];
@override @override
......
...@@ -54,13 +54,13 @@ class UnpackWindows extends Target { ...@@ -54,13 +54,13 @@ class UnpackWindows extends Target {
final String engineSourcePath = environment.artifacts final String engineSourcePath = environment.artifacts
.getArtifactPath( .getArtifactPath(
Artifact.windowsDesktopPath, Artifact.windowsDesktopPath,
platform: TargetPlatform.windows, platform: TargetPlatform.windows_x64,
mode: buildMode, mode: buildMode,
); );
final String clientSourcePath = environment.artifacts final String clientSourcePath = environment.artifacts
.getArtifactPath( .getArtifactPath(
Artifact.windowsCppClientWrapper, Artifact.windowsCppClientWrapper,
platform: TargetPlatform.windows, platform: TargetPlatform.windows_x64,
mode: buildMode, mode: buildMode,
); );
final Directory outputDirectory = environment.fileSystem.directory( final Directory outputDirectory = environment.fileSystem.directory(
...@@ -79,7 +79,7 @@ class UnpackWindows extends Target { ...@@ -79,7 +79,7 @@ class UnpackWindows extends Target {
clientSourcePaths: <String>[clientSourcePath], clientSourcePaths: <String>[clientSourcePath],
icuDataPath: environment.artifacts.getArtifactPath( icuDataPath: environment.artifacts.getArtifactPath(
Artifact.icuData, Artifact.icuData,
platform: TargetPlatform.windows platform: TargetPlatform.windows_x64
) )
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
...@@ -135,7 +135,7 @@ abstract class BundleWindowsAssets extends Target { ...@@ -135,7 +135,7 @@ abstract class BundleWindowsAssets extends Target {
final Depfile depfile = await copyAssets( final Depfile depfile = await copyAssets(
environment, environment,
outputDirectory, outputDirectory,
targetPlatform: TargetPlatform.windows, targetPlatform: TargetPlatform.windows_x64,
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
fileSystem: environment.fileSystem, fileSystem: environment.fileSystem,
...@@ -197,7 +197,7 @@ class ReleaseBundleWindowsAssets extends BundleWindowsAssets { ...@@ -197,7 +197,7 @@ class ReleaseBundleWindowsAssets extends BundleWindowsAssets {
@override @override
List<Target> get dependencies => <Target>[ List<Target> get dependencies => <Target>[
...super.dependencies, ...super.dependencies,
const WindowsAotBundle(AotElfRelease(TargetPlatform.windows)), const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64)),
]; ];
} }
...@@ -213,7 +213,7 @@ class ProfileBundleWindowsAssets extends BundleWindowsAssets { ...@@ -213,7 +213,7 @@ class ProfileBundleWindowsAssets extends BundleWindowsAssets {
@override @override
List<Target> get dependencies => <Target>[ List<Target> get dependencies => <Target>[
...super.dependencies, ...super.dependencies,
const WindowsAotBundle(AotElfProfile(TargetPlatform.windows)), const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64)),
]; ];
} }
......
...@@ -100,17 +100,17 @@ class BuildBundleCommand extends BuildSubCommand { ...@@ -100,17 +100,17 @@ class BuildBundleCommand extends BuildSubCommand {
} }
// Check for target platforms that are only allowed via feature flags. // Check for target platforms that are only allowed via feature flags.
switch (platform) { switch (platform) {
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
if (!featureFlags.isMacOSEnabled) { if (!featureFlags.isMacOSEnabled) {
throwToolExit('macOS is not a supported target platform.'); throwToolExit('macOS is not a supported target platform.');
} }
break; break;
case TargetPlatform.windows: case TargetPlatform.windows_x64:
if (!featureFlags.isWindowsEnabled) { if (!featureFlags.isWindowsEnabled) {
throwToolExit('Windows is not a supported target platform.'); throwToolExit('Windows is not a supported target platform.');
} }
break; break;
case TargetPlatform.linux: case TargetPlatform.linux_x64:
if (!featureFlags.isLinuxEnabled) { if (!featureFlags.isLinuxEnabled) {
throwToolExit('Linux is not a supported target platform.'); throwToolExit('Linux is not a supported target platform.');
} }
......
...@@ -33,7 +33,7 @@ String flutterFrameworkDir(BuildMode mode) { ...@@ -33,7 +33,7 @@ String flutterFrameworkDir(BuildMode mode) {
String flutterMacOSFrameworkDir(BuildMode mode) { String flutterMacOSFrameworkDir(BuildMode mode) {
return globals.fs.path.normalize(globals.fs.path.dirname(globals.artifacts.getArtifactPath( return globals.fs.path.normalize(globals.fs.path.dirname(globals.artifacts.getArtifactPath(
Artifact.flutterMacOSFramework, platform: TargetPlatform.darwin, mode: mode))); Artifact.flutterMacOSFramework, platform: TargetPlatform.darwin_x64, mode: mode)));
} }
/// Writes or rewrites Xcode property files with the specified information. /// Writes or rewrites Xcode property files with the specified information.
......
...@@ -29,7 +29,7 @@ class LinuxDevice extends DesktopDevice { ...@@ -29,7 +29,7 @@ class LinuxDevice extends DesktopDevice {
String get name => 'Linux desktop'; String get name => 'Linux desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.linux; Future<TargetPlatform> get targetPlatform async => TargetPlatform.linux_x64;
@override @override
bool isSupportedForProject(FlutterProject flutterProject) { bool isSupportedForProject(FlutterProject flutterProject) {
......
...@@ -27,7 +27,7 @@ class MacOSDevice extends DesktopDevice { ...@@ -27,7 +27,7 @@ class MacOSDevice extends DesktopDevice {
String get name => 'macOS desktop'; String get name => 'macOS desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin; Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin_x64;
@override @override
bool isSupportedForProject(FlutterProject flutterProject) { bool isSupportedForProject(FlutterProject flutterProject) {
......
...@@ -1057,17 +1057,17 @@ DevelopmentArtifact _artifactFromTargetPlatform(TargetPlatform targetPlatform) { ...@@ -1057,17 +1057,17 @@ DevelopmentArtifact _artifactFromTargetPlatform(TargetPlatform targetPlatform) {
return DevelopmentArtifact.web; return DevelopmentArtifact.web;
case TargetPlatform.ios: case TargetPlatform.ios:
return DevelopmentArtifact.iOS; return DevelopmentArtifact.iOS;
case TargetPlatform.darwin: case TargetPlatform.darwin_x64:
if (featureFlags.isMacOSEnabled) { if (featureFlags.isMacOSEnabled) {
return DevelopmentArtifact.macOS; return DevelopmentArtifact.macOS;
} }
return null; return null;
case TargetPlatform.windows: case TargetPlatform.windows_x64:
if (featureFlags.isWindowsEnabled) { if (featureFlags.isWindowsEnabled) {
return DevelopmentArtifact.windows; return DevelopmentArtifact.windows;
} }
return null; return null;
case TargetPlatform.linux: case TargetPlatform.linux_x64:
if (featureFlags.isLinuxEnabled) { if (featureFlags.isLinuxEnabled) {
return DevelopmentArtifact.linux; return DevelopmentArtifact.linux;
} }
......
...@@ -30,7 +30,7 @@ class WindowsDevice extends DesktopDevice { ...@@ -30,7 +30,7 @@ class WindowsDevice extends DesktopDevice {
String get name => 'Windows desktop'; String get name => 'Windows desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.windows; Future<TargetPlatform> get targetPlatform async => TargetPlatform.windows_x64;
@override @override
bool isSupportedForProject(FlutterProject flutterProject) { bool isSupportedForProject(FlutterProject flutterProject) {
......
...@@ -62,7 +62,7 @@ void main() { ...@@ -62,7 +62,7 @@ void main() {
'ios-release', 'ios-release',
); );
expect( expect(
artifacts.getEngineType(TargetPlatform.darwin), artifacts.getEngineType(TargetPlatform.darwin_x64),
'darwin-x64', 'darwin-x64',
); );
}); });
...@@ -121,7 +121,7 @@ void main() { ...@@ -121,7 +121,7 @@ void main() {
'android_debug_unopt', 'android_debug_unopt',
); );
expect( expect(
artifacts.getEngineType(TargetPlatform.darwin), artifacts.getEngineType(TargetPlatform.darwin_x64),
'android_debug_unopt', 'android_debug_unopt',
); );
}); });
......
...@@ -91,7 +91,7 @@ void main() { ...@@ -91,7 +91,7 @@ void main() {
'foo', 'foo',
); );
globals.fs.file(path).createSync(recursive: true); globals.fs.file(path).createSync(recursive: true);
const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows); const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64);
fizzSource.accept(visitor); fizzSource.accept(visitor);
expect(visitor.sources.single.resolveSymbolicLinksSync(), globals.fs.path.absolute(path)); expect(visitor.sources.single.resolveSymbolicLinksSync(), globals.fs.path.absolute(path));
...@@ -228,7 +228,7 @@ void main() { ...@@ -228,7 +228,7 @@ void main() {
); );
visitor = SourceVisitor(environment); visitor = SourceVisitor(environment);
const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows); const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64);
fizzSource.accept(visitor); fizzSource.accept(visitor);
expect(visitor.sources.single.path, contains('engine.version')); expect(visitor.sources.single.path, contains('engine.version'));
......
...@@ -259,7 +259,7 @@ void main() { ...@@ -259,7 +259,7 @@ void main() {
]); ]);
await const KernelSnapshot().build(androidEnvironment await const KernelSnapshot().build(androidEnvironment
..defines[kTargetPlatform] = getNameForTargetPlatform(TargetPlatform.darwin) ..defines[kTargetPlatform] = getNameForTargetPlatform(TargetPlatform.darwin_x64)
..defines[kBuildMode] = getNameForBuildMode(BuildMode.debug) ..defines[kBuildMode] = getNameForBuildMode(BuildMode.debug)
..defines[kTrackWidgetCreation] = 'false' ..defines[kTrackWidgetCreation] = 'false'
); );
......
...@@ -129,7 +129,7 @@ void main() { ...@@ -129,7 +129,7 @@ void main() {
// Create input files. // Create input files.
testEnvironment.buildDir.childFile('app.so').createSync(); testEnvironment.buildDir.childFile('app.so').createSync();
await const LinuxAotBundle(AotElfProfile(TargetPlatform.linux)).build(testEnvironment); await const LinuxAotBundle(AotElfProfile(TargetPlatform.linux_x64)).build(testEnvironment);
await const ProfileBundleLinuxAssets().build(testEnvironment); await const ProfileBundleLinuxAssets().build(testEnvironment);
final Directory libDir = testEnvironment.outputDir final Directory libDir = testEnvironment.outputDir
.childDirectory('lib'); .childDirectory('lib');
...@@ -162,7 +162,7 @@ void main() { ...@@ -162,7 +162,7 @@ void main() {
// Create input files. // Create input files.
testEnvironment.buildDir.childFile('app.so').createSync(); testEnvironment.buildDir.childFile('app.so').createSync();
await const LinuxAotBundle(AotElfRelease(TargetPlatform.linux)).build(testEnvironment); await const LinuxAotBundle(AotElfRelease(TargetPlatform.linux_x64)).build(testEnvironment);
await const ReleaseBundleLinuxAssets().build(testEnvironment); await const ReleaseBundleLinuxAssets().build(testEnvironment);
final Directory libDir = testEnvironment.outputDir final Directory libDir = testEnvironment.outputDir
.childDirectory('lib'); .childDirectory('lib');
......
...@@ -197,7 +197,7 @@ void main() { ...@@ -197,7 +197,7 @@ void main() {
environment.buildDir.childFile('app.so').createSync(recursive: true); environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows)).build(environment); await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64)).build(environment);
await const ProfileBundleWindowsAssets().build(environment); await const ProfileBundleWindowsAssets().build(environment);
// Depfile is created and so is copied. // Depfile is created and so is copied.
...@@ -224,7 +224,7 @@ void main() { ...@@ -224,7 +224,7 @@ void main() {
environment.buildDir.childFile('app.so').createSync(recursive: true); environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows)).build(environment); await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64)).build(environment);
await const ReleaseBundleWindowsAssets().build(environment); await const ReleaseBundleWindowsAssets().build(environment);
// Depfile is created and so is copied. // Depfile is created and so is copied.
......
...@@ -59,7 +59,7 @@ void main() { ...@@ -59,7 +59,7 @@ void main() {
flutterProject: FlutterProject.current(), flutterProject: FlutterProject.current(),
mainPath: 'lib/main.dart', mainPath: 'lib/main.dart',
outputDir: 'example', outputDir: 'example',
targetPlatform: TargetPlatform.linux, targetPlatform: TargetPlatform.linux_x64,
depfilePath: 'example.d', depfilePath: 'example.d',
precompiled: false, precompiled: false,
treeShakeIcons: false, treeShakeIcons: false,
......
...@@ -554,7 +554,7 @@ Information about project "Runner": ...@@ -554,7 +554,7 @@ Information about project "Runner":
testUsingOsxContext('do not set OTHER_LDFLAGS for macOS', () async { testUsingOsxContext('do not set OTHER_LDFLAGS for macOS', () async {
when(mockArtifacts.getArtifactPath(Artifact.flutterMacOSFramework, when(mockArtifacts.getArtifactPath(Artifact.flutterMacOSFramework,
platform: TargetPlatform.darwin, mode: anyNamed('mode'))).thenReturn(fs.path.join('engine', 'FlutterMacOS.framework')); platform: TargetPlatform.darwin_x64, mode: anyNamed('mode'))).thenReturn(fs.path.join('engine', 'FlutterMacOS.framework'));
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, treeShakeIcons: false); const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, treeShakeIcons: false);
......
...@@ -27,7 +27,7 @@ void main() { ...@@ -27,7 +27,7 @@ void main() {
testWithoutContext('LinuxDevice defaults', () async { testWithoutContext('LinuxDevice defaults', () async {
final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo'); final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.linux); expect(await device.targetPlatform, TargetPlatform.linux_x64);
expect(device.name, 'Linux desktop'); expect(device.name, 'Linux desktop');
expect(await device.installApp(linuxApp), true); expect(await device.installApp(linuxApp), true);
expect(await device.uninstallApp(linuxApp), true); expect(await device.uninstallApp(linuxApp), true);
......
...@@ -39,7 +39,7 @@ void main() { ...@@ -39,7 +39,7 @@ void main() {
testUsingContext('defaults', () async { testUsingContext('defaults', () async {
final MockMacOSApp mockMacOSApp = MockMacOSApp(); final MockMacOSApp mockMacOSApp = MockMacOSApp();
expect(await device.targetPlatform, TargetPlatform.darwin); expect(await device.targetPlatform, TargetPlatform.darwin_x64);
expect(device.name, 'macOS desktop'); expect(device.name, 'macOS desktop');
expect(await device.installApp(mockMacOSApp), true); expect(await device.installApp(mockMacOSApp), true);
expect(await device.uninstallApp(mockMacOSApp), true); expect(await device.uninstallApp(mockMacOSApp), true);
......
...@@ -31,7 +31,7 @@ void main() { ...@@ -31,7 +31,7 @@ void main() {
testUsingContext('defaults', () async { testUsingContext('defaults', () async {
final PrebuiltWindowsApp windowsApp = PrebuiltWindowsApp(executable: 'foo'); final PrebuiltWindowsApp windowsApp = PrebuiltWindowsApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.windows); expect(await device.targetPlatform, TargetPlatform.windows_x64);
expect(device.name, 'Windows desktop'); expect(device.name, 'Windows desktop');
expect(await device.installApp(windowsApp), true); expect(await device.installApp(windowsApp), true);
expect(await device.uninstallApp(windowsApp), true); expect(await device.uninstallApp(windowsApp), true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment