Skip to content

Commit

Permalink
Dart 2.0 fixes. (grpc#48)
Browse files Browse the repository at this point in the history
Updated generated code in examples using latest protoc compiler plugin.
Fixed uses-dynamic-as-bottom issues.
  • Loading branch information
jakobr-google authored Jan 12, 2018
1 parent a01be59 commit eb5b805
Show file tree
Hide file tree
Showing 27 changed files with 485 additions and 464 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.1 - 2018-01-12

* Updated generated code in examples using latest protoc compiler plugin.
* Dart 2.0 fixes.

## 0.2.0 - 2017-12-15

* Implemented support for per-RPC metadata providers. This can be used for
Expand Down
2 changes: 1 addition & 1 deletion example/googleapis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To regenerate them, you will need to check out both
[google/protobuf](https://github.com/google/protobuf).

You will also need to have protoc version 3.0.0 or higher and the Dart protoc
plugin version 0.7.8 or higher on your PATH.
plugin version 0.7.9 or higher on your PATH.

To install protoc, see the instructions on
[the Protocol Buffers website](https://developers.google.com/protocol-buffers/).
Expand Down
20 changes: 10 additions & 10 deletions example/googleapis/lib/src/generated/google/api/label.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ export 'label.pbenum.dart';

class LabelDescriptor extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('LabelDescriptor')
..a<String>(1, 'key', PbFieldType.OS)
..aOS(1, 'key')
..e<LabelDescriptor_ValueType>(
2,
'valueType',
PbFieldType.OE,
LabelDescriptor_ValueType.STRING,
LabelDescriptor_ValueType.valueOf,
LabelDescriptor_ValueType.values)
..a<String>(3, 'description', PbFieldType.OS)
..aOS(3, 'description')
..hasRequiredFields = false;

LabelDescriptor() : super();
Expand All @@ -49,28 +49,28 @@ class LabelDescriptor extends GeneratedMessage {
if (v is! LabelDescriptor) checkItemFailed(v, 'LabelDescriptor');
}

String get key => $_get(0, 1, '');
String get key => $_getS(0, '');
set key(String v) {
$_setString(0, 1, v);
$_setString(0, v);
}

bool hasKey() => $_has(0, 1);
bool hasKey() => $_has(0);
void clearKey() => clearField(1);

LabelDescriptor_ValueType get valueType => $_get(1, 2, null);
LabelDescriptor_ValueType get valueType => $_getN(1);
set valueType(LabelDescriptor_ValueType v) {
setField(2, v);
}

bool hasValueType() => $_has(1, 2);
bool hasValueType() => $_has(1);
void clearValueType() => clearField(2);

String get description => $_get(2, 3, '');
String get description => $_getS(2, '');
set description(String v) {
$_setString(2, 3, v);
$_setString(2, v);
}

bool hasDescription() => $_has(2, 3);
bool hasDescription() => $_has(2);
void clearDescription() => clearField(3);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import 'label.pb.dart';

class MonitoredResourceDescriptor extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('MonitoredResourceDescriptor')
..a<String>(1, 'type', PbFieldType.OS)
..a<String>(2, 'displayName', PbFieldType.OS)
..a<String>(3, 'description', PbFieldType.OS)
..aOS(1, 'type')
..aOS(2, 'displayName')
..aOS(3, 'description')
..pp<LabelDescriptor>(4, 'labels', PbFieldType.PM,
LabelDescriptor.$checkItem, LabelDescriptor.create)
..a<String>(5, 'name', PbFieldType.OS)
..aOS(5, 'name')
..hasRequiredFields = false;

MonitoredResourceDescriptor() : super();
Expand Down Expand Up @@ -47,38 +47,38 @@ class MonitoredResourceDescriptor extends GeneratedMessage {
checkItemFailed(v, 'MonitoredResourceDescriptor');
}

String get type => $_get(0, 1, '');
String get type => $_getS(0, '');
set type(String v) {
$_setString(0, 1, v);
$_setString(0, v);
}

bool hasType() => $_has(0, 1);
bool hasType() => $_has(0);
void clearType() => clearField(1);

String get displayName => $_get(1, 2, '');
String get displayName => $_getS(1, '');
set displayName(String v) {
$_setString(1, 2, v);
$_setString(1, v);
}

bool hasDisplayName() => $_has(1, 2);
bool hasDisplayName() => $_has(1);
void clearDisplayName() => clearField(2);

String get description => $_get(2, 3, '');
String get description => $_getS(2, '');
set description(String v) {
$_setString(2, 3, v);
$_setString(2, v);
}

bool hasDescription() => $_has(2, 3);
bool hasDescription() => $_has(2);
void clearDescription() => clearField(3);

List<LabelDescriptor> get labels => $_get(3, 4, null);
List<LabelDescriptor> get labels => $_getN(3);

String get name => $_get(4, 5, '');
String get name => $_getS(4, '');
set name(String v) {
$_setString(4, 5, v);
$_setString(4, v);
}

bool hasName() => $_has(4, 5);
bool hasName() => $_has(4);
void clearName() => clearField(5);
}

Expand All @@ -87,8 +87,8 @@ class _ReadonlyMonitoredResourceDescriptor extends MonitoredResourceDescriptor

class MonitoredResource_LabelsEntry extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('MonitoredResource_LabelsEntry')
..a<String>(1, 'key', PbFieldType.OS)
..a<String>(2, 'value', PbFieldType.OS)
..aOS(1, 'key')
..aOS(2, 'value')
..hasRequiredFields = false;

MonitoredResource_LabelsEntry() : super();
Expand Down Expand Up @@ -117,20 +117,20 @@ class MonitoredResource_LabelsEntry extends GeneratedMessage {
checkItemFailed(v, 'MonitoredResource_LabelsEntry');
}

String get key => $_get(0, 1, '');
String get key => $_getS(0, '');
set key(String v) {
$_setString(0, 1, v);
$_setString(0, v);
}

bool hasKey() => $_has(0, 1);
bool hasKey() => $_has(0);
void clearKey() => clearField(1);

String get value => $_get(1, 2, '');
String get value => $_getS(1, '');
set value(String v) {
$_setString(1, 2, v);
$_setString(1, v);
}

bool hasValue() => $_has(1, 2);
bool hasValue() => $_has(1);
void clearValue() => clearField(2);
}

Expand All @@ -139,7 +139,7 @@ class _ReadonlyMonitoredResource_LabelsEntry

class MonitoredResource extends GeneratedMessage {
static final BuilderInfo _i = new BuilderInfo('MonitoredResource')
..a<String>(1, 'type', PbFieldType.OS)
..aOS(1, 'type')
..pp<MonitoredResource_LabelsEntry>(
2,
'labels',
Expand Down Expand Up @@ -171,15 +171,15 @@ class MonitoredResource extends GeneratedMessage {
if (v is! MonitoredResource) checkItemFailed(v, 'MonitoredResource');
}

String get type => $_get(0, 1, '');
String get type => $_getS(0, '');
set type(String v) {
$_setString(0, 1, v);
$_setString(0, v);
}

bool hasType() => $_has(0, 1);
bool hasType() => $_has(0);
void clearType() => clearField(1);

List<MonitoredResource_LabelsEntry> get labels => $_get(1, 2, null);
List<MonitoredResource_LabelsEntry> get labels => $_getN(1);
}

class _ReadonlyMonitoredResource extends MonitoredResource
Expand Down
Loading

0 comments on commit eb5b805

Please sign in to comment.