forked from loafle/openapi-generator-original
[dart] [dart-dio] Support Dart3 (#18001)
* Support both dart 2.x and 3.x * Append dart3 keywords * Update docs
This commit is contained in:
parent
f8d91510a9
commit
06ed7c8205
@ -11,10 +11,7 @@ The last Dart version that was used to generate the keywords can be found in `da
|
||||
|
||||
## What does the shellscript do?
|
||||
|
||||
1. compile a dart app
|
||||
- `dart2native save-dart-keywords.dart`
|
||||
|
||||
1. run the dart app
|
||||
- `./save-dart-keywords.exe`
|
||||
- `dart run save-dart-keywords.dart`
|
||||
|
||||
1. the output is `dart-keywords.txt` and `dart-version.txt`
|
||||
|
@ -1 +1 @@
|
||||
Dart VM version: 2.7.0-dev.0.0 (Tue Nov 5 12:57:33 2019 +0100) on "macos_x64"
|
||||
Dart SDK version: 3.3.0 (stable) (Tue Feb 13 10:25:19 2024 +0000) on "macos_arm64"
|
||||
|
@ -5,190 +5,145 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "67.0.0"
|
||||
analyzer:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.39.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
version: "6.4.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "2.11.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.14.12"
|
||||
version: "1.18.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "3.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
csslib:
|
||||
version: "3.0.3"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
url: "https://pub.dartlang.org"
|
||||
name: file
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.16.1"
|
||||
front_end:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: front_end
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.29"
|
||||
version: "7.0.0"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.14.0+3"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.1+1"
|
||||
kernel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: kernel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.29"
|
||||
version: "2.1.2"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.8"
|
||||
node_interop:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: node_interop
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
node_io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
version: "1.12.0"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0+1"
|
||||
version: "1.9.0"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.2"
|
||||
version: "2.1.4"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.5"
|
||||
version: "1.10.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
version: "1.2.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.1"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
version: "1.3.2"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.7+12"
|
||||
version: "1.1.0"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
dart: ">=3.0.0 <4.0.0"
|
||||
|
@ -4,7 +4,7 @@ description: Use the Dart SDK to generate Dart keywords.
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.6.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
analyzer:
|
||||
|
@ -4,13 +4,8 @@ import 'package:analyzer/dart/ast/token.dart';
|
||||
|
||||
main() {
|
||||
// save keywords to a text file
|
||||
final txtFile = File(
|
||||
final output = File(
|
||||
'../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt');
|
||||
String txtString = '';
|
||||
for (String keyword in Keyword.keywords.keys.toList()) {
|
||||
txtString += keyword + '\n';
|
||||
}
|
||||
txtString =
|
||||
txtString.substring(0, txtString.length - 1); // remove last newline
|
||||
txtFile.writeAsStringSync(txtString);
|
||||
final keywords = Keyword.keywords.keys.join('\n');
|
||||
output.writeAsStringSync(keywords);
|
||||
}
|
||||
|
@ -1,3 +1,2 @@
|
||||
dart2native save-dart-keywords.dart
|
||||
./save-dart-keywords.exe
|
||||
dart run save-dart-keywords.dart
|
||||
dart --version &> dart-version.txt
|
@ -70,7 +70,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>as</li>
|
||||
<li>assert</li>
|
||||
<li>async</li>
|
||||
<li>augment</li>
|
||||
<li>await</li>
|
||||
<li>base</li>
|
||||
<li>break</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
@ -118,6 +120,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>required</li>
|
||||
<li>rethrow</li>
|
||||
<li>return</li>
|
||||
<li>sealed</li>
|
||||
<li>set</li>
|
||||
<li>show</li>
|
||||
<li>source</li>
|
||||
@ -132,6 +135,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>typedef</li>
|
||||
<li>var</li>
|
||||
<li>void</li>
|
||||
<li>when</li>
|
||||
<li>while</li>
|
||||
<li>with</li>
|
||||
<li>yield</li>
|
||||
|
@ -11,7 +11,7 @@ title: Documentation for the dart Generator
|
||||
| generator type | CLIENT | |
|
||||
| generator language | Dart | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Dart 2.x client library. | |
|
||||
| helpTxt | Generates a Dart client library. | |
|
||||
|
||||
## CONFIG OPTIONS
|
||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||
@ -68,7 +68,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>as</li>
|
||||
<li>assert</li>
|
||||
<li>async</li>
|
||||
<li>augment</li>
|
||||
<li>await</li>
|
||||
<li>base</li>
|
||||
<li>break</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
@ -116,6 +118,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>required</li>
|
||||
<li>rethrow</li>
|
||||
<li>return</li>
|
||||
<li>sealed</li>
|
||||
<li>set</li>
|
||||
<li>show</li>
|
||||
<li>source</li>
|
||||
@ -130,6 +133,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>typedef</li>
|
||||
<li>var</li>
|
||||
<li>void</li>
|
||||
<li>when</li>
|
||||
<li>while</li>
|
||||
<li>with</li>
|
||||
<li>yield</li>
|
||||
|
@ -212,7 +212,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a Dart 2.x client library.";
|
||||
return "Generates a Dart client library.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,7 +2,9 @@ abstract
|
||||
as
|
||||
assert
|
||||
async
|
||||
augment
|
||||
await
|
||||
base
|
||||
break
|
||||
case
|
||||
catch
|
||||
@ -50,6 +52,7 @@ patch
|
||||
required
|
||||
rethrow
|
||||
return
|
||||
sealed
|
||||
set
|
||||
show
|
||||
source
|
||||
@ -64,6 +67,7 @@ try
|
||||
typedef
|
||||
var
|
||||
void
|
||||
when
|
||||
while
|
||||
with
|
||||
yield
|
@ -10,7 +10,7 @@ publish_to: {{.}}
|
||||
{{/pubPublishTo}}
|
||||
|
||||
environment:
|
||||
sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <3.0.0'
|
||||
sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -13,7 +13,7 @@ repository: {{.}}
|
||||
publish_to: {{.}}
|
||||
{{/pubPublishTo}}
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
sdk: '>=2.12.0 <4.0.0'
|
||||
dependencies:
|
||||
collection: '^1.17.0'
|
||||
http: '>=0.13.0 <0.14.0'
|
||||
|
@ -4,7 +4,7 @@ description: OpenAPI API client
|
||||
homepage: homepage
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
sdk: '>=2.15.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -4,7 +4,7 @@ description: OpenAPI API client
|
||||
homepage: homepage
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
sdk: '>=2.15.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -4,7 +4,7 @@ description: OpenAPI API client
|
||||
homepage: homepage
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
sdk: '>=2.15.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -4,7 +4,7 @@ description: OpenAPI API client
|
||||
homepage: homepage
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.0 <3.0.0'
|
||||
sdk: '>=2.17.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -4,7 +4,7 @@ description: OpenAPI API client
|
||||
homepage: homepage
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
sdk: '>=2.15.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
dio: '^5.2.0'
|
||||
|
@ -5,7 +5,7 @@ description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.0 <3.0.0'
|
||||
sdk: '>=2.15.0 <4.0.0'
|
||||
|
||||
dev_dependencies:
|
||||
built_collection: 5.1.1
|
||||
|
@ -7,7 +7,7 @@ version: '1.0.0'
|
||||
description: 'OpenAPI API client'
|
||||
homepage: 'homepage'
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
sdk: '>=2.12.0 <4.0.0'
|
||||
dependencies:
|
||||
collection: '^1.17.0'
|
||||
http: '>=0.13.0 <0.14.0'
|
||||
|
@ -7,7 +7,7 @@ version: '1.0.0'
|
||||
description: 'OpenAPI API client'
|
||||
homepage: 'homepage'
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
sdk: '>=2.12.0 <4.0.0'
|
||||
dependencies:
|
||||
collection: '^1.17.0'
|
||||
http: '>=0.13.0 <0.14.0'
|
||||
|
Loading…
x
Reference in New Issue
Block a user