File tree Expand file tree Collapse file tree 6 files changed +43
-15
lines changed Expand file tree Collapse file tree 6 files changed +43
-15
lines changed Original file line number Diff line number Diff line change
1
+ on :
2
+ push :
3
+ branches :
4
+ - master
5
+
6
+ jobs :
7
+ generate_bindings :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v4
11
+ - uses : subosito/flutter-action@v2
12
+ with :
13
+ channel : ' stable'
14
+ - run : make flutter_bindings
15
+ - name : Archive generated flutter_eval.json
16
+ uses : actions/upload-artifact@v4
17
+ with :
18
+ name : flutter_eval.json
19
+ path : flutter_eval.json
Original file line number Diff line number Diff line change
1
+ .PHONY : flutter_bindings
2
+ flutter_bindings :
3
+ flutter pub get
4
+ flutter test tool/generate_bindings.dart || true
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ environment:
9
9
dependencies :
10
10
flutter :
11
11
sdk : flutter
12
- dart_eval : ^0.6.0
12
+ dart_eval : ^0.7.8
13
13
flutter_eval :
14
14
path : ../
15
15
Original file line number Diff line number Diff line change @@ -17,13 +17,14 @@ environment:
17
17
dependencies :
18
18
flutter :
19
19
sdk : flutter
20
-
20
+
21
21
# The following adds the Cupertino Icons font to your application.
22
22
# Use with the CupertinoIcons class for iOS style icons.
23
23
cupertino_icons : ^1.0.6
24
- flutter_eval : ^0.7.4
24
+ flutter_eval :
25
+ path : ../../
25
26
dart_eval : ^0.7.8
26
-
27
+
27
28
dev_dependencies :
28
29
flutter_test :
29
30
sdk : flutter
Original file line number Diff line number Diff line change 1
- import 'dart:convert' ;
2
- import 'dart:io' ;
3
-
4
1
import 'package:dart_eval/dart_eval.dart' ;
5
2
import 'package:dart_eval/dart_eval_bridge.dart' ;
6
3
import 'package:dart_eval/stdlib/core.dart' ;
@@ -11,14 +8,6 @@ import 'package:flutter_eval/src/painting/alignment.dart';
11
8
import 'package:flutter_test/flutter_test.dart' ;
12
9
13
10
void main () {
14
- // This is not actually a test, it just generates the flutter_eval.json file.
15
- test ('Generate flutter_eval.json' , () {
16
- final serializer = BridgeSerializer ();
17
- serializer.addPlugin (const FlutterEvalPlugin ());
18
- final output = serializer.serialize ();
19
- File ('flutter_eval.json' ).writeAsStringSync (json.encode (output));
20
- });
21
-
22
11
test ('Can extend StatelessWidget' , () {
23
12
final compiler = Compiler ();
24
13
setupFlutterForCompile (compiler);
Original file line number Diff line number Diff line change
1
+ import 'dart:convert' ;
2
+ import 'dart:io' ;
3
+
4
+ import 'package:dart_eval/dart_eval_bridge.dart' ;
5
+ import 'package:flutter_eval/flutter_eval.dart' ;
6
+
7
+ void main () {
8
+ // To properly generate the bindings, dart_eval needs Flutter context which is
9
+ // delivered when running Dart programs via `flutter test`,
10
+ // but isn't for Dart code ran via `dart run`.
11
+ final serializer = BridgeSerializer ();
12
+ serializer.addPlugin (const FlutterEvalPlugin ());
13
+ final output = serializer.serialize ();
14
+ File ('flutter_eval.json' ).writeAsStringSync (json.encode (output));
15
+ }
You can’t perform that action at this time.
0 commit comments