Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 3.1.0

* Removed `Platform.packageRoot`, which was already marked deprecated, and which
didn't work in Dart 2.

### 3.0.2

* Added `FakePlatform.copyWith` function.
Expand Down
3 changes: 0 additions & 3 deletions lib/src/interface/local_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ class LocalPlatform extends Platform {
@override
List<String> get executableArguments => io.Platform.executableArguments;

@override
String? get packageRoot => null;

@override
String? get packageConfig => io.Platform.packageConfig;

Expand Down
12 changes: 0 additions & 12 deletions lib/src/interface/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ abstract class Platform {
/// list containing the flags passed to the executable.
List<String> get executableArguments;

/// Deprecated, do not use.
///
/// This used to be the value of the `--package-root` flag passed to the
/// executable used to run the script in this isolate, but is no longer
/// supported in Dart 2.
///
/// Always returns null.
@Deprecated('packages/ directory resolution is not supported in Dart 2.')
String? get packageRoot;

/// The value of the `--packages` flag passed to the executable
/// used to run the script in this isolate. This is the configuration which
/// specifies how Dart packages are looked up.
Expand Down Expand Up @@ -205,8 +195,6 @@ abstract class Platform {
'resolvedExecutable': resolvedExecutable,
'script': script.toString(),
'executableArguments': executableArguments,
'packageRoot':
packageRoot, // ignore: deprecated_member_use_from_same_package
'packageConfig': packageConfig,
'version': version,
'stdinSupportsAnsi': stdinSupportsAnsi,
Expand Down
9 changes: 0 additions & 9 deletions lib/src/testing/fake_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class FakePlatform extends Platform {
String? resolvedExecutable,
Uri? script,
List<String>? executableArguments,
this.packageRoot,
this.packageConfig,
String? version,
bool? stdinSupportsAnsi,
Expand Down Expand Up @@ -58,8 +57,6 @@ class FakePlatform extends Platform {
_resolvedExecutable = platform.resolvedExecutable,
_script = platform.script,
_executableArguments = List<String>.from(platform.executableArguments),
packageRoot = platform
.packageRoot, // ignore: deprecated_member_use_from_same_package
packageConfig = platform.packageConfig,
_version = platform.version,
_stdinSupportsAnsi = platform.stdinSupportsAnsi,
Expand All @@ -84,7 +81,6 @@ class FakePlatform extends Platform {
resolvedExecutable: map['resolvedExecutable'],
script: Uri.parse(map['script']),
executableArguments: map['executableArguments'].cast<String>(),
packageRoot: map['packageRoot'],
packageConfig: map['packageConfig'],
version: map['version'],
stdinSupportsAnsi: map['stdinSupportsAnsi'],
Expand All @@ -105,7 +101,6 @@ class FakePlatform extends Platform {
String? resolvedExecutable,
Uri? script,
List<String>? executableArguments,
String? packageRoot,
String? packageConfig,
String? version,
bool? stdinSupportsAnsi,
Expand All @@ -124,7 +119,6 @@ class FakePlatform extends Platform {
resolvedExecutable: resolvedExecutable ?? this.resolvedExecutable,
script: script ?? this.script,
executableArguments: executableArguments ?? this.executableArguments,
packageRoot: packageRoot ?? this.packageRoot,
packageConfig: packageConfig ?? this.packageConfig,
version: version ?? this.version,
stdinSupportsAnsi: stdinSupportsAnsi ?? this.stdinSupportsAnsi,
Expand Down Expand Up @@ -173,9 +167,6 @@ class FakePlatform extends Platform {
List<String> get executableArguments => _throwIfNull(_executableArguments);
List<String>? _executableArguments;

@override
String? packageRoot;

@override
String? packageConfig;

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: platform
version: 3.0.2
version: 3.1.0
description: A pluggable, mockable platform abstraction for Dart.
homepage: https://github.com/google/platform.dart

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.12.0 <3.0.0"

dev_dependencies:
lints: ^1.0.1
Expand Down
7 changes: 0 additions & 7 deletions test/fake_platform_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ void _expectPlatformsEqual(Platform actual, Platform expected) {
expect(actual.resolvedExecutable, expected.resolvedExecutable);
expect(actual.script, expected.script);
expect(actual.executableArguments, expected.executableArguments);
expect(
actual.packageRoot, // ignore: deprecated_member_use_from_same_package
expected.packageRoot); // ignore: deprecated_member_use_from_same_package
expect(actual.packageConfig, expected.packageConfig);
expect(actual.version, expected.version);
expect(actual.localeName, expected.localeName);
Expand Down Expand Up @@ -78,8 +75,6 @@ void main() {
expect(copy.resolvedExecutable, local.resolvedExecutable);
expect(copy.script, local.script);
expect(copy.executableArguments, local.executableArguments);
// ignore: deprecated_member_use_from_same_package
expect(copy.packageRoot, local.packageRoot);
expect(copy.packageConfig, local.packageConfig);
expect(copy.version, local.version);
expect(copy.localeName, local.localeName);
Expand Down Expand Up @@ -112,7 +107,6 @@ void main() {
resolvedExecutable: local.resolvedExecutable,
script: local.script,
executableArguments: local.executableArguments,
packageRoot: local.packageRoot,
packageConfig: local.packageConfig,
version: local.version,
stdinSupportsAnsi: local.stdinSupportsAnsi,
Expand Down Expand Up @@ -140,7 +134,6 @@ void main() {
expect(fake.resolvedExecutable, '/bin/dart');
expect(fake.script, Uri.file('/platform/test/fake_platform_test.dart'));
expect(fake.executableArguments, <String>['--checked']);
expect(fake.packageRoot, null);
expect(fake.packageConfig, null);
expect(fake.version, '1.22.0');
expect(fake.localeName, 'de/de');
Expand Down
1 change: 0 additions & 1 deletion test/platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"executableArguments": [
"--checked"
],
"packageRoot": null,
"packageConfig": null,
"version": "1.22.0",
"localeName": "de/de"
Expand Down