Deprecate buildSdkSummary2(), use buildSdkSummary() instead.

Change-Id: Iaceb38251047ba4d2cb3e051c096f148b810fbb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265407
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2022-10-24 22:32:48 +00:00 committed by Commit Queue
parent e46bade3d0
commit afb9609261
8 changed files with 34 additions and 7 deletions

View file

@ -11,6 +11,7 @@
* Deprecated `LibraryElement.parts2`, use `parts` instead.
* Deprecated `ImportElement.imports2`, use `imports` instead.
* Add `AnalysisDriverForPackageBuild.sdkLibraryUris`.
* Deprecated `buildSdkSummary2()`, use `buildSdkSummary()` instead.
## 5.1.0
* Deprecated `AstNode.name2`, use `name` instead.

View file

@ -19,7 +19,7 @@ import 'package:yaml/yaml.dart';
///
/// If [embedderYamlPath] is provided, then libraries from this file are
/// appended to the libraries of the specified SDK.
Future<Uint8List> buildSdkSummary2({
Future<Uint8List> buildSdkSummary({
required ResourceProvider resourceProvider,
required String sdkPath,
String? embedderYamlPath,
@ -72,3 +72,19 @@ Future<Uint8List> buildSdkSummary2({
),
);
}
/// Build summary for SDK at the given [sdkPath].
///
/// If [embedderYamlPath] is provided, then libraries from this file are
/// appended to the libraries of the specified SDK.
@Deprecated('Use buildSdkSummary() instead')
Future<Uint8List> buildSdkSummary2({
required ResourceProvider resourceProvider,
required String sdkPath,
String? embedderYamlPath,
}) async {
return buildSdkSummary(
resourceProvider: resourceProvider,
sdkPath: sdkPath,
);
}

View file

@ -142,3 +142,13 @@ transforms:
changes:
- kind: 'rename'
newName: 'isAccessibleIn'
# buildSdkSummary()
- title: "Replace with get buildSdkSummary()"
date: 2022-10-24
element:
function: 'buildSdkSummary2'
uris: [ 'package:analyzer/dart/sdk/build_sdk_summary.dart' ]
changes:
- kind: 'rename'
newName: 'buildSdkSummary'

View file

@ -51,7 +51,7 @@ embedded_libs:
"dart:ui": "ui/ui.dart"
''');
final sdkSummaryBytes = await buildSdkSummary2(
final sdkSummaryBytes = await buildSdkSummary(
resourceProvider: resourceProvider,
sdkPath: sdkRoot.path,
embedderYamlPath: embedderFile.path,
@ -100,7 +100,7 @@ embedded_libs:
root: sdkRoot,
);
final sdkSummaryBytes = await buildSdkSummary2(
final sdkSummaryBytes = await buildSdkSummary(
resourceProvider: resourceProvider,
sdkPath: sdkRoot.path,
);

View file

@ -25,7 +25,7 @@ class AnalysisDriverForPackageBuildTest with ResourceProviderMixin {
root: sdkRoot,
);
var sdkSummaryBytes = await buildSdkSummary2(
var sdkSummaryBytes = await buildSdkSummary(
resourceProvider: resourceProvider,
sdkPath: sdkRoot.path,
);

View file

@ -416,7 +416,7 @@ class PubPackageResolutionTest extends ContextResolutionTest {
Future<File> writeSdkSummary() async {
final file = getFile('/home/summaries/sdk.sum');
final bytes = await buildSdkSummary2(
final bytes = await buildSdkSummary(
resourceProvider: resourceProvider,
sdkPath: sdkRoot.path,
);

View file

@ -52,7 +52,7 @@ const binaryName = "build_sdk_summaries";
Future<void> _buildSummary(String sdkPath, String outPath) async {
print('Generating summary.');
Stopwatch sw = Stopwatch()..start();
List<int> bytes = await buildSdkSummary2(
List<int> bytes = await buildSdkSummary(
resourceProvider: PhysicalResourceProvider.INSTANCE,
sdkPath: sdkPath,
);

View file

@ -127,7 +127,7 @@ class Driver implements CommandLineStarter {
final stopwatch = Stopwatch()..start();
for (var i = 0; i < 3; i++) {
await buildSdkSummary2(
await buildSdkSummary(
resourceProvider: PhysicalResourceProvider.INSTANCE,
sdkPath: options.dartSdkPath!,
);