Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency update #178

Merged
merged 1 commit into from Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions chopper/pubspec.yaml
@@ -1,6 +1,6 @@
name: chopper
description: Chopper is an http client generator using source_gen and inspired from retrofit
version: 3.0.3
version: 3.0.6
homepage: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper
author: Hadrien Lejard <hadrien.lejard@gmail.com>
Expand All @@ -10,16 +10,19 @@ environment:

dependencies:
http: ">=0.11.0 <1.0.0"
meta: ^1.1.8
meta: ^1.2.3
logging: ^0.11.4

dev_dependencies:
test: ^1.14.3
build_runner: ^1.10.0
build_test: ^1.0.0
coverage: ^0.13.9
test_coverage: ^0.4.1
test: ^1.15.4
build_runner: ^1.10.3
build_test: ^1.2.2
coverage: ^0.14.1
test_coverage:
git:
url: https://github.com/JEuler/test-coverage.git
ref: new-coverage
http_parser: ^3.1.4
pedantic: ^1.9.0
pedantic: ^1.9.2
chopper_generator:
path: ../chopper_generator
16 changes: 8 additions & 8 deletions chopper_built_value/pubspec.yaml
@@ -1,6 +1,6 @@
name: chopper_built_value
description: Chopper is an http client generator using source_gen and inspired from retrofit
version: 0.0.3
version: 0.0.6
homepage: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper
author: Hadrien Lejard <hadrien.lejard@gmail.com>
Expand All @@ -11,18 +11,18 @@ environment:
dependencies:
built_value: ^7.1.0
built_collection: ^4.3.2
chopper: ^3.0.2
http: ^0.12.1
chopper: ^3.0.3
http: ^0.12.2

dev_dependencies:
test: ^1.14.3
build_runner: ^1.10.0
test: ^1.15.4
build_runner: ^1.10.3
build_test:
coverage: ^0.13.9
test_coverage: ^0.4.1
coverage: ^0.14.1
built_value_generator: ^7.1.0
pedantic: ^1.9.0
pedantic: ^1.9.2

dependency_overrides:
analyzer: 0.40.4
chopper:
path: ../chopper
23 changes: 15 additions & 8 deletions chopper_generator/lib/src/generator.dart
Expand Up @@ -129,21 +129,24 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
return Method((b) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid using one-letter variable and parameter names for readability's sake. It's not the scope of this PR, so I'll let it pass, but we should really do it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, totally agree. Let's push that after this PR. Also, we should decide how to release new versions of Chopper.

b.annotations.add(refer('override'));
b.name = m.displayName;
b.returns = Reference(m.returnType.getDisplayString());
b.returns =
Reference(m.returnType.getDisplayString(withNullability: false));
b.types.addAll(m.typeParameters
.map((t) => Reference(t.getDisplayString(withNullability: false))));
b.requiredParameters.addAll(m.parameters
.where((p) => p.isNotOptional)
.map((p) => Parameter((pb) => pb
..name = p.name
..type = Reference(p.type.getDisplayString()))));
..type =
Reference(p.type.getDisplayString(withNullability: false)))));

b.optionalParameters.addAll(m.parameters
.where((p) => p.isOptionalPositional)
.map((p) => Parameter((pb) {
pb
..name = p.name
..type = Reference(p.type.getDisplayString());
..type = Reference(
p.type.getDisplayString(withNullability: false));

if (p.defaultValueCode != null) {
pb.defaultTo = Code(p.defaultValueCode);
Expand All @@ -156,7 +159,8 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
pb
..named = true
..name = p.name
..type = Reference(p.type.getDisplayString());
..type = Reference(
p.type.getDisplayString(withNullability: false));

if (p.defaultValueCode != null) {
pb.defaultTo = Code(p.defaultValueCode);
Expand Down Expand Up @@ -249,8 +253,10 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {

final typeArguments = <Reference>[];
if (responseType != null) {
typeArguments.add(refer(responseType.getDisplayString()));
typeArguments.add(refer(responseInnerType.getDisplayString()));
typeArguments
.add(refer(responseType.getDisplayString(withNullability: false)));
typeArguments.add(
refer(responseInnerType.getDisplayString(withNullability: false)));
}

blocks.add(refer('client.send')
Expand Down Expand Up @@ -445,7 +451,8 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
];

list.add(
refer('PartValue<${p.type.getDisplayString()}>').newInstance(params));
refer('PartValue<${p.type.getDisplayString(withNullability: false)}>')
.newInstance(params));
});
fileFields.forEach((p, ConstantReader r) {
final name = r.peek('name')?.stringValue ?? p.displayName;
Expand All @@ -455,7 +462,7 @@ class ChopperGenerator extends GeneratorForAnnotation<chopper.ChopperApi> {
];

list.add(
refer('PartValueFile<${p.type.getDisplayString()}>')
refer('PartValueFile<${p.type.getDisplayString(withNullability: false)}>')
.newInstance(params),
);
});
Expand Down
20 changes: 10 additions & 10 deletions chopper_generator/pubspec.yaml
@@ -1,6 +1,6 @@
name: chopper_generator
description: Chopper is an http client generator using source_gen and inspired from retrofit
version: 3.0.5
version: 3.0.6
homepage: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper
author: Hadrien Lejard <hadrien.lejard@gmail.com>
Expand All @@ -9,19 +9,19 @@ environment:
sdk: ">=2.2.2 <3.0.0"

dependencies:
meta: ^1.1.8
analyzer: ^0.39.8
build: ^1.3.0
meta: ^1.2.3
analyzer: ^0.40.4
build: ^1.5.0
logging: ^0.11.4
source_gen: ^0.9.5
chopper: ^3.0.2
code_builder: ^3.2.1
dart_style: ^1.3.6
source_gen: ^0.9.7+1
chopper: ^3.0.3
code_builder: ^3.5.0
dart_style: ^1.3.7
built_collection: ^4.3.2

dev_dependencies:
test: ^1.14.3
pedantic: ^1.9.0
test: ^1.15.4
pedantic: ^1.9.2

dependency_overrides:
chopper:
Expand Down
22 changes: 0 additions & 22 deletions example/lib/angular_example.dart

This file was deleted.

34 changes: 0 additions & 34 deletions example/web/main.dart

This file was deleted.