Unverified Commit cdc2d990 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub
parent 9529d678
...@@ -413,7 +413,7 @@ class DebugAssetServer extends AssetServer { ...@@ -413,7 +413,7 @@ class DebugAssetServer extends AssetServer {
)); ));
if (dart2jsArchive.existsSync()) { if (dart2jsArchive.existsSync()) {
final Archive archive = TarDecoder().decodeBytes(dart2jsArchive.readAsBytesSync()); final Archive archive = TarDecoder().decodeBytes(dart2jsArchive.readAsBytesSync());
partFiles = fs.systemTempDirectory.createTempSync('_flutter_tool') partFiles = fs.systemTempDirectory.createTempSync('flutter_tool.')
..createSync(); ..createSync();
for (ArchiveFile file in archive) { for (ArchiveFile file in archive) {
partFiles.childFile(file.name).writeAsBytesSync(file.content); partFiles.childFile(file.name).writeAsBytesSync(file.content);
......
...@@ -885,7 +885,7 @@ class AndroidMavenArtifacts extends ArtifactSet { ...@@ -885,7 +885,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
@override @override
Future<void> update() async { Future<void> update() async {
final Directory tempDir = final Directory tempDir =
fs.systemTempDirectory.createTempSync('gradle_wrapper.'); fs.systemTempDirectory.createTempSync('flutter_gradle_wrapper.');
injectGradleWrapperIfNeeded(tempDir); injectGradleWrapperIfNeeded(tempDir);
final Status status = logger.startProgress('Downloading Android Maven dependencies...', final Status status = logger.startProgress('Downloading Android Maven dependencies...',
......
...@@ -545,7 +545,7 @@ abstract class ResidentRunner { ...@@ -545,7 +545,7 @@ abstract class ResidentRunner {
packagesFilePath = packagesFilePath ?? fs.path.absolute(PackageMap.globalPackagesPath), packagesFilePath = packagesFilePath ?? fs.path.absolute(PackageMap.globalPackagesPath),
_dillOutputPath = dillOutputPath, _dillOutputPath = dillOutputPath,
artifactDirectory = dillOutputPath == null artifactDirectory = dillOutputPath == null
? fs.systemTempDirectory.createTempSync('_fluttter_tool') ? fs.systemTempDirectory.createTempSync('flutter_tool.')
: fs.file(dillOutputPath).parent, : fs.file(dillOutputPath).parent,
assetBundle = AssetBundleFactory.instance.createBundle() { assetBundle = AssetBundleFactory.instance.createBundle() {
if (!artifactDirectory.existsSync()) { if (!artifactDirectory.existsSync()) {
......
...@@ -63,7 +63,7 @@ Future<int> runTests( ...@@ -63,7 +63,7 @@ Future<int> runTests(
]; ];
if (web) { if (web) {
final String tempBuildDir = fs.systemTempDirectory final String tempBuildDir = fs.systemTempDirectory
.createTempSync('_flutter_test') .createTempSync('flutter_test.')
.absolute .absolute
.uri .uri
.toFilePath(); .toFilePath();
......
...@@ -89,7 +89,7 @@ class ChromeLauncher { ...@@ -89,7 +89,7 @@ class ChromeLauncher {
/// `skipCheck` does not attempt to make a devtools connection before returning. /// `skipCheck` does not attempt to make a devtools connection before returning.
Future<Chrome> launch(String url, { bool headless = false, bool skipCheck = false }) async { Future<Chrome> launch(String url, { bool headless = false, bool skipCheck = false }) async {
final String chromeExecutable = findChromeExecutable(); final String chromeExecutable = findChromeExecutable();
final Directory dataDir = fs.systemTempDirectory.createTempSync('flutter_tool_'); final Directory dataDir = fs.systemTempDirectory.createTempSync('flutter_tool.');
final int port = await os.findFreePort(); final int port = await os.findFreePort();
final List<String> args = <String>[ final List<String> args = <String>[
chromeExecutable, chromeExecutable,
......
...@@ -444,7 +444,7 @@ someOtherTask ...@@ -444,7 +444,7 @@ someOtherTask
setUp(() { setUp(() {
mockLogger = BufferLogger(); mockLogger = BufferLogger();
tempDir = fs.systemTempDirectory.createTempSync('settings_aar_test.'); tempDir = fs.systemTempDirectory.createTempSync('flutter_settings_aar_test.');
}); });
...@@ -852,7 +852,7 @@ flutter: ...@@ -852,7 +852,7 @@ flutter:
setUp(() { setUp(() {
fs = MemoryFileSystem(); fs = MemoryFileSystem();
tempDir = fs.systemTempDirectory.createTempSync('artifacts_test.'); tempDir = fs.systemTempDirectory.createTempSync('flutter_artifacts_test.');
gradleBinary = platform.isWindows ? 'gradlew.bat' : 'gradlew'; gradleBinary = platform.isWindows ? 'gradlew.bat' : 'gradlew';
gradleWrapperDirectory = fs.directory( gradleWrapperDirectory = fs.directory(
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper')); fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper'));
...@@ -960,7 +960,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''; ...@@ -960,7 +960,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
setUp(() { setUp(() {
memoryFileSystem = MemoryFileSystem(); memoryFileSystem = MemoryFileSystem();
tempDir = memoryFileSystem.systemTempDirectory.createTempSync('artifacts_test.'); tempDir = memoryFileSystem.systemTempDirectory.createTempSync('flutter_artifacts_test.');
gradleWrapperDirectory = memoryFileSystem.directory( gradleWrapperDirectory = memoryFileSystem.directory(
memoryFileSystem.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper')); memoryFileSystem.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper'));
gradleWrapperDirectory.createSync(recursive: true); gradleWrapperDirectory.createSync(recursive: true);
...@@ -1157,7 +1157,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''; ...@@ -1157,7 +1157,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
}); });
testUsingContext('returns true when the project is using AndroidX', () async { testUsingContext('returns true when the project is using AndroidX', () async {
final Directory androidDirectory = fs.systemTempDirectory.createTempSync('android.'); final Directory androidDirectory = fs.systemTempDirectory.createTempSync('flutter_android.');
androidDirectory androidDirectory
.childFile('gradle.properties') .childFile('gradle.properties')
...@@ -1170,7 +1170,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''; ...@@ -1170,7 +1170,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
}); });
testUsingContext('returns false when the project is not using AndroidX', () async { testUsingContext('returns false when the project is not using AndroidX', () async {
final Directory androidDirectory = fs.systemTempDirectory.createTempSync('android.'); final Directory androidDirectory = fs.systemTempDirectory.createTempSync('flutter_android.');
androidDirectory androidDirectory
.childFile('gradle.properties') .childFile('gradle.properties')
...@@ -1183,7 +1183,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''; ...@@ -1183,7 +1183,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
}); });
testUsingContext('returns false when gradle.properties does not exist', () async { testUsingContext('returns false when gradle.properties does not exist', () async {
final Directory androidDirectory = fs.systemTempDirectory.createTempSync('android.'); final Directory androidDirectory = fs.systemTempDirectory.createTempSync('flutter_android.');
expect(isAppUsingAndroidX(androidDirectory), isFalse); expect(isAppUsingAndroidX(androidDirectory), isFalse);
...@@ -1313,7 +1313,7 @@ plugin2=${plugin2.path} ...@@ -1313,7 +1313,7 @@ plugin2=${plugin2.path}
mockProcessManager = MockProcessManager(); mockProcessManager = MockProcessManager();
android = fakePlatform('android'); android = fakePlatform('android');
final Directory tempDir = fs.systemTempDirectory.createTempSync('artifacts_test.'); final Directory tempDir = fs.systemTempDirectory.createTempSync('flutter_artifacts_test.');
cache = Cache(rootOverride: tempDir); cache = Cache(rootOverride: tempDir);
final Directory gradleWrapperDirectory = tempDir final Directory gradleWrapperDirectory = tempDir
......
...@@ -107,7 +107,7 @@ void main() { ...@@ -107,7 +107,7 @@ void main() {
.childFile('gradle.properties') .childFile('gradle.properties')
.writeAsStringSync('irrelevant'); .writeAsStringSync('irrelevant');
final Directory gradleWrapperDir = fs.systemTempDirectory.createTempSync('gradle_wrapper.'); final Directory gradleWrapperDir = fs.systemTempDirectory.createTempSync('flutter_application_package_test_gradle_wrapper.');
when(mockCache.getArtifactDirectory('gradle_wrapper')).thenReturn(gradleWrapperDir); when(mockCache.getArtifactDirectory('gradle_wrapper')).thenReturn(gradleWrapperDir);
fs.directory(gradleWrapperDir.childDirectory('gradle').childDirectory('wrapper')) fs.directory(gradleWrapperDir.childDirectory('gradle').childDirectory('wrapper'))
......
...@@ -19,7 +19,7 @@ void main() { ...@@ -19,7 +19,7 @@ void main() {
setUp(() { setUp(() {
memoryFileSystem = MemoryFileSystem(); memoryFileSystem = MemoryFileSystem();
tempDir = memoryFileSystem.systemTempDirectory.createTempSync('artifacts_test.'); tempDir = memoryFileSystem.systemTempDirectory.createTempSync('flutter_artifacts_test.');
}); });
tearDown(() { tearDown(() {
......
...@@ -234,8 +234,8 @@ void main() { ...@@ -234,8 +234,8 @@ void main() {
}); });
testUsingContext('makes binary dirs readable and executable by all', () async { testUsingContext('makes binary dirs readable and executable by all', () async {
final Directory artifactDir = fs.systemTempDirectory.createTempSync('artifact.'); final Directory artifactDir = fs.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
final Directory downloadDir = fs.systemTempDirectory.createTempSync('download.'); final Directory downloadDir = fs.systemTempDirectory.createTempSync('flutter_cache_test_download.');
when(mockCache.getArtifactDirectory(any)).thenReturn(artifactDir); when(mockCache.getArtifactDirectory(any)).thenReturn(artifactDir);
when(mockCache.getDownloadDir()).thenReturn(downloadDir); when(mockCache.getDownloadDir()).thenReturn(downloadDir);
final FakeCachedArtifact artifact = FakeCachedArtifact( final FakeCachedArtifact artifact = FakeCachedArtifact(
...@@ -282,7 +282,7 @@ void main() { ...@@ -282,7 +282,7 @@ void main() {
final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(); final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts();
expect(mavenArtifacts.isUpToDate(), isFalse); expect(mavenArtifacts.isUpToDate(), isFalse);
final Directory gradleWrapperDir = fs.systemTempDirectory.createTempSync('gradle_wrapper.'); final Directory gradleWrapperDir = fs.systemTempDirectory.createTempSync('flutter_cache_test_gradle_wrapper.');
when(mockCache.getArtifactDirectory('gradle_wrapper')).thenReturn(gradleWrapperDir); when(mockCache.getArtifactDirectory('gradle_wrapper')).thenReturn(gradleWrapperDir);
fs.directory(gradleWrapperDir.childDirectory('gradle').childDirectory('wrapper')) fs.directory(gradleWrapperDir.childDirectory('gradle').childDirectory('wrapper'))
......
...@@ -197,7 +197,7 @@ flutter: ...@@ -197,7 +197,7 @@ flutter:
when(androidProject.appManifestFile).thenReturn(androidManifest); when(androidProject.appManifestFile).thenReturn(androidManifest);
final Directory pluginUsingJavaAndNewEmbeddingDir = final Directory pluginUsingJavaAndNewEmbeddingDir =
fs.systemTempDirectory.createTempSync('pluginUsingJavaAndNewEmbeddingDir.'); fs.systemTempDirectory.createTempSync('flutter_plugin_using_java_and_new_embedding_dir.');
pluginUsingJavaAndNewEmbeddingDir pluginUsingJavaAndNewEmbeddingDir
.childFile('pubspec.yaml') .childFile('pubspec.yaml')
.writeAsStringSync(''' .writeAsStringSync('''
...@@ -217,7 +217,7 @@ flutter: ...@@ -217,7 +217,7 @@ flutter:
..writeAsStringSync('import io.flutter.embedding.engine.plugins.FlutterPlugin;'); ..writeAsStringSync('import io.flutter.embedding.engine.plugins.FlutterPlugin;');
final Directory pluginUsingKotlinAndNewEmbeddingDir = final Directory pluginUsingKotlinAndNewEmbeddingDir =
fs.systemTempDirectory.createTempSync('pluginUsingKotlinAndNewEmbeddingDir.'); fs.systemTempDirectory.createTempSync('flutter_plugin_using_kotlin_and_new_embedding_dir.');
pluginUsingKotlinAndNewEmbeddingDir pluginUsingKotlinAndNewEmbeddingDir
.childFile('pubspec.yaml') .childFile('pubspec.yaml')
.writeAsStringSync(''' .writeAsStringSync('''
...@@ -237,7 +237,7 @@ flutter: ...@@ -237,7 +237,7 @@ flutter:
..writeAsStringSync('import io.flutter.embedding.engine.plugins.FlutterPlugin'); ..writeAsStringSync('import io.flutter.embedding.engine.plugins.FlutterPlugin');
final Directory pluginUsingOldEmbeddingDir = final Directory pluginUsingOldEmbeddingDir =
fs.systemTempDirectory.createTempSync('pluginUsingOldEmbeddingDir.'); fs.systemTempDirectory.createTempSync('flutter_plugin_using_old_embedding_dir.');
pluginUsingOldEmbeddingDir pluginUsingOldEmbeddingDir
.childFile('pubspec.yaml') .childFile('pubspec.yaml')
.writeAsStringSync(''' .writeAsStringSync('''
......
...@@ -306,7 +306,7 @@ void main() { ...@@ -306,7 +306,7 @@ void main() {
})); }));
test('ResidentRunner uses temp directory when there is no output dill path', () => testbed.run(() { test('ResidentRunner uses temp directory when there is no output dill path', () => testbed.run(() {
expect(residentRunner.artifactDirectory.path, contains('_fluttter_tool')); expect(residentRunner.artifactDirectory.path, contains('flutter_tool.'));
final ResidentRunner otherRunner = HotRunner( final ResidentRunner otherRunner = HotRunner(
<FlutterDevice>[ <FlutterDevice>[
......
...@@ -15,8 +15,9 @@ import '../src/common.dart'; ...@@ -15,8 +15,9 @@ import '../src/common.dart';
/// underlying path to avoid issues with breakpoints/hot reload. /// underlying path to avoid issues with breakpoints/hot reload.
/// https://github.com/flutter/flutter/pull/21741 /// https://github.com/flutter/flutter/pull/21741
Directory createResolvedTempDirectorySync(String prefix) { Directory createResolvedTempDirectorySync(String prefix) {
final Directory tempDir = fs.systemTempDirectory.createTempSync('flutter_$prefix'); assert(prefix.endsWith('.'));
return fs.directory(tempDir.resolveSymbolicLinksSync()); final Directory tempDirectory = fs.systemTempDirectory.createTempSync('flutter_$prefix');
return fs.directory(tempDirectory.resolveSymbolicLinksSync());
} }
void writeFile(String path, String content) { void writeFile(String path, String content) {
......
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