Skip to content

Commit cf1b571

Browse files
authored
Remove package root (dart-archive/platform#38)
Merging on behalf of @mit-mit
1 parent d8e96ef commit cf1b571

File tree

7 files changed

+7
-34
lines changed

7 files changed

+7
-34
lines changed

pkgs/platform/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 3.1.0
2+
3+
* Removed `Platform.packageRoot`, which was already marked deprecated, and which
4+
didn't work in Dart 2.
5+
16
### 3.0.2
27

38
* Added `FakePlatform.copyWith` function.

pkgs/platform/lib/src/interface/local_platform.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ class LocalPlatform extends Platform {
4141
@override
4242
List<String> get executableArguments => io.Platform.executableArguments;
4343

44-
@override
45-
String? get packageRoot => null;
46-
4744
@override
4845
String? get packageConfig => io.Platform.packageConfig;
4946

pkgs/platform/lib/src/interface/platform.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@ abstract class Platform {
159159
/// list containing the flags passed to the executable.
160160
List<String> get executableArguments;
161161

162-
/// Deprecated, do not use.
163-
///
164-
/// This used to be the value of the `--package-root` flag passed to the
165-
/// executable used to run the script in this isolate, but is no longer
166-
/// supported in Dart 2.
167-
///
168-
/// Always returns null.
169-
@Deprecated('packages/ directory resolution is not supported in Dart 2.')
170-
String? get packageRoot;
171-
172162
/// The value of the `--packages` flag passed to the executable
173163
/// used to run the script in this isolate. This is the configuration which
174164
/// specifies how Dart packages are looked up.
@@ -205,8 +195,6 @@ abstract class Platform {
205195
'resolvedExecutable': resolvedExecutable,
206196
'script': script.toString(),
207197
'executableArguments': executableArguments,
208-
'packageRoot':
209-
packageRoot, // ignore: deprecated_member_use_from_same_package
210198
'packageConfig': packageConfig,
211199
'version': version,
212200
'stdinSupportsAnsi': stdinSupportsAnsi,

pkgs/platform/lib/src/testing/fake_platform.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class FakePlatform extends Platform {
2424
String? resolvedExecutable,
2525
Uri? script,
2626
List<String>? executableArguments,
27-
this.packageRoot,
2827
this.packageConfig,
2928
String? version,
3029
bool? stdinSupportsAnsi,
@@ -58,8 +57,6 @@ class FakePlatform extends Platform {
5857
_resolvedExecutable = platform.resolvedExecutable,
5958
_script = platform.script,
6059
_executableArguments = List<String>.from(platform.executableArguments),
61-
packageRoot = platform
62-
.packageRoot, // ignore: deprecated_member_use_from_same_package
6360
packageConfig = platform.packageConfig,
6461
_version = platform.version,
6562
_stdinSupportsAnsi = platform.stdinSupportsAnsi,
@@ -84,7 +81,6 @@ class FakePlatform extends Platform {
8481
resolvedExecutable: map['resolvedExecutable'],
8582
script: Uri.parse(map['script']),
8683
executableArguments: map['executableArguments'].cast<String>(),
87-
packageRoot: map['packageRoot'],
8884
packageConfig: map['packageConfig'],
8985
version: map['version'],
9086
stdinSupportsAnsi: map['stdinSupportsAnsi'],
@@ -105,7 +101,6 @@ class FakePlatform extends Platform {
105101
String? resolvedExecutable,
106102
Uri? script,
107103
List<String>? executableArguments,
108-
String? packageRoot,
109104
String? packageConfig,
110105
String? version,
111106
bool? stdinSupportsAnsi,
@@ -124,7 +119,6 @@ class FakePlatform extends Platform {
124119
resolvedExecutable: resolvedExecutable ?? this.resolvedExecutable,
125120
script: script ?? this.script,
126121
executableArguments: executableArguments ?? this.executableArguments,
127-
packageRoot: packageRoot ?? this.packageRoot,
128122
packageConfig: packageConfig ?? this.packageConfig,
129123
version: version ?? this.version,
130124
stdinSupportsAnsi: stdinSupportsAnsi ?? this.stdinSupportsAnsi,
@@ -173,9 +167,6 @@ class FakePlatform extends Platform {
173167
List<String> get executableArguments => _throwIfNull(_executableArguments);
174168
List<String>? _executableArguments;
175169

176-
@override
177-
String? packageRoot;
178-
179170
@override
180171
String? packageConfig;
181172

pkgs/platform/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: platform
2-
version: 3.0.2
2+
version: 3.1.0
33
description: A pluggable, mockable platform abstraction for Dart.
44
homepage: https://github.com/google/platform.dart
55

66
environment:
7-
sdk: '>=2.12.0 <3.0.0'
7+
sdk: ">=2.12.0 <3.0.0"
88

99
dev_dependencies:
1010
lints: ^1.0.1

pkgs/platform/test/fake_platform_test.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ void _expectPlatformsEqual(Platform actual, Platform expected) {
1818
expect(actual.resolvedExecutable, expected.resolvedExecutable);
1919
expect(actual.script, expected.script);
2020
expect(actual.executableArguments, expected.executableArguments);
21-
expect(
22-
actual.packageRoot, // ignore: deprecated_member_use_from_same_package
23-
expected.packageRoot); // ignore: deprecated_member_use_from_same_package
2421
expect(actual.packageConfig, expected.packageConfig);
2522
expect(actual.version, expected.version);
2623
expect(actual.localeName, expected.localeName);
@@ -78,8 +75,6 @@ void main() {
7875
expect(copy.resolvedExecutable, local.resolvedExecutable);
7976
expect(copy.script, local.script);
8077
expect(copy.executableArguments, local.executableArguments);
81-
// ignore: deprecated_member_use_from_same_package
82-
expect(copy.packageRoot, local.packageRoot);
8378
expect(copy.packageConfig, local.packageConfig);
8479
expect(copy.version, local.version);
8580
expect(copy.localeName, local.localeName);
@@ -112,7 +107,6 @@ void main() {
112107
resolvedExecutable: local.resolvedExecutable,
113108
script: local.script,
114109
executableArguments: local.executableArguments,
115-
packageRoot: local.packageRoot,
116110
packageConfig: local.packageConfig,
117111
version: local.version,
118112
stdinSupportsAnsi: local.stdinSupportsAnsi,
@@ -140,7 +134,6 @@ void main() {
140134
expect(fake.resolvedExecutable, '/bin/dart');
141135
expect(fake.script, Uri.file('/platform/test/fake_platform_test.dart'));
142136
expect(fake.executableArguments, <String>['--checked']);
143-
expect(fake.packageRoot, null);
144137
expect(fake.packageConfig, null);
145138
expect(fake.version, '1.22.0');
146139
expect(fake.localeName, 'de/de');

pkgs/platform/test/platform.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"executableArguments": [
1515
"--checked"
1616
],
17-
"packageRoot": null,
1817
"packageConfig": null,
1918
"version": "1.22.0",
2019
"localeName": "de/de"

0 commit comments

Comments
 (0)