Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a95e6f

Browse files
srawlinsCommit Queue
authored and
Commit Queue
committed
analyzer_testing: Deprecate the angular_meta mocks
Change-Id: I17a6db9acdcad8c1c8e396d4a85d1acae9007ca2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461984 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
1 parent a2d7bb4 commit 0a95e6f

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

‎pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,24 @@ class PubPackageResolutionTest extends ContextResolutionTest
386386
);
387387

388388
if (angularMeta) {
389-
var angularMetaPath = addAngularMeta().parent.path;
390-
config.add(name: 'angular_meta', rootPath: angularMetaPath);
389+
var angularMetaRootPath = '/packages/angular_meta';
390+
newFile('$angularMetaRootPath/lib/angular_meta.dart', r'''
391+
library angular.meta;
392+
393+
const _VisibleForTemplate visibleForTemplate = const _VisibleForTemplate();
394+
395+
const _VisibleOutsideTemplate visibleOutsideTemplate =
396+
const _VisibleOutsideTemplate();
397+
398+
class _VisibleForTemplate {
399+
const _VisibleForTemplate();
400+
}
401+
402+
class _VisibleOutsideTemplate {
403+
const _VisibleOutsideTemplate();
404+
}
405+
''');
406+
config.add(name: 'angular_meta', rootPath: angularMetaRootPath);
391407
}
392408

393409
if (ffi) {

‎pkg/analyzer_testing/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
analysis options file used in testing specifies a `true` value for
66
`propagate-linter-exceptions`. This ensures that when tests are run,
77
exceptions that occur while processing lint rules will cause the test to fail.
8+
- Deprecate `MockPackagesMixin.addAngularMeta`. A mock `angular_meta` package
9+
can still be written with `PubPackageResolutionTest.newPackage`.
810
- Deprecate `MockPackagesMixin.addJs` and
911
`PubPackageResolutionTest.addJsPackageDep`. A mock js package can still be
1012
written with `PubPackageResolutionTest.newPackage`.

‎pkg/analyzer_testing/api.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package:analyzer_testing/mock_packages/mock_packages.dart:
2424
packagesRootPath (getter: String)
2525
pathContext (getter: Context)
2626
resourceProvider (getter: ResourceProvider)
27-
addAngularMeta (method: Folder Function())
27+
addAngularMeta (method: Folder Function(), deprecated)
2828
addFfi (method: Folder Function())
2929
addFixnum (method: Folder Function())
3030
addFlutter (method: Folder Function())

‎pkg/analyzer_testing/lib/mock_packages/mock_packages.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ mixin MockPackagesMixin {
9393

9494
ResourceProvider get resourceProvider;
9595

96+
@Deprecated(
97+
'The mock angular_meta package is deprecated; use '
98+
'`PubPackageResolutionTest.newPackage` to make a custom mock',
99+
)
96100
Folder addAngularMeta() {
97101
var packageFolder = _addFiles('angular_meta');
98102
return packageFolder.getChildAssumingFolder('lib');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /