From 66598d3e8296b5e103869d13686149493e6ab232 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Wed, 31 Mar 2021 03:34:22 +0000 Subject: [PATCH] Switch analysis_server_client to language 2.12, so null safety, but opt-out files. Protocol files are generated, so should be updated together with analysis_server protocol files. Change-Id: I8c3c7a5aecd2f7ff70c531bb794df3aed21888b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193620 Reviewed-by: Brian Wilkerson Commit-Queue: Konstantin Shcheglov --- .dart_tool/package_config.json | 2 +- pkg/analysis_server_client/CHANGELOG.md | 3 +++ pkg/analysis_server_client/example/example.dart | 2 ++ .../lib/handler/connection_handler.dart | 2 ++ pkg/analysis_server_client/lib/protocol.dart | 2 ++ pkg/analysis_server_client/lib/server.dart | 2 ++ .../lib/src/protocol/protocol_base.dart | 2 ++ .../lib/src/protocol/protocol_common.dart | 2 ++ .../lib/src/protocol/protocol_internal.dart | 2 ++ .../lib/src/protocol/protocol_util.dart | 2 ++ pkg/analysis_server_client/lib/src/server_base.dart | 2 ++ pkg/analysis_server_client/pubspec.yaml | 8 ++++---- pkg/analysis_server_client/test/all.dart | 2 ++ pkg/analysis_server_client/test/live_test.dart | 2 ++ pkg/analysis_server_client/test/server_test.dart | 2 ++ pkg/analysis_server_client/test/verify_sorted_test.dart | 2 ++ 16 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 3c57af1bd0f..f0139e405dd 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -76,7 +76,7 @@ "name": "analysis_server_client", "rootUri": "../pkg/analysis_server_client", "packageUri": "lib/", - "languageVersion": "2.8" + "languageVersion": "2.12" }, { "name": "analyzer", diff --git a/pkg/analysis_server_client/CHANGELOG.md b/pkg/analysis_server_client/CHANGELOG.md index 43563a17cdc..d1f5f3f5f0d 100644 --- a/pkg/analysis_server_client/CHANGELOG.md +++ b/pkg/analysis_server_client/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev +* Stable null safety release. + # 1.1.3 * Supports changes made to the Analysis Server protocol through Dart 2.8.0 * Updates to use pedantic 1.9.0 and some internal refactoring. diff --git a/pkg/analysis_server_client/example/example.dart b/pkg/analysis_server_client/example/example.dart index 41af85cdc4a..faddfd58747 100644 --- a/pkg/analysis_server_client/example/example.dart +++ b/pkg/analysis_server_client/example/example.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'dart:async'; import 'dart:io' show Directory, Platform, ProcessSignal, exit; diff --git a/pkg/analysis_server_client/lib/handler/connection_handler.dart b/pkg/analysis_server_client/lib/handler/connection_handler.dart index 107b361cac9..96045c028ff 100644 --- a/pkg/analysis_server_client/lib/handler/connection_handler.dart +++ b/pkg/analysis_server_client/lib/handler/connection_handler.dart @@ -6,6 +6,8 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// @dart = 2.9 + import 'dart:async'; import 'package:analysis_server_client/handler/notification_handler.dart'; diff --git a/pkg/analysis_server_client/lib/protocol.dart b/pkg/analysis_server_client/lib/protocol.dart index 7a1059b49c1..3879201471a 100644 --- a/pkg/analysis_server_client/lib/protocol.dart +++ b/pkg/analysis_server_client/lib/protocol.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + export 'package:analysis_server_client/src/protocol/protocol_base.dart'; export 'package:analysis_server_client/src/protocol/protocol_common.dart'; export 'package:analysis_server_client/src/protocol/protocol_constants.dart'; diff --git a/pkg/analysis_server_client/lib/server.dart b/pkg/analysis_server_client/lib/server.dart index d11442ccf4c..ae6d8f0819f 100644 --- a/pkg/analysis_server_client/lib/server.dart +++ b/pkg/analysis_server_client/lib/server.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart index 8fa072df6b6..b855045454e 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + /// Support for client code that needs to interact with the requests, responses /// and notifications that are part of the analysis server's wire protocol. import 'dart:convert' hide JsonDecoder; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index 13e33f1b628..213f857bf9f 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -6,6 +6,8 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// @dart = 2.9 + import 'dart:convert' hide JsonDecoder; import 'package:analysis_server_client/src/protocol/protocol_util.dart'; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart index e35a40d6a2d..4758cf6d7e6 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'dart:collection'; import 'dart:convert' hide JsonDecoder; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart index 02e8c7506c9..95ff9e8ec25 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + /// Jenkins hash function, optimized for small integers. /// /// Static methods borrowed from sdk/lib/math/jenkins_smi_hash.dart. Non-static diff --git a/pkg/analysis_server_client/lib/src/server_base.dart b/pkg/analysis_server_client/lib/src/server_base.dart index 39e9c1d15c7..7aea73ef86f 100644 --- a/pkg/analysis_server_client/lib/src/server_base.dart +++ b/pkg/analysis_server_client/lib/src/server_base.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/pkg/analysis_server_client/pubspec.yaml b/pkg/analysis_server_client/pubspec.yaml index 0589bc3f51e..8b9c79522d2 100644 --- a/pkg/analysis_server_client/pubspec.yaml +++ b/pkg/analysis_server_client/pubspec.yaml @@ -1,15 +1,15 @@ name: analysis_server_client -version: 1.1.3 +version: 2.0.0-dev description: A client wrapper over analysis_server. Instances of the class [Server] manage a connection to a server process, and facilitate communication to and from the server. homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server_client environment: - sdk: '>=2.8.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - path: ^1.7.0 - pub_semver: ^1.4.4 + path: ^1.8.0 + pub_semver: ^2.0.0 dev_dependencies: analyzer: path: ../analyzer diff --git a/pkg/analysis_server_client/test/all.dart b/pkg/analysis_server_client/test/all.dart index bd97ea7c1bb..d510ab268fe 100644 --- a/pkg/analysis_server_client/test/all.dart +++ b/pkg/analysis_server_client/test/all.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'live_test.dart' as live; import 'server_test.dart' as server; import 'verify_sorted_test.dart' as verify_sorted; diff --git a/pkg/analysis_server_client/test/live_test.dart b/pkg/analysis_server_client/test/live_test.dart index e9ed329b8cc..80b593d761b 100644 --- a/pkg/analysis_server_client/test/live_test.dart +++ b/pkg/analysis_server_client/test/live_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'package:analysis_server_client/handler/connection_handler.dart'; import 'package:analysis_server_client/handler/notification_handler.dart'; import 'package:analysis_server_client/listener/server_listener.dart'; diff --git a/pkg/analysis_server_client/test/server_test.dart b/pkg/analysis_server_client/test/server_test.dart index 2442e5b1158..32aadc10392 100644 --- a/pkg/analysis_server_client/test/server_test.dart +++ b/pkg/analysis_server_client/test/server_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'dart:async'; import 'dart:convert'; import 'dart:io'; diff --git a/pkg/analysis_server_client/test/verify_sorted_test.dart b/pkg/analysis_server_client/test/verify_sorted_test.dart index 5a19d51174d..6841a86197c 100644 --- a/pkg/analysis_server_client/test/verify_sorted_test.dart +++ b/pkg/analysis_server_client/test/verify_sorted_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// @dart = 2.9 + import 'package:analysis_server/src/services/correction/sort_members.dart'; import 'package:analyzer/dart/analysis/analysis_context_collection.dart'; import 'package:analyzer/dart/analysis/results.dart';