Skip to content

Commit

Permalink
Merge pull request #3 from dastein1/do-not-rely-on-rename
Browse files Browse the repository at this point in the history
do not rely on rename
  • Loading branch information
jonasbark authored Oct 1, 2022
2 parents 6caa217 + e62a1ed commit 9c778cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/openapi_freezed_dio_builder/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ builders:
openapi_freezed_dio_builder:
import: 'package:openapi_freezed_dio_builder/openapi_freezed_dio_builder.dart'
builder_factories: ['openapiCodeBuilder']
build_extensions: {".openapi.yaml": [".openapi.dart"]}
auto_apply: dependents
# build_to: cache
build_extensions: { '.openapi.yaml': ['.openapi.dart'] }
auto_apply: all_packages
build_to: source
runs_before: ['json_serializable|json_serializable']
applies_builders: ['freezed', json_serializable]
runs_before: ['freezed', 'json_serializable']
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,8 @@ class OpenApiCodeBuilder extends Builder {
final l = OpenApiLibraryGenerator(
api,
baseName,
AssetId(outputId.package, outputId.path.replaceAll('.openapi', '')).changeExtension('.g.dart').pathSegments.last,
AssetId(outputId.package, outputId.path.replaceAll('.openapi', ''))
AssetId(outputId.package, outputId.path).changeExtension('.g.dart').pathSegments.last,
AssetId(outputId.package, outputId.path)
.changeExtension('.freezed.dart')
.pathSegments
.last,
Expand All @@ -864,10 +864,10 @@ class OpenApiCodeBuilder extends Builder {
// print(DartFormatter().format('${l.accept(emitter)}'));
//print('inputId: $inputId / outputId: $outputId');
await buildStep.writeAsString(outputId, libraryOutput);
Future<void>.delayed(Duration(seconds: 1)).then((_) {
// no idea what I'm doing
File(outputId.path).rename(outputId.path.replaceAll('openapi.', ''));
});
// Future<void>.delayed(Duration(seconds: 1)).then((_) {
// // no idea what I'm doing
// File(outputId.path).rename(outputId.path.replaceAll('openapi.', ''));
// });
}

@override
Expand Down

0 comments on commit 9c778cb

Please sign in to comment.