File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,6 @@ class CodeBuilder extends Builder {
3030 @override
3131 FutureOr <void > build (BuildStep buildStep) async {
3232 // build() will be called only twice, once for the `lib` directory and once for the `test` directory
33- Pubspec ? pubspec;
34- try {
35- final pubspecFile = File (path.join (dir (buildStep), '../pubspec.yaml' ));
36- pubspec = Pubspec .parse (pubspecFile.readAsStringSync ());
37- } catch (e) {
38- log.info ("Couldn't load pubspec.yaml: $e " );
39- }
40-
4133 // map from file name to a 'json' representation of entities
4234 final files = < String , List <dynamic >> {};
4335 final glob = Glob (dir (buildStep) + '/**' + EntityResolver .suffix);
@@ -61,6 +53,14 @@ class CodeBuilder extends Builder {
6153 // update the model JSON with the read entities
6254 final model = await updateModel (entities, buildStep);
6355
56+ Pubspec ? pubspec;
57+ try {
58+ final pubspecFile = File (path.join (dir (buildStep), '../pubspec.yaml' ));
59+ pubspec = Pubspec .parse (pubspecFile.readAsStringSync ());
60+ } catch (e) {
61+ log.info ("Couldn't load pubspec.yaml: $e " );
62+ }
63+
6464 // generate binding code
6565 updateCode (model, files.keys.toList (growable: false ), buildStep, pubspec);
6666 }
You can’t perform that action at this time.
0 commit comments