Revert "[Windows] Allow overwriting the cache's Dart SDK archive license file" (#132773)
Reverts flutter/flutter#132669 Introduced failure on `windows/mac/linux framework_library_tests`. ``` 05:41 +7318 ~22 -1: /b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_bar_theme_test.dart: (tearDownAll) [E] Expected: leak free Actual: <Instance of 'Leaks'> Which: contains leaks: # The text is generated by leak_tracker. # For leak troubleshooting tips open: # https://github.com/dart-lang/leak_tracker/blob/main/doc/TROUBLESHOOT.md notDisposed: total: 3 objects: ValueNotifier<_OverlayEntryWidgetState?>: test: Constructor parameters override theme parameters identityHashCode: 407433615 FocusScopeNode: test: Constructor parameters override theme parameters identityHashCode: 513181650 FocusScopeNode: test: Constructor parameters override theme parameters identityHashCode: 704743556 package:matcher expect package:flutter_test/src/widget_tester.dart 458:18 expect package:leak_tracker_flutter_testing/src/leak_tracking_flutter_testing.dart 81:5 _tearDownTestingWithLeakTracking ===== asynchronous gap =========================== dart:async _CustomZone.registerBinaryCallback package:leak_tracker_flutter_testing/src/leak_tracking_flutter_testing.dart 59:9 configureLeakTrackingTearDown.<fn> ```
This commit is contained in:
@@ -18,7 +18,6 @@ $flutterRoot = (Get-Item $progName).parent.parent.FullName
|
||||
|
||||
$cachePath = "$flutterRoot\bin\cache"
|
||||
$dartSdkPath = "$cachePath\dart-sdk"
|
||||
$dartSdkLicense = "$cachePath\LICENSE.dart_sdk_archive.md"
|
||||
$engineStamp = "$cachePath\engine-dart-sdk.stamp"
|
||||
$engineVersion = (Get-Content "$flutterRoot\bin\internal\engine.version")
|
||||
$engineRealm = (Get-Content "$flutterRoot\bin\internal\engine.realm")
|
||||
@@ -50,18 +49,11 @@ if ($engineRealm) {
|
||||
$dartZipName = "dart-sdk-windows-x64.zip"
|
||||
$dartSdkUrl = "$dartSdkBaseUrl/flutter_infra_release/flutter/$engineVersion/$dartZipName"
|
||||
|
||||
if ((Test-Path $dartSdkPath) -or (Test-Path $dartSdkLicense)) {
|
||||
if (Test-Path $dartSdkPath) {
|
||||
# Move old SDK to a new location instead of deleting it in case it is still in use (e.g. by IntelliJ).
|
||||
$oldDartSdkSuffix = 1
|
||||
while (Test-Path "$cachePath\$oldDartSdkPrefix$oldDartSdkSuffix") { $oldDartSdkSuffix++ }
|
||||
|
||||
if (Test-Path $dartSdkPath) {
|
||||
Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
|
||||
}
|
||||
|
||||
if (Test-Path $dartSdkLicense) {
|
||||
Rename-Item $dartSdkLicense "$oldDartSdkPrefix$oldDartSdkSuffix.LICENSE.md"
|
||||
}
|
||||
Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
|
||||
}
|
||||
New-Item $dartSdkPath -force -type directory | Out-Null
|
||||
$dartSdkZip = "$cachePath\$dartZipName"
|
||||
@@ -106,5 +98,5 @@ If (Get-Command 7z -errorAction SilentlyContinue) {
|
||||
Remove-Item $dartSdkZip
|
||||
$engineVersion | Out-File $engineStamp -Encoding ASCII
|
||||
|
||||
# Try to delete all old SDKs and license files.
|
||||
# Try to delete all old SDKs.
|
||||
Get-ChildItem -Path $cachePath | Where {$_.BaseName.StartsWith($oldDartSdkPrefix)} | Remove-Item -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
Reference in New Issue
Block a user