-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔖 release chopper generator v6.0.3 (#449)
# chopper_generator ## 6.0.3 * [CHORE] #448
- Loading branch information
Showing
17 changed files
with
1,205 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@TestOn('vm') | ||
@Timeout(Duration(seconds: 120)) | ||
import 'package:build_verify/build_verify.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
test( | ||
'ensure_build', | ||
() => expectBuildClean( | ||
packageRelativeDirectory: 'chopper', | ||
gitDiffPathArguments: [ | ||
'test/test_service.chopper.dart', | ||
], | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# chopper_generator | ||
|
||
[![pub package](https://img.shields.io/pub/v/chopper_generator.svg)](https://pub.dartlang.org/packages/chopper_generator) | ||
|
||
This package provides the code generator for the [Chopper](https://github.com/lejard-h/chopper) package. | ||
|
||
## Usage | ||
|
||
For examples please refer to the main [Chopper](https://github.com/lejard-h/chopper) package and/or read the | ||
[documentation](https://hadrien-lejard.gitbook.io/chopper). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
library chopper_generator.dart; | ||
|
||
import 'package:build/build.dart'; | ||
|
||
import 'src/generator.dart'; | ||
|
||
Builder chopperGeneratorFactory(BuilderOptions options) => | ||
chopperGeneratorFactoryBuilder(options); | ||
export 'src/builder_factory.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:build/build.dart'; | ||
import 'package:chopper/chopper.dart' show ChopperApi; | ||
import 'package:source_gen/source_gen.dart'; | ||
|
||
import 'generator.dart'; | ||
|
||
/// Creates a [PartBuilder] used to generate code for [ChopperApi] annotated | ||
/// classes. The [options] are provided by Dart's build system and read from the | ||
/// `build.yaml` file. | ||
Builder chopperGeneratorFactory(BuilderOptions options) => PartBuilder( | ||
[const ChopperGenerator()], | ||
'.chopper.dart', | ||
header: options.config['header'], | ||
formatOutput: | ||
PartBuilder([const ChopperGenerator()], '.chopper.dart').formatOutput, | ||
options: !options.config.containsKey('build_extensions') | ||
? options.overrideWith( | ||
BuilderOptions({ | ||
'build_extensions': {'.dart': '.chopper.dart'}, | ||
}), | ||
) | ||
: options, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:analyzer/dart/element/nullability_suffix.dart'; | ||
import 'package:analyzer/dart/element/type.dart'; | ||
|
||
extension DartTypeExtension on DartType { | ||
bool get isNullable => nullabilitySuffix != NullabilitySuffix.none; | ||
} |
Oops, something went wrong.