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 {
7373 /// Skip prompting for values
7474 #[ clap( long, env = "CI" ) ]
7575 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 > ,
7681}
7782
7883impl From < Options > for BuildOptions {
@@ -85,7 +90,7 @@ impl From<Options> for BuildOptions {
8590 bundles : None ,
8691 no_bundle : false ,
8792 config : options. config ,
88- args : Vec :: new ( ) ,
93+ args : options . args ,
8994 ci : options. ci ,
9095 }
9196 }
@@ -197,6 +202,7 @@ fn run_build(
197202 let interface_options = InterfaceOptions {
198203 debug : build_options. debug ,
199204 target : build_options. target . clone ( ) ,
205+ args : build_options. args . clone ( ) ,
200206 ..Default :: default ( )
201207 } ;
202208
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ pub struct Options {
9696 /// Specify port for the built-in dev server for static files. Defaults to 1430.
9797 #[ clap( long, env = "TAURI_CLI_PORT" ) ]
9898 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 > ,
99104}
100105
101106impl From < Options > for DevOptions {
@@ -106,7 +111,7 @@ impl From<Options> for DevOptions {
106111 features : options. features ,
107112 exit_on_panic : options. exit_on_panic ,
108113 config : options. config ,
109- args : Vec :: new ( ) ,
114+ args : options . args ,
110115 no_watch : options. no_watch ,
111116 no_dev_server_wait : options. no_dev_server_wait ,
112117 no_dev_server : options. no_dev_server ,
@@ -257,7 +262,7 @@ fn run_dev(
257262 MobileOptions {
258263 debug : !options. release_mode ,
259264 features : options. features ,
260- args : Vec :: new ( ) ,
265+ args : options . args ,
261266 config : dev_options. config . clone ( ) ,
262267 no_watch : options. no_watch ,
263268 } ,
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ pub struct Options {
8383 /// Use this to create a package ready for the App Store (app-store-connect option) or TestFlight (release-testing option).
8484 #[ clap( long, value_enum) ]
8585 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 > ,
8691}
8792
8893#[ derive( Debug , Clone , Copy , ValueEnum ) ]
@@ -125,7 +130,7 @@ impl From<Options> for BuildOptions {
125130 bundles : None ,
126131 no_bundle : false ,
127132 config : options. config ,
128- args : Vec :: new ( ) ,
133+ args : options . args ,
129134 ci : options. ci ,
130135 }
131136 }
@@ -282,6 +287,7 @@ fn run_build(
282287 let out_dir = app_settings. out_dir ( & InterfaceOptions {
283288 debug : build_options. debug ,
284289 target : build_options. target . clone ( ) ,
290+ args : build_options. args . clone ( ) ,
285291 ..Default :: default ( )
286292 } ) ?;
287293 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 {
101101 /// Specify port for the built-in dev server for static files. Defaults to 1430.
102102 #[ clap( long, env = "TAURI_CLI_PORT" ) ]
103103 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 > ,
104109}
105110
106111impl From < Options > for DevOptions {
@@ -112,7 +117,7 @@ impl From<Options> for DevOptions {
112117 exit_on_panic : options. exit_on_panic ,
113118 config : options. config ,
114119 release_mode : options. release_mode ,
115- args : Vec :: new ( ) ,
120+ args : options . args ,
116121 no_watch : options. no_watch ,
117122 no_dev_server : options. no_dev_server ,
118123 no_dev_server_wait : options. no_dev_server_wait ,
@@ -265,7 +270,7 @@ fn run_dev(
265270 MobileOptions {
266271 debug : true ,
267272 features : options. features ,
268- args : Vec :: new ( ) ,
273+ args : options . args ,
269274 config : dev_options. config . clone ( ) ,
270275 no_watch : options. no_watch ,
271276 } ,
You can’t perform that action at this time.
0 commit comments