File tree 9 files changed +41
-30
lines changed
flutter_app_builder/lib/src
9 files changed +41
-30
lines changed Original file line number Diff line number Diff line change 1
1
output : dist/
2
2
variables :
3
- FLUTTER_ROOT : ~/fvm/versions/3.10.0
3
+ FLUTTER_ROOT : ~/fvm/versions/3.10.3
4
4
# PGYER_API_KEY: your api key
5
5
releases :
6
6
- name : dev-profile
@@ -79,7 +79,7 @@ releases:
79
79
jobs :
80
80
- name : android-aab
81
81
variables :
82
- FLUTTER_ROOT : ~/fvm/versions/3.10.2
82
+ FLUTTER_ROOT : ~/fvm/versions/3.10.3
83
83
package :
84
84
platform : android
85
85
target : aab
@@ -113,6 +113,8 @@ releases:
113
113
package :
114
114
platform : macos
115
115
target : dmg
116
+ build_args :
117
+ dart-define-from-file : env.json
116
118
- name : macos-pkg
117
119
package :
118
120
platform : macos
Original file line number Diff line number Diff line change
1
+ {
2
+ "APP_ENV" : " dev"
3
+ }
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ class MyHomePage extends StatefulWidget {
50
50
class _MyHomePageState extends State <MyHomePage > {
51
51
int _counter = 0 ;
52
52
53
+ String get _appEnv {
54
+ return const String .fromEnvironment ('APP_ENV' );
55
+ }
56
+
53
57
String get _buildName {
54
58
return const String .fromEnvironment ('FLUTTER_BUILD_NAME' );
55
59
}
@@ -110,6 +114,10 @@ class _MyHomePageState extends State<MyHomePage> {
110
114
'$_counter ' ,
111
115
style: Theme .of (context).textTheme.headlineMedium,
112
116
),
117
+ Text (
118
+ 'APP_ENV: $_appEnv ' ,
119
+ style: Theme .of (context).textTheme.bodyMedium,
120
+ ),
113
121
Text (
114
122
'FLUTTER_BUILD_NAME: $_buildName ' ,
115
123
style: Theme .of (context).textTheme.bodyMedium,
Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ packages:
45
45
dependency: "direct main"
46
46
description:
47
47
name: cupertino_icons
48
- sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
48
+ sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
49
49
url: "https://pub.dev"
50
50
source: hosted
51
- version: "1.0.5 "
51
+ version: "1.0.6 "
52
52
fake_async:
53
53
dependency: transitive
54
54
description:
@@ -66,10 +66,10 @@ packages:
66
66
dependency: "direct dev"
67
67
description:
68
68
name: flutter_lints
69
- sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
69
+ sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
70
70
url: "https://pub.dev"
71
71
source: hosted
72
- version: "2.0.1 "
72
+ version: "2.0.3 "
73
73
flutter_test:
74
74
dependency: "direct dev"
75
75
description: flutter
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ abstract class AppBuilder {
65
65
);
66
66
67
67
if (processResult.exitCode != 0 ) {
68
- throw BuildError ();
68
+ throw BuildError ('${ processResult . stderr }' );
69
69
}
70
70
71
71
return resultResolver.resolve (config)..duration = time.elapsed;
Original file line number Diff line number Diff line change @@ -56,14 +56,20 @@ class _Flutter extends Command {
56
56
String flutterRoot = environment? ['FLUTTER_ROOT' ] ?? '' ;
57
57
if (flutterRoot.isNotEmpty) {
58
58
flutterRoot = pathExpansion (flutterRoot, environment ?? {});
59
+ if (! Directory (flutterRoot).existsSync ()) {
60
+ throw CommandError (
61
+ this ,
62
+ 'FLUTTER_ROOT environment variable is set to a path that does not exist: $flutterRoot ' ,
63
+ );
64
+ }
59
65
return p.join (flutterRoot, 'bin' , 'flutter' );
60
66
}
61
67
return 'flutter' ;
62
68
}
63
69
64
70
Map <String , String >? environment;
65
71
66
- withEnv (Map <String , String >? environment) {
72
+ _Flutter withEnv (Map <String , String >? environment) {
67
73
this .environment = environment;
68
74
return this ;
69
75
}
Original file line number Diff line number Diff line change 1
1
library shell_executor;
2
2
3
3
export 'src/command.dart' ;
4
+ export 'src/command_error.dart' ;
4
5
export 'src/shell_executor.dart' ;
5
6
export 'src/utils/path_expansion.dart' ;
Original file line number Diff line number Diff line change @@ -30,26 +30,4 @@ abstract class Command {
30
30
runInShell: runInShell,
31
31
);
32
32
}
33
-
34
- Future <ProcessResult > run (
35
- List <String > arguments, {
36
- Map <String , String >? environment,
37
- }) {
38
- return exec (
39
- arguments,
40
- environment: environment,
41
- );
42
- }
43
-
44
- ProcessResult runSync (
45
- List <String > arguments, {
46
- Map <String , String >? environment,
47
- bool runInShell = false ,
48
- }) {
49
- return execSync (
50
- arguments,
51
- environment: environment,
52
- runInShell: runInShell,
53
- );
54
- }
55
33
}
Original file line number Diff line number Diff line change
1
+ import 'package:shell_executor/src/command.dart' ;
2
+
3
+ class CommandError extends Error {
4
+ CommandError (this .command, [this .message]);
5
+
6
+ final Command command;
7
+ final String ? message;
8
+
9
+ @override
10
+ String toString () {
11
+ return (message != null ) ? 'CommandError: $message ' : 'CommandError' ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments