Unverified Commit 65798445 authored by Matan Lurey's avatar Matan Lurey Committed by GitHub

Update `flutter_tools` internals related to Gradle/XCode to set `--local-engine-host`. (#132346)

Partial work towards https://github.com/flutter/flutter/issues/132245.

I made a minor refactor to test-only code because it was too confusing
to have 2 optional parameters that are technically required together,
but otherwise all other changes *should* be pass throughs. That being
said, I can't say I totally understand the Gradle stuff so I could use a
hand double checking that.
parent 9526142c
...@@ -164,6 +164,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -164,6 +164,7 @@ class FlutterPlugin implements Plugin<Project> {
private File flutterRoot private File flutterRoot
private File flutterExecutable private File flutterExecutable
private String localEngine private String localEngine
private String localEngineHost
private String localEngineSrcPath private String localEngineSrcPath
private Properties localProperties private Properties localProperties
private String engineVersion private String engineVersion
...@@ -324,6 +325,13 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -324,6 +325,13 @@ class FlutterPlugin implements Plugin<Project> {
} }
localEngine = engineOut.name localEngine = engineOut.name
localEngineSrcPath = engineOut.parentFile.parent localEngineSrcPath = engineOut.parentFile.parent
String engineHostOutPath = project.property('local-engine-host-out')
File engineHostOut = project.file(engineHostOutPath)
if (!engineHostOut.isDirectory()) {
throw new GradleException('local-engine-host-out must point to a local engine host build')
}
localEngineHostOut = engineHostOut.name
} }
project.android.buildTypes.all this.&addFlutterDependencies project.android.buildTypes.all this.&addFlutterDependencies
} }
...@@ -1027,6 +1035,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -1027,6 +1035,7 @@ class FlutterPlugin implements Plugin<Project> {
flutterExecutable this.flutterExecutable flutterExecutable this.flutterExecutable
buildMode variantBuildMode buildMode variantBuildMode
localEngine this.localEngine localEngine this.localEngine
localEngineHost this.localEngineHost
localEngineSrcPath this.localEngineSrcPath localEngineSrcPath this.localEngineSrcPath
targetPath getFlutterTarget() targetPath getFlutterTarget()
verbose this.isVerbose() verbose this.isVerbose()
...@@ -1235,6 +1244,8 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -1235,6 +1244,8 @@ abstract class BaseFlutterTask extends DefaultTask {
@Optional @Input @Optional @Input
String localEngine String localEngine
@Optional @Input @Optional @Input
String localEngineHost
@Optional @Input
String localEngineSrcPath String localEngineSrcPath
@Optional @Input @Optional @Input
Boolean fastStart Boolean fastStart
...@@ -1313,6 +1324,9 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -1313,6 +1324,9 @@ abstract class BaseFlutterTask extends DefaultTask {
args "--local-engine", localEngine args "--local-engine", localEngine
args "--local-engine-src-path", localEngineSrcPath args "--local-engine-src-path", localEngineSrcPath
} }
if (localEngineHost != null) {
args "--local-engine-host", localEngineHost
}
if (verbose) { if (verbose) {
args "--verbose" args "--verbose"
} else { } else {
......
...@@ -401,6 +401,7 @@ class AndroidGradleBuilder implements AndroidBuilder { ...@@ -401,6 +401,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
command.add('-Plocal-engine-repo=${localEngineRepo.path}'); command.add('-Plocal-engine-repo=${localEngineRepo.path}');
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}'); command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}'); command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');
command.add('-Plocal-engine-host-out=${localEngineInfo.engineHostOutPath}');
command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath( command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath(
localEngineInfo.engineOutPath)}'); localEngineInfo.engineOutPath)}');
} else if (androidBuildInfo.targetArchs.isNotEmpty) { } else if (androidBuildInfo.targetArchs.isNotEmpty) {
...@@ -726,6 +727,7 @@ class AndroidGradleBuilder implements AndroidBuilder { ...@@ -726,6 +727,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
command.add('-Plocal-engine-repo=${localEngineRepo.path}'); command.add('-Plocal-engine-repo=${localEngineRepo.path}');
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}'); command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}'); command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');
command.add('-Plocal-engine-host-out=${localEngineInfo.engineHostOutPath}');
// Copy the local engine repo in the output directory. // Copy the local engine repo in the output directory.
try { try {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:file/memory.dart'; import 'package:file/memory.dart';
import 'package:meta/meta.dart';
import 'package:process/process.dart'; import 'package:process/process.dart';
import 'base/common.dart'; import 'base/common.dart';
...@@ -287,10 +288,12 @@ class EngineBuildPaths { ...@@ -287,10 +288,12 @@ class EngineBuildPaths {
class LocalEngineInfo { class LocalEngineInfo {
const LocalEngineInfo({ const LocalEngineInfo({
required this.engineOutPath, required this.engineOutPath,
required this.engineHostOutPath,
required this.localEngineName, required this.localEngineName,
}); });
final String engineOutPath; final String engineOutPath;
final String engineHostOutPath;
final String localEngineName; final String localEngineName;
} }
...@@ -302,12 +305,23 @@ abstract class Artifacts { ...@@ -302,12 +305,23 @@ abstract class Artifacts {
/// If a [fileSystem] is not provided, creates a new [MemoryFileSystem] instance. /// If a [fileSystem] is not provided, creates a new [MemoryFileSystem] instance.
/// ///
/// Creates a [LocalEngineArtifacts] if `localEngine` is non-null /// Creates a [LocalEngineArtifacts] if `localEngine` is non-null
factory Artifacts.test({String? localEngine, FileSystem? fileSystem}) { @visibleForTesting
fileSystem ??= MemoryFileSystem.test(); factory Artifacts.test({FileSystem? fileSystem}) {
if (localEngine != null) { return _TestArtifacts(fileSystem ?? MemoryFileSystem.test());
return _TestLocalEngine(localEngine, fileSystem); }
}
return _TestArtifacts(fileSystem); /// A test-specific implementation of artifacts that returns stable paths for
/// all artifacts, and uses a local engine.
///
/// If a [fileSystem] is not provided, creates a new [MemoryFileSystem] instance.
@visibleForTesting
factory Artifacts.testLocalEngine({
required String localEngine,
required String localEngineHost,
FileSystem? fileSystem,
}) {
return _TestLocalEngine(
localEngine, localEngineHost, fileSystem ?? MemoryFileSystem.test());
} }
static Artifacts getLocalEngine(EngineBuildPaths engineBuildPaths) { static Artifacts getLocalEngine(EngineBuildPaths engineBuildPaths) {
...@@ -811,6 +825,7 @@ class CachedLocalEngineArtifacts implements Artifacts { ...@@ -811,6 +825,7 @@ class CachedLocalEngineArtifacts implements Artifacts {
localEngineInfo = localEngineInfo =
LocalEngineInfo( LocalEngineInfo(
engineOutPath: engineOutPath, engineOutPath: engineOutPath,
engineHostOutPath: _hostEngineOutPath,
localEngineName: fileSystem.path.basename(engineOutPath) localEngineName: fileSystem.path.basename(engineOutPath)
), ),
_cache = cache, _cache = cache,
...@@ -1365,12 +1380,12 @@ class _TestArtifacts implements Artifacts { ...@@ -1365,12 +1380,12 @@ class _TestArtifacts implements Artifacts {
} }
class _TestLocalEngine extends _TestArtifacts { class _TestLocalEngine extends _TestArtifacts {
_TestLocalEngine(String engineOutPath, super.fileSystem) : _TestLocalEngine(
localEngineInfo = String engineOutPath, String engineHostOutPath, super.fileSystem)
LocalEngineInfo( : localEngineInfo = LocalEngineInfo(
engineOutPath: engineOutPath, engineOutPath: engineOutPath,
localEngineName: fileSystem.path.basename(engineOutPath) engineHostOutPath: engineHostOutPath,
); localEngineName: fileSystem.path.basename(engineOutPath));
@override @override
bool get isLocalEngine => true; bool get isLocalEngine => true;
......
...@@ -72,6 +72,7 @@ class IMobileDevice { ...@@ -72,6 +72,7 @@ class IMobileDevice {
/// Create an [IMobileDevice] for testing. /// Create an [IMobileDevice] for testing.
factory IMobileDevice.test({ required ProcessManager processManager }) { factory IMobileDevice.test({ required ProcessManager processManager }) {
return IMobileDevice( return IMobileDevice(
// ignore: invalid_use_of_visible_for_testing_member
artifacts: Artifacts.test(), artifacts: Artifacts.test(),
cache: Cache.test(processManager: processManager), cache: Cache.test(processManager: processManager),
processManager: processManager, processManager: processManager,
......
...@@ -192,7 +192,7 @@ void main() { ...@@ -192,7 +192,7 @@ void main() {
)); ));
await commandRunner.run(<String>['assemble', '-o Output', 'debug_macos_bundle_flutter_assets']); await commandRunner.run(<String>['assemble', '-o Output', 'debug_macos_bundle_flutter_assets']);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(localEngine: 'out/host_release'), Artifacts: () => Artifacts.testLocalEngine(localEngine: 'out/host_release', localEngineHost: 'out/host_release'),
Cache: () => Cache.test(processManager: FakeProcessManager.any()), Cache: () => Cache.test(processManager: FakeProcessManager.any()),
FileSystem: () => MemoryFileSystem.test(), FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
......
...@@ -1187,7 +1187,7 @@ unknown crash ...@@ -1187,7 +1187,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_arm'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_arm', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1200,6 +1200,7 @@ unknown crash ...@@ -1200,6 +1200,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_arm', '-Plocal-engine-out=out/android_arm',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-arm', '-Ptarget-platform=android-arm',
'-Ptarget=lib/main.dart', '-Ptarget=lib/main.dart',
'-Pbase-application-name=io.flutter.app.FlutterApplication', '-Pbase-application-name=io.flutter.app.FlutterApplication',
...@@ -1266,7 +1267,7 @@ unknown crash ...@@ -1266,7 +1267,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_arm64'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_arm64', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1279,6 +1280,7 @@ unknown crash ...@@ -1279,6 +1280,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_arm64', '-Plocal-engine-out=out/android_arm64',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-arm64', '-Ptarget-platform=android-arm64',
'-Ptarget=lib/main.dart', '-Ptarget=lib/main.dart',
'-Pbase-application-name=io.flutter.app.FlutterApplication', '-Pbase-application-name=io.flutter.app.FlutterApplication',
...@@ -1345,7 +1347,7 @@ unknown crash ...@@ -1345,7 +1347,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_x86'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_x86', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1358,6 +1360,7 @@ unknown crash ...@@ -1358,6 +1360,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_x86', '-Plocal-engine-out=out/android_x86',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-x86', '-Ptarget-platform=android-x86',
'-Ptarget=lib/main.dart', '-Ptarget=lib/main.dart',
'-Pbase-application-name=io.flutter.app.FlutterApplication', '-Pbase-application-name=io.flutter.app.FlutterApplication',
...@@ -1424,7 +1427,7 @@ unknown crash ...@@ -1424,7 +1427,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_x64'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_x64', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1437,6 +1440,7 @@ unknown crash ...@@ -1437,6 +1440,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_x64', '-Plocal-engine-out=out/android_x64',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-x64', '-Ptarget-platform=android-x64',
'-Ptarget=lib/main.dart', '-Ptarget=lib/main.dart',
'-Pbase-application-name=io.flutter.app.FlutterApplication', '-Pbase-application-name=io.flutter.app.FlutterApplication',
...@@ -1565,7 +1569,7 @@ unknown crash ...@@ -1565,7 +1569,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_arm'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_arm', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1586,6 +1590,7 @@ unknown crash ...@@ -1586,6 +1590,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_arm', '-Plocal-engine-out=out/android_arm',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-arm', '-Ptarget-platform=android-arm',
'assembleAarRelease', 'assembleAarRelease',
], ],
...@@ -1653,7 +1658,7 @@ unknown crash ...@@ -1653,7 +1658,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_arm64'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_arm64', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1674,6 +1679,7 @@ unknown crash ...@@ -1674,6 +1679,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_arm64', '-Plocal-engine-out=out/android_arm64',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-arm64', '-Ptarget-platform=android-arm64',
'assembleAarRelease', 'assembleAarRelease',
], ],
...@@ -1741,7 +1747,7 @@ unknown crash ...@@ -1741,7 +1747,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_x86'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_x86', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1762,6 +1768,7 @@ unknown crash ...@@ -1762,6 +1768,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_x86', '-Plocal-engine-out=out/android_x86',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-x86', '-Ptarget-platform=android-x86',
'assembleAarRelease', 'assembleAarRelease',
], ],
...@@ -1829,7 +1836,7 @@ unknown crash ...@@ -1829,7 +1836,7 @@ unknown crash
logger: logger, logger: logger,
processManager: processManager, processManager: processManager,
fileSystem: fileSystem, fileSystem: fileSystem,
artifacts: Artifacts.test(localEngine: 'out/android_x64'), artifacts: Artifacts.testLocalEngine(localEngine: 'out/android_x64', localEngineHost: 'out/host_release'),
usage: testUsage, usage: testUsage,
gradleUtils: FakeGradleUtils(), gradleUtils: FakeGradleUtils(),
platform: FakePlatform(), platform: FakePlatform(),
...@@ -1850,6 +1857,7 @@ unknown crash ...@@ -1850,6 +1857,7 @@ unknown crash
'-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0', '-Plocal-engine-repo=/.tmp_rand0/flutter_tool_local_engine_repo.rand0',
'-Plocal-engine-build-mode=release', '-Plocal-engine-build-mode=release',
'-Plocal-engine-out=out/android_x64', '-Plocal-engine-out=out/android_x64',
'-Plocal-engine-host-out=out/host_release',
'-Ptarget-platform=android-x64', '-Ptarget-platform=android-x64',
'assembleAarRelease', 'assembleAarRelease',
], ],
......
...@@ -211,7 +211,7 @@ void main() { ...@@ -211,7 +211,7 @@ void main() {
setUp(() { setUp(() {
fs = MemoryFileSystem.test(); fs = MemoryFileSystem.test();
localEngineArtifacts = Artifacts.test(localEngine: 'out/android_arm'); localEngineArtifacts = Artifacts.testLocalEngine(localEngine: 'out/android_arm', localEngineHost: 'out/host_release');
}); });
void testUsingAndroidContext(String description, dynamic Function() testMethod) { void testUsingAndroidContext(String description, dynamic Function() testMethod) {
......
...@@ -104,17 +104,17 @@ void main() { ...@@ -104,17 +104,17 @@ void main() {
testWithoutContext('defaultIOSArchsForEnvironment', () { testWithoutContext('defaultIOSArchsForEnvironment', () {
expect(defaultIOSArchsForEnvironment( expect(defaultIOSArchsForEnvironment(
EnvironmentType.physical, EnvironmentType.physical,
Artifacts.test(localEngine: 'ios_debug_unopt'), Artifacts.testLocalEngine(localEngineHost: 'host_debug_unopt', localEngine: 'ios_debug_unopt'),
).single, DarwinArch.arm64); ).single, DarwinArch.arm64);
expect(defaultIOSArchsForEnvironment( expect(defaultIOSArchsForEnvironment(
EnvironmentType.simulator, EnvironmentType.simulator,
Artifacts.test(localEngine: 'ios_debug_sim_unopt'), Artifacts.testLocalEngine(localEngineHost: 'host_debug_unopt', localEngine: 'ios_debug_sim_unopt'),
).single, DarwinArch.x86_64); ).single, DarwinArch.x86_64);
expect(defaultIOSArchsForEnvironment( expect(defaultIOSArchsForEnvironment(
EnvironmentType.simulator, EnvironmentType.simulator,
Artifacts.test(localEngine: 'ios_debug_sim_unopt_arm64'), Artifacts.testLocalEngine(localEngineHost: 'host_debug_unopt', localEngine: 'ios_debug_sim_unopt_arm64'),
).single, DarwinArch.arm64); ).single, DarwinArch.arm64);
expect(defaultIOSArchsForEnvironment( expect(defaultIOSArchsForEnvironment(
...@@ -128,11 +128,11 @@ void main() { ...@@ -128,11 +128,11 @@ void main() {
testWithoutContext('defaultMacOSArchsForEnvironment', () { testWithoutContext('defaultMacOSArchsForEnvironment', () {
expect(defaultMacOSArchsForEnvironment( expect(defaultMacOSArchsForEnvironment(
Artifacts.test(localEngine: 'host_debug_unopt'), Artifacts.testLocalEngine(localEngineHost: 'host_debug_unopt', localEngine: 'host_debug_unopt'),
).single, DarwinArch.x86_64); ).single, DarwinArch.x86_64);
expect(defaultMacOSArchsForEnvironment( expect(defaultMacOSArchsForEnvironment(
Artifacts.test(localEngine: 'host_debug_unopt_arm64'), Artifacts.testLocalEngine(localEngineHost: 'host_debug_unopt', localEngine: 'host_debug_unopt_arm64'),
).single, DarwinArch.arm64); ).single, DarwinArch.arm64);
expect(defaultMacOSArchsForEnvironment( expect(defaultMacOSArchsForEnvironment(
......
...@@ -754,7 +754,7 @@ Information about project "Runner": ...@@ -754,7 +754,7 @@ Information about project "Runner":
setUp(() { setUp(() {
fs = MemoryFileSystem.test(); fs = MemoryFileSystem.test();
localIosArtifacts = Artifacts.test(localEngine: 'out/ios_profile_arm64'); localIosArtifacts = Artifacts.testLocalEngine(localEngine: 'out/ios_profile_arm64', localEngineHost: 'out/host_release');
macOS = FakePlatform(operatingSystem: 'macos'); macOS = FakePlatform(operatingSystem: 'macos');
fs.file(xcodebuild).createSync(recursive: true); fs.file(xcodebuild).createSync(recursive: true);
}); });
...@@ -938,7 +938,7 @@ Build settings for action build and target plugin2: ...@@ -938,7 +938,7 @@ Build settings for action build and target plugin2:
} }
testUsingOsxContext('exits when armv7 local engine is set', () async { testUsingOsxContext('exits when armv7 local engine is set', () async {
localIosArtifacts = Artifacts.test(localEngine: 'out/ios_profile_arm'); localIosArtifacts = Artifacts.testLocalEngine(localEngine: 'out/ios_profile_arm', localEngineHost: 'out/host_release');
const BuildInfo buildInfo = BuildInfo.debug; const BuildInfo buildInfo = BuildInfo.debug;
final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project')); final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project'));
await expectLater(() => await expectLater(() =>
...@@ -971,7 +971,7 @@ Build settings for action build and target plugin2: ...@@ -971,7 +971,7 @@ Build settings for action build and target plugin2:
final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync();
expect(buildPhaseScriptContents.contains('export "ARCHS=arm64"'), isTrue); expect(buildPhaseScriptContents.contains('export "ARCHS=arm64"'), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(localEngine: 'out/host_profile_arm64'), Artifacts: () => Artifacts.testLocalEngine(localEngine: 'out/host_profile_arm64', localEngineHost: 'out/host_release'),
Platform: () => macOS, Platform: () => macOS,
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -998,7 +998,7 @@ Build settings for action build and target plugin2: ...@@ -998,7 +998,7 @@ Build settings for action build and target plugin2:
final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync();
expect(buildPhaseScriptContents.contains('export "ARCHS=x86_64"'), isTrue); expect(buildPhaseScriptContents.contains('export "ARCHS=x86_64"'), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(localEngine: 'out/host_profile'), Artifacts: () => Artifacts.testLocalEngine(localEngine: 'out/host_profile', localEngineHost: 'out/host_release'),
Platform: () => macOS, Platform: () => macOS,
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -1083,7 +1083,7 @@ Build settings for action build and target plugin2: ...@@ -1083,7 +1083,7 @@ Build settings for action build and target plugin2:
final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync();
expect(buildPhaseScriptContents.contains('ARCHS=x86_64'), isTrue); expect(buildPhaseScriptContents.contains('ARCHS=x86_64'), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(localEngine: 'out/ios_debug_sim_unopt'), Artifacts: () => Artifacts.testLocalEngine(localEngine: 'out/ios_debug_sim_unopt', localEngineHost: 'out/host_debug_unopt'),
Platform: () => macOS, Platform: () => macOS,
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -1109,7 +1109,7 @@ Build settings for action build and target plugin2: ...@@ -1109,7 +1109,7 @@ Build settings for action build and target plugin2:
final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync();
expect(buildPhaseScriptContents.contains('ARCHS=arm64'), isTrue); expect(buildPhaseScriptContents.contains('ARCHS=arm64'), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(localEngine: 'out/ios_debug_sim_arm64'), Artifacts: () => Artifacts.testLocalEngine(localEngine: 'out/ios_debug_sim_arm64', localEngineHost: 'out/host_debug_unopt'),
Platform: () => macOS, Platform: () => macOS,
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
......
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