File tree Expand file tree Collapse file tree 5 files changed +34
-6
lines changed
crates/tauri-cli/src/mobile Expand file tree Collapse file tree 5 files changed +34
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " tauri-cli " : " minor:feat"
3
+ " @tauri-apps/cli " : " minor:feat"
4
+ ---
5
+
6
+ Allow passing Cargo arguments to mobile dev and build commands.
Original file line number Diff line number Diff line change @@ -73,6 +73,11 @@ pub struct Options {
73
73
/// Skip prompting for values
74
74
#[ clap( long, env = "CI" ) ]
75
75
pub ci : bool ,
76
+ /// Command line arguments passed to the runner.
77
+ /// Use `--` to explicitly mark the start of the arguments.
78
+ /// e.g. `tauri android build -- [runnerArgs]`.
79
+ #[ clap( last( true ) ) ]
80
+ pub args : Vec < String > ,
76
81
}
77
82
78
83
impl From < Options > for BuildOptions {
@@ -85,7 +90,7 @@ impl From<Options> for BuildOptions {
85
90
bundles : None ,
86
91
no_bundle : false ,
87
92
config : options. config ,
88
- args : Vec :: new ( ) ,
93
+ args : options . args ,
89
94
ci : options. ci ,
90
95
}
91
96
}
@@ -197,6 +202,7 @@ fn run_build(
197
202
let interface_options = InterfaceOptions {
198
203
debug : build_options. debug ,
199
204
target : build_options. target . clone ( ) ,
205
+ args : build_options. args . clone ( ) ,
200
206
..Default :: default ( )
201
207
} ;
202
208
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ pub struct Options {
96
96
/// Specify port for the built-in dev server for static files. Defaults to 1430.
97
97
#[ clap( long, env = "TAURI_CLI_PORT" ) ]
98
98
pub port : Option < u16 > ,
99
+ /// Command line arguments passed to the runner.
100
+ /// Use `--` to explicitly mark the start of the arguments.
101
+ /// e.g. `tauri android dev -- [runnerArgs]`.
102
+ #[ clap( last( true ) ) ]
103
+ pub args : Vec < String > ,
99
104
}
100
105
101
106
impl From < Options > for DevOptions {
@@ -106,7 +111,7 @@ impl From<Options> for DevOptions {
106
111
features : options. features ,
107
112
exit_on_panic : options. exit_on_panic ,
108
113
config : options. config ,
109
- args : Vec :: new ( ) ,
114
+ args : options . args ,
110
115
no_watch : options. no_watch ,
111
116
no_dev_server_wait : options. no_dev_server_wait ,
112
117
no_dev_server : options. no_dev_server ,
@@ -257,7 +262,7 @@ fn run_dev(
257
262
MobileOptions {
258
263
debug : !options. release_mode ,
259
264
features : options. features ,
260
- args : Vec :: new ( ) ,
265
+ args : options . args ,
261
266
config : dev_options. config . clone ( ) ,
262
267
no_watch : options. no_watch ,
263
268
} ,
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ pub struct Options {
83
83
/// Use this to create a package ready for the App Store (app-store-connect option) or TestFlight (release-testing option).
84
84
#[ clap( long, value_enum) ]
85
85
pub export_method : Option < ExportMethod > ,
86
+ /// Command line arguments passed to the runner.
87
+ /// Use `--` to explicitly mark the start of the arguments.
88
+ /// e.g. `tauri ios build -- [runnerArgs]`.
89
+ #[ clap( last( true ) ) ]
90
+ pub args : Vec < String > ,
86
91
}
87
92
88
93
#[ derive( Debug , Clone , Copy , ValueEnum ) ]
@@ -125,7 +130,7 @@ impl From<Options> for BuildOptions {
125
130
bundles : None ,
126
131
no_bundle : false ,
127
132
config : options. config ,
128
- args : Vec :: new ( ) ,
133
+ args : options . args ,
129
134
ci : options. ci ,
130
135
}
131
136
}
@@ -282,6 +287,7 @@ fn run_build(
282
287
let out_dir = app_settings. out_dir ( & InterfaceOptions {
283
288
debug : build_options. debug ,
284
289
target : build_options. target . clone ( ) ,
290
+ args : build_options. args . clone ( ) ,
285
291
..Default :: default ( )
286
292
} ) ?;
287
293
let _lock = flock:: open_rw ( out_dir. join ( "lock" ) . with_extension ( "ios" ) , "iOS" ) ?;
Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ pub struct Options {
101
101
/// Specify port for the built-in dev server for static files. Defaults to 1430.
102
102
#[ clap( long, env = "TAURI_CLI_PORT" ) ]
103
103
pub port : Option < u16 > ,
104
+ /// Command line arguments passed to the runner.
105
+ /// Use `--` to explicitly mark the start of the arguments.
106
+ /// e.g. `tauri ios dev -- [runnerArgs]`.
107
+ #[ clap( last( true ) ) ]
108
+ pub args : Vec < String > ,
104
109
}
105
110
106
111
impl From < Options > for DevOptions {
@@ -112,7 +117,7 @@ impl From<Options> for DevOptions {
112
117
exit_on_panic : options. exit_on_panic ,
113
118
config : options. config ,
114
119
release_mode : options. release_mode ,
115
- args : Vec :: new ( ) ,
120
+ args : options . args ,
116
121
no_watch : options. no_watch ,
117
122
no_dev_server : options. no_dev_server ,
118
123
no_dev_server_wait : options. no_dev_server_wait ,
@@ -265,7 +270,7 @@ fn run_dev(
265
270
MobileOptions {
266
271
debug : true ,
267
272
features : options. features ,
268
- args : Vec :: new ( ) ,
273
+ args : options . args ,
269
274
config : dev_options. config . clone ( ) ,
270
275
no_watch : options. no_watch ,
271
276
} ,
You can’t perform that action at this time.
0 commit comments