Commit e7f13616 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Update artifact names and remove obsolete artifacts (#9091)

parent e0670412
...@@ -9,13 +9,11 @@ import 'build_info.dart'; ...@@ -9,13 +9,11 @@ import 'build_info.dart';
import 'globals.dart'; import 'globals.dart';
enum Artifact { enum Artifact {
icudtlDat,
libskyShellSo,
dartIoEntriesTxt, dartIoEntriesTxt,
dartVmEntryPointsTxt, dartVmEntryPointsTxt,
dartVmEntryPointsAndroidTxt, dartVmEntryPointsAndroidTxt,
genSnapshot, genSnapshot,
skyShell, flutterTester,
snapshotDart, snapshotDart,
flutterFramework, flutterFramework,
vmSnapshotData, vmSnapshotData,
...@@ -24,10 +22,6 @@ enum Artifact { ...@@ -24,10 +22,6 @@ enum Artifact {
String _artifactToFileName(Artifact artifact) { String _artifactToFileName(Artifact artifact) {
switch (artifact) { switch (artifact) {
case Artifact.icudtlDat:
return 'icudtl.dat';
case Artifact.libskyShellSo:
return 'libsky_shell.so';
case Artifact.dartIoEntriesTxt: case Artifact.dartIoEntriesTxt:
return 'dart_io_entries.txt'; return 'dart_io_entries.txt';
case Artifact.dartVmEntryPointsTxt: case Artifact.dartVmEntryPointsTxt:
...@@ -36,7 +30,7 @@ String _artifactToFileName(Artifact artifact) { ...@@ -36,7 +30,7 @@ String _artifactToFileName(Artifact artifact) {
return 'dart_vm_entry_points_android.txt'; return 'dart_vm_entry_points_android.txt';
case Artifact.genSnapshot: case Artifact.genSnapshot:
return 'gen_snapshot'; return 'gen_snapshot';
case Artifact.skyShell: case Artifact.flutterTester:
return 'flutter_tester'; return 'flutter_tester';
case Artifact.snapshotDart: case Artifact.snapshotDart:
return 'snapshot.dart'; return 'snapshot.dart';
...@@ -98,9 +92,6 @@ class CachedArtifacts extends Artifacts { ...@@ -98,9 +92,6 @@ class CachedArtifacts extends Artifacts {
String _getAndroidArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) { String _getAndroidArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) {
final String engineDir = _getEngineArtifactsPath(platform, mode); final String engineDir = _getEngineArtifactsPath(platform, mode);
switch (artifact) { switch (artifact) {
case Artifact.icudtlDat:
case Artifact.libskyShellSo:
return fs.path.join(engineDir, _artifactToFileName(artifact));
case Artifact.dartIoEntriesTxt: case Artifact.dartIoEntriesTxt:
case Artifact.dartVmEntryPointsTxt: case Artifact.dartVmEntryPointsTxt:
case Artifact.dartVmEntryPointsAndroidTxt: case Artifact.dartVmEntryPointsAndroidTxt:
...@@ -137,14 +128,13 @@ class CachedArtifacts extends Artifacts { ...@@ -137,14 +128,13 @@ class CachedArtifacts extends Artifacts {
// For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for // For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
// android_arm in profile mode because it is available on all supported host platforms. // android_arm in profile mode because it is available on all supported host platforms.
return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile); return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile);
case Artifact.skyShell: case Artifact.flutterTester:
if (platform == TargetPlatform.windows_x64) if (platform == TargetPlatform.windows_x64)
throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.'); throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.');
continue fallThrough; continue fallThrough;
fallThrough: fallThrough:
case Artifact.vmSnapshotData: case Artifact.vmSnapshotData:
case Artifact.isolateSnapshotData: case Artifact.isolateSnapshotData:
case Artifact.icudtlDat:
final String engineArtifactsPath = cache.getArtifactDirectory('engine').path; final String engineArtifactsPath = cache.getArtifactDirectory('engine').path;
final String platformDirName = getNameForTargetPlatform(platform); final String platformDirName = getNameForTargetPlatform(platform);
return fs.path.join(engineArtifactsPath, platformDirName, _artifactToFileName(artifact)); return fs.path.join(engineArtifactsPath, platformDirName, _artifactToFileName(artifact));
...@@ -206,17 +196,13 @@ class LocalEngineArtifacts extends Artifacts { ...@@ -206,17 +196,13 @@ class LocalEngineArtifacts extends Artifacts {
return fs.path.join(_engineSrcPath, 'flutter', 'runtime', _artifactToFileName(artifact)); return fs.path.join(_engineSrcPath, 'flutter', 'runtime', _artifactToFileName(artifact));
case Artifact.snapshotDart: case Artifact.snapshotDart:
return fs.path.join(_engineSrcPath, 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); return fs.path.join(_engineSrcPath, 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact));
case Artifact.libskyShellSo:
final String abi = _getAbiDirectory(platform);
return fs.path.join(engineOutPath, 'gen', 'flutter', 'shell', 'platform', 'android', 'android', fs.path.join('android', 'libs', abi, _artifactToFileName(artifact)));
case Artifact.genSnapshot: case Artifact.genSnapshot:
return _genSnapshotPath(platform, mode); return _genSnapshotPath(platform, mode);
case Artifact.skyShell: case Artifact.flutterTester:
return _skyShellPath(platform); return _flutterTesterPath(platform);
case Artifact.isolateSnapshotData: case Artifact.isolateSnapshotData:
case Artifact.vmSnapshotData: case Artifact.vmSnapshotData:
return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact));
case Artifact.icudtlDat:
case Artifact.flutterFramework: case Artifact.flutterFramework:
return fs.path.join(engineOutPath, _artifactToFileName(artifact)); return fs.path.join(engineOutPath, _artifactToFileName(artifact));
} }
...@@ -239,25 +225,12 @@ class LocalEngineArtifacts extends Artifacts { ...@@ -239,25 +225,12 @@ class LocalEngineArtifacts extends Artifacts {
return fs.path.join(engineOutPath, clang, _artifactToFileName(Artifact.genSnapshot)); return fs.path.join(engineOutPath, clang, _artifactToFileName(Artifact.genSnapshot));
} }
String _skyShellPath(TargetPlatform platform) { String _flutterTesterPath(TargetPlatform platform) {
if (getCurrentHostPlatform() == HostPlatform.linux_x64) { if (getCurrentHostPlatform() == HostPlatform.linux_x64) {
return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skyShell)); return fs.path.join(engineOutPath, _artifactToFileName(Artifact.flutterTester));
} else if (getCurrentHostPlatform() == HostPlatform.darwin_x64) { } else if (getCurrentHostPlatform() == HostPlatform.darwin_x64) {
return fs.path.join(engineOutPath, 'SkyShell.app', 'Contents', 'MacOS', 'SkyShell'); return fs.path.join(engineOutPath, 'FlutterTester.app', 'Contents', 'MacOS', 'FlutterTester');
} }
throw new Exception('Unsupported platform $platform.'); throw new Exception('Unsupported platform $platform.');
} }
String _getAbiDirectory(TargetPlatform platform) {
switch (platform) {
case TargetPlatform.android_arm:
return 'armeabi-v7a';
case TargetPlatform.android_x64:
return 'x86_64';
case TargetPlatform.android_x86:
return 'x86';
default:
throw new Exception('Unsupported platform $platform.');
}
}
} }
...@@ -197,7 +197,7 @@ class TestCommand extends FlutterCommand { ...@@ -197,7 +197,7 @@ class TestCommand extends FlutterCommand {
} }
testArgs.addAll(files); testArgs.addAll(files);
final String shellPath = artifacts.getArtifactPath(Artifact.skyShell); final String shellPath = artifacts.getArtifactPath(Artifact.flutterTester);
if (!fs.isFileSync(shellPath)) if (!fs.isFileSync(shellPath))
throwToolExit('Cannot find Flutter shell at $shellPath'); throwToolExit('Cannot find Flutter shell at $shellPath');
loader.installHook( loader.installHook(
......
...@@ -27,17 +27,13 @@ void main() { ...@@ -27,17 +27,13 @@ void main() {
}); });
testUsingContext('getArtifactPath', () { testUsingContext('getArtifactPath', () {
expect(
artifacts.getArtifactPath(Artifact.libskyShellSo, TargetPlatform.android_arm, BuildMode.debug),
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'android-arm', 'libsky_shell.so')
);
expect( expect(
artifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, BuildMode.release), artifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, BuildMode.release),
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'ios-release', 'Flutter.framework') fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'ios-release', 'Flutter.framework')
); );
expect( expect(
artifacts.getArtifactPath(Artifact.skyShell), artifacts.getArtifactPath(Artifact.flutterTester),
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'linux-x64', 'flutter_tester') fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'linux-x64', 'flutter_tester')
); );
}, overrides: <Type, Generator> { }, overrides: <Type, Generator> {
...@@ -90,7 +86,7 @@ void main() { ...@@ -90,7 +86,7 @@ void main() {
); );
expect( expect(
artifacts.getArtifactPath(Artifact.skyShell), artifacts.getArtifactPath(Artifact.flutterTester),
fs.path.join(tempDir.path, 'out', 'android_debug_unopt', 'flutter_tester') fs.path.join(tempDir.path, 'out', 'android_debug_unopt', 'flutter_tester')
); );
}, overrides: <Type, Generator> { }, overrides: <Type, Generator> {
......
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