mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 10:35:25 +00:00
11bcb661a1
* Add script to use Dart SDK to generate keywords * Read generated keywords in dart generator
17 lines
473 B
Dart
17 lines
473 B
Dart
import 'dart:io';
|
|
|
|
import 'package:analyzer/dart/ast/token.dart';
|
|
|
|
main() {
|
|
// save keywords to a text file
|
|
final txtFile = 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);
|
|
}
|