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

[dart] [dart-dio] Support Dart3 #18001

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions bin/utils/dart-keywords/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
2 changes: 1 addition & 1 deletion bin/utils/dart-keywords/dart-version.txt
Original file line number Diff line number Diff line change
@@ -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"
159 changes: 57 additions & 102 deletions bin/utils/dart-keywords/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
source: hosted
version: "2.4.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
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"
source: hosted
version: "2.1.3"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "0.16.1"
front_end:
version: "3.0.3"
file:
dependency: transitive
description:
name: front_end
url: "https://pub.dartlang.org"
name: file
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
version: "0.1.29"
version: "7.0.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
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"
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
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"
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"
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
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"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
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"
2 changes: 1 addition & 1 deletion bin/utils/dart-keywords/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
11 changes: 3 additions & 8 deletions bin/utils/dart-keywords/save-dart-keywords.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
5 changes: 2 additions & 3 deletions bin/utils/dart-keywords/save_dart_keywords.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dart2native save-dart-keywords.dart
./save-dart-keywords.exe
dart --version &> dart-version.txt
dart run save-dart-keywords.dart
dart --version &> dart-version.txt
2 changes: 1 addition & 1 deletion docs/generators/dart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public String getName() {

@Override
public String getHelp() {
return "Generates a Dart 2.x client library.";
return "Generates a Dart client library.";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ abstract
as
assert
async
augment
await
base
break
case
catch
Expand Down Expand Up @@ -50,6 +52,7 @@ patch
required
rethrow
return
sealed
set
show
source
Expand All @@ -64,6 +67,7 @@ try
typedef
var
void
when
while
with
yield
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading
Loading