Drop deprecated fields (#1104)
* Drop deprecated fields
* Clean up
* More cleanup
diff --git a/lib/services_cloud_run.dart b/lib/services_cloud_run.dart
index 8d0ec7a..d17b113 100644
--- a/lib/services_cloud_run.dart
+++ b/lib/services_cloud_run.dart
@@ -92,7 +92,6 @@
EndpointsServer._(String? redisServerUri, Sdk sdk) {
_commonServerImpl = CommonServerImpl(
- _ServerContainer(),
redisServerUri == null
? InMemoryCache()
: RedisCache(
@@ -136,8 +135,3 @@
});
}
}
-
-class _ServerContainer implements ServerContainer {
- @override
- String get version => '1.0';
-}
diff --git a/lib/services_dev.dart b/lib/services_dev.dart
index 6061f92..1273a22 100644
--- a/lib/services_dev.dart
+++ b/lib/services_dev.dart
@@ -65,7 +65,6 @@
EndpointsServer._(Sdk sdk, bool nullSafety) {
final commonServerImpl = CommonServerImpl(
- _ServerContainer(),
_Cache(),
sdk,
);
@@ -93,11 +92,6 @@
}
}
-class _ServerContainer implements ServerContainer {
- @override
- String get version => '1.0';
-}
-
class _Cache implements ServerCache {
@override
Future<String?> get(String key) => Future<String?>.value(null);
diff --git a/lib/src/common_server_api.dart b/lib/src/common_server_api.dart
index 0565887..c131a58 100644
--- a/lib/src/common_server_api.dart
+++ b/lib/src/common_server_api.dart
@@ -12,7 +12,7 @@
import 'common_server_impl.dart' show BadRequest, CommonServerImpl;
import 'protos/dart_services.pb.dart' as proto;
-export 'common_server_impl.dart' show ServerContainer, log;
+export 'common_server_impl.dart' show log;
part 'common_server_api.g.dart'; // generated with 'pub run build_runner build'
diff --git a/lib/src/common_server_impl.dart b/lib/src/common_server_impl.dart
index 450aa95..a521767 100644
--- a/lib/src/common_server_impl.dart
+++ b/lib/src/common_server_impl.dart
@@ -9,7 +9,6 @@
import 'package:crypto/crypto.dart';
import 'package:logging/logging.dart';
-import '../version.dart';
import 'analysis_servers.dart';
import 'common.dart';
import 'compiler.dart';
@@ -28,12 +27,7 @@
BadRequest(this.cause);
}
-abstract class ServerContainer {
- String get version;
-}
-
class CommonServerImpl {
- final ServerContainer _container;
final ServerCache _cache;
final Sdk _sdk;
@@ -45,7 +39,6 @@
bool get isHealthy => _analysisServers.isHealthy;
CommonServerImpl(
- this._container,
this._cache,
this._sdk,
) {
@@ -266,8 +259,6 @@
..sdkVersion = _sdk.version
..sdkVersionFull = _sdk.versionFull
..runtimeVersion = vmVersion
- ..servicesVersion = servicesVersion
- ..appEngineVersion = _container.version
..flutterDartVersion = _sdk.version
..flutterDartVersionFull = _sdk.versionFull
..flutterVersion = _sdk.flutterVersion
diff --git a/lib/src/protos/dart_services.pb.dart b/lib/src/protos/dart_services.pb.dart
index b41ed13..947056f 100644
--- a/lib/src/protos/dart_services.pb.dart
+++ b/lib/src/protos/dart_services.pb.dart
@@ -1847,27 +1847,35 @@
@$pb.TagNumber(3)
void clearRuntimeVersion() => clearField(3);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(4)
$core.String get appEngineVersion => $_getSZ(3);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(4)
set appEngineVersion($core.String v) {
$_setString(3, v);
}
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(4)
$core.bool hasAppEngineVersion() => $_has(3);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(4)
void clearAppEngineVersion() => clearField(4);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(5)
$core.String get servicesVersion => $_getSZ(4);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(5)
set servicesVersion($core.String v) {
$_setString(4, v);
}
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(5)
$core.bool hasServicesVersion() => $_has(4);
+ @$core.Deprecated('This field is deprecated.')
@$pb.TagNumber(5)
void clearServicesVersion() => clearField(5);
diff --git a/lib/src/protos/dart_services.pbjson.dart b/lib/src/protos/dart_services.pbjson.dart
index 018141b..86cedfc 100644
--- a/lib/src/protos/dart_services.pbjson.dart
+++ b/lib/src/protos/dart_services.pbjson.dart
@@ -607,8 +607,22 @@
{'1': 'sdkVersion', '3': 1, '4': 1, '5': 9, '10': 'sdkVersion'},
{'1': 'sdkVersionFull', '3': 2, '4': 1, '5': 9, '10': 'sdkVersionFull'},
{'1': 'runtimeVersion', '3': 3, '4': 1, '5': 9, '10': 'runtimeVersion'},
- {'1': 'appEngineVersion', '3': 4, '4': 1, '5': 9, '10': 'appEngineVersion'},
- {'1': 'servicesVersion', '3': 5, '4': 1, '5': 9, '10': 'servicesVersion'},
+ {
+ '1': 'appEngineVersion',
+ '3': 4,
+ '4': 1,
+ '5': 9,
+ '8': {'3': true},
+ '10': 'appEngineVersion',
+ },
+ {
+ '1': 'servicesVersion',
+ '3': 5,
+ '4': 1,
+ '5': 9,
+ '8': {'3': true},
+ '10': 'servicesVersion',
+ },
{'1': 'flutterVersion', '3': 6, '4': 1, '5': 9, '10': 'flutterVersion'},
{
'1': 'flutterDartVersion',
@@ -674,18 +688,18 @@
final $typed_data.Uint8List versionResponseDescriptor = $convert.base64Decode(
'Cg9WZXJzaW9uUmVzcG9uc2USHgoKc2RrVmVyc2lvbhgBIAEoCVIKc2RrVmVyc2lvbhImCg5zZG'
'tWZXJzaW9uRnVsbBgCIAEoCVIOc2RrVmVyc2lvbkZ1bGwSJgoOcnVudGltZVZlcnNpb24YAyAB'
- 'KAlSDnJ1bnRpbWVWZXJzaW9uEioKEGFwcEVuZ2luZVZlcnNpb24YBCABKAlSEGFwcEVuZ2luZV'
- 'ZlcnNpb24SKAoPc2VydmljZXNWZXJzaW9uGAUgASgJUg9zZXJ2aWNlc1ZlcnNpb24SJgoOZmx1'
- 'dHRlclZlcnNpb24YBiABKAlSDmZsdXR0ZXJWZXJzaW9uEi4KEmZsdXR0ZXJEYXJ0VmVyc2lvbh'
- 'gHIAEoCVISZmx1dHRlckRhcnRWZXJzaW9uEjYKFmZsdXR0ZXJEYXJ0VmVyc2lvbkZ1bGwYCCAB'
- 'KAlSFmZsdXR0ZXJEYXJ0VmVyc2lvbkZ1bGwSYQoPcGFja2Fn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RhcnRfc2Vydm'
+ 'ljZXMuYXBpLlBhY2thZ2VJbmZvUgtwYWNrYWdlSW5mbxIeCgpleHBlcmltZW50GAsgAygJUgpl'
+ 'eHBlcmltZW50EioKEGZsdXR0ZXJFbmdpbmVTaGEYDCABKAlSEGZsdXR0ZXJFbmdpbmVTaGESNQ'
+ 'oFZXJyb3IYYyABKAsyHy5kYXJ0X3NlcnZpY2VzLmFwaS5FcnJvck1lc3NhZ2VSBWVycm9yGkIK'
+ 'FFBhY2thZ2VWZXJzaW9uc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgJUg'
+ 'V2YWx1ZToCOAE=');
@$core.Deprecated('Use packageInfoDescriptor instead')
const PackageInfo$json = {
diff --git a/protos/dart_services.proto b/protos/dart_services.proto
index e92e603..933a8d6 100644
--- a/protos/dart_services.proto
+++ b/protos/dart_services.proto
@@ -208,11 +208,11 @@
// semver string, and have a space and other build details appended.
string runtimeVersion = 3;
- // The App Engine version.
- string appEngineVersion = 4;
+ // Removed.
+ string appEngineVersion = 4 [deprecated = true];
- // The dart-services backend version.
- string servicesVersion = 5;
+ // Removed.
+ string servicesVersion = 5 [deprecated = true];
// The Flutter SDK's version.
string flutterVersion = 6;
diff --git a/test/common_server_api_protobuf_test.dart b/test/common_server_api_protobuf_test.dart
index 50219bb..e573c47 100644
--- a/test/common_server_api_protobuf_test.dart
+++ b/test/common_server_api_protobuf_test.dart
@@ -74,9 +74,8 @@
final sdk =
Sdk.create(Platform.environment['FLUTTER_CHANNEL'] ?? stableChannel);
setUpAll(() async {
- final container = MockContainer();
final cache = MockCache();
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
commonServerApi = CommonServerApi(commonServerImpl);
await commonServerImpl.init();
@@ -415,9 +414,8 @@
final sdk =
Sdk.create(Platform.environment['FLUTTER_CHANNEL'] ?? stableChannel);
setUpAll(() async {
- final container = MockContainer();
final cache = MockCache();
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
commonServerApi = CommonServerApi(commonServerImpl);
await commonServerImpl.init();
@@ -751,11 +749,6 @@
// End of multi file files={} tests group.
}
-class MockContainer implements ServerContainer {
- @override
- String get version => vmVersion;
-}
-
class MockCache implements ServerCache {
@override
Future<String?> get(String key) => Future.value(null);
diff --git a/test/common_server_api_test.dart b/test/common_server_api_test.dart
index 048ae45..f3b590b 100644
--- a/test/common_server_api_test.dart
+++ b/test/common_server_api_test.dart
@@ -73,9 +73,8 @@
final sdk =
Sdk.create(Platform.environment['FLUTTER_CHANNEL'] ?? stableChannel);
setUp(() async {
- final container = MockContainer();
final cache = MockCache();
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
commonServerApi = CommonServerApi(commonServerImpl);
await commonServerImpl.init();
@@ -539,9 +538,8 @@
final sdk =
Sdk.create(Platform.environment['FLUTTER_CHANNEL'] ?? stableChannel);
setUp(() async {
- final container = MockContainer();
final cache = MockCache();
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
commonServerApi = CommonServerApi(commonServerImpl);
await commonServerImpl.init();
@@ -1238,11 +1236,6 @@
//-------------------------------------------------------------------------
}
-class MockContainer implements ServerContainer {
- @override
- String get version => vmVersion;
-}
-
class MockCache implements ServerCache {
final _cache = HashMap<String, String>();
diff --git a/test/flutter_analysis_server_test.dart b/test/flutter_analysis_server_test.dart
index 2dd2716..da0fa02 100644
--- a/test/flutter_analysis_server_test.dart
+++ b/test/flutter_analysis_server_test.dart
@@ -140,14 +140,12 @@
group('CommonServerImpl flutter analyze', () {
late CommonServerImpl commonServerImpl;
- _MockContainer container;
_MockCache cache;
setUp(() async {
- container = _MockContainer();
cache = _MockCache();
final sdk = Sdk.create(channel);
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
await commonServerImpl.init();
});
@@ -303,14 +301,12 @@
group('CommonServerImpl flutter analyzeFiles files={}', () {
late CommonServerImpl commonServerImpl;
- _MockContainer container;
_MockCache cache;
setUp(() async {
- container = _MockContainer();
cache = _MockCache();
final sdk = Sdk.create(channel);
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
await commonServerImpl.init();
});
@@ -336,11 +332,6 @@
});
}
-class _MockContainer implements ServerContainer {
- @override
- String get version => vmVersion;
-}
-
class _MockCache implements ServerCache {
@override
Future<String?> get(String key) => Future<String?>.value(null);
diff --git a/tool/fuzz_driver.dart b/tool/fuzz_driver.dart
index 72eca48..7c0491e 100644
--- a/tool/fuzz_driver.dart
+++ b/tool/fuzz_driver.dart
@@ -12,7 +12,6 @@
import 'dart:math';
import 'package:dart_services/src/analysis_server.dart' as analysis_server;
-import 'package:dart_services/src/common.dart';
import 'package:dart_services/src/common_server_impl.dart';
import 'package:dart_services/src/compiler.dart' as comp;
import 'package:dart_services/src/protos/dart_services.pb.dart' as proto;
@@ -26,7 +25,6 @@
bool dumpDelta = false;
late CommonServerImpl commonServerImpl;
-late MockContainer container;
late MockCache cache;
analysis_server.AnalysisServerWrapper? analysisServer;
@@ -121,9 +119,8 @@
print('SdKPath: ${sdk.dartSdkPath}');
- container = MockContainer();
cache = MockCache();
- commonServerImpl = CommonServerImpl(container, cache, sdk);
+ commonServerImpl = CommonServerImpl(cache, sdk);
await commonServerImpl.init();
analysisServer =
@@ -383,11 +380,6 @@
return newStr;
}
-class MockContainer implements ServerContainer {
- @override
- String get version => vmVersion;
-}
-
class MockCache implements ServerCache {
@override
Future<String?> get(String key) => Future<String?>.value(null);