Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions packages/flutter_tools/lib/src/artifacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ enum Artifact {
genSnapshot,
/// The flutter tester binary.
flutterTester,
snapshotDart,
flutterFramework,
/// The framework directory of the macOS desktop.
flutterMacOSFramework,
Expand Down Expand Up @@ -73,8 +72,6 @@ String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMo
return 'gen_snapshot';
case Artifact.flutterTester:
return 'flutter_tester$exe';
case Artifact.snapshotDart:
return 'snapshot.dart';
case Artifact.flutterFramework:
return 'Flutter.framework';
case Artifact.flutterMacOSFramework:
Expand Down Expand Up @@ -155,9 +152,8 @@ class EngineBuildPaths {

// Manages the engine artifacts of Flutter.
abstract class Artifacts {
static LocalEngineArtifacts getLocalEngine(String engineSrcPath, EngineBuildPaths engineBuildPaths) {
static LocalEngineArtifacts getLocalEngine(EngineBuildPaths engineBuildPaths) {
return LocalEngineArtifacts(
engineSrcPath,
engineBuildPaths.targetEngine,
engineBuildPaths.hostEngine,
cache: globals.cache,
Expand Down Expand Up @@ -247,7 +243,6 @@ class CachedArtifacts extends Artifacts {
String _getIosArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) {
switch (artifact) {
case Artifact.genSnapshot:
case Artifact.snapshotDart:
case Artifact.flutterFramework:
case Artifact.frontendServerSnapshotForEngineDartSdk:
final String artifactFileName = _artifactToFileName(artifact);
Expand Down Expand Up @@ -441,7 +436,6 @@ HostPlatform _currentHostPlatformAsHost(Platform platform) {
/// Manages the artifacts of a locally built engine.
class LocalEngineArtifacts extends Artifacts {
LocalEngineArtifacts(
this._engineSrcPath,
this.engineOutPath,
this._hostEngineOutPath, {
@required FileSystem fileSystem,
Expand All @@ -453,7 +447,6 @@ class LocalEngineArtifacts extends Artifacts {
_processManager = processManager,
_platform = platform;

final String _engineSrcPath;
final String engineOutPath; // TODO(goderbauer): This should be private.
final String _hostEngineOutPath;
final FileSystem _fileSystem;
Expand All @@ -466,8 +459,6 @@ class LocalEngineArtifacts extends Artifacts {
platform ??= _currentHostPlatform(_platform);
final String artifactFileName = _artifactToFileName(artifact, platform, mode);
switch (artifact) {
case Artifact.snapshotDart:
return _fileSystem.path.join(_engineSrcPath, 'flutter', 'lib', 'snapshot', artifactFileName);
case Artifact.genSnapshot:
return _genSnapshotPath();
case Artifact.flutterTester:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class FlutterCommandRunner extends CommandRunner<void> {
final String enginePath = _findEnginePath(topLevelResults);
if (enginePath != null) {
contextOverrides.addAll(<Type, dynamic>{
Artifacts: Artifacts.getLocalEngine(enginePath, _findEngineBuildPath(topLevelResults, enginePath)),
Artifacts: Artifacts.getLocalEngine(_findEngineBuildPath(topLevelResults, enginePath)),
});
}

Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/test/general.shard/artifacts_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void main() {
logger: BufferLogger.test(),
osUtils: MockOperatingSystemUtils(),
);
artifacts = LocalEngineArtifacts(fileSystem.currentDirectory.path,
artifacts = LocalEngineArtifacts(
fileSystem.path.join(fileSystem.currentDirectory.path, 'out', 'android_debug_unopt'),
fileSystem.path.join(fileSystem.currentDirectory.path, 'out', 'host_debug_unopt'),
cache: cache,
Expand Down Expand Up @@ -128,7 +128,7 @@ void main() {
});

testWithoutContext('Looks up dart.exe on windows platforms', () async {
artifacts = LocalEngineArtifacts(fileSystem.currentDirectory.path,
artifacts = LocalEngineArtifacts(
fileSystem.path.join(fileSystem.currentDirectory.path, 'out', 'android_debug_unopt'),
fileSystem.path.join(fileSystem.currentDirectory.path, 'out', 'host_debug_unopt'),
cache: cache,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ void main() {
mockArtifacts = MockArtifacts();
mockXcode = MockXcode();
when(mockXcode.sdkLocation(any)).thenAnswer((_) => Future<String>.value(kSDKPath));

for (final BuildMode mode in BuildMode.values) {
when(mockArtifacts.getArtifactPath(Artifact.snapshotDart,
platform: anyNamed('platform'), mode: mode)).thenReturn(kSnapshotDart);
}
});

final Map<Type, Generator> contextOverrides = <Type, Generator>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void main() {
equals('Flutter.framework not found at ios_profile/Flutter.framework'),
);
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down Expand Up @@ -66,7 +66,7 @@ void main() {
'Expected a string like "Apple (LLVM|clang) #.#.# (clang-####.#.##.#)".'),
);
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down Expand Up @@ -94,7 +94,7 @@ void main() {
await validateBitcode(BuildMode.profile, TargetPlatform.ios);

}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand All @@ -121,7 +121,7 @@ void main() {

await validateBitcode(BuildMode.profile, TargetPlatform.ios);
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down Expand Up @@ -154,7 +154,7 @@ void main() {
'of Xcode to at least 10.0.1.'),
);
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down Expand Up @@ -183,7 +183,7 @@ void main() {

expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down Expand Up @@ -212,7 +212,7 @@ void main() {

expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
Artifacts: () => LocalEngineArtifacts('/engine', 'ios_profile', 'host_profile',
Artifacts: () => LocalEngineArtifacts('ios_profile', 'host_profile',
fileSystem: memoryFileSystem,
cache: globals.cache,
platform: globals.platform,
Expand Down