File tree Expand file tree Collapse file tree 4 files changed +23
-13
lines changed
Expand file tree Collapse file tree 4 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ use pcl_core::{
1414 ConfigArgs ,
1515 } ,
1616} ;
17- use pcl_phoundry:: phorge_test:: PhorgeTest ;
17+ use pcl_phoundry:: {
18+ build:: BuildArgs ,
19+ phorge_test:: PhorgeTest ,
20+ } ;
1821use serde_json:: json;
1922
2023const VERSION_MESSAGE : & str = concat ! (
@@ -50,6 +53,8 @@ enum Commands {
5053 Auth ( AuthCommand ) ,
5154 #[ command( about = "Manage configuration" ) ]
5255 Config ( ConfigArgs ) ,
56+ #[ command( name = "build" ) ]
57+ Build ( BuildArgs ) ,
5358}
5459
5560#[ tokio:: main]
@@ -85,6 +90,9 @@ async fn main() -> Result<()> {
8590 Commands :: Config ( config_cmd) => {
8691 config_cmd. run ( & mut config) ?;
8792 }
93+ Commands :: Build ( build_cmd) => {
94+ build_cmd. run ( ) ?;
95+ }
8896 } ;
8997 config. write_to_file ( & cli. args ) ?;
9098 Ok :: < _ , Report > ( ( ) )
Original file line number Diff line number Diff line change @@ -135,17 +135,16 @@ impl BuildAndFlattenArgs {
135135
136136 /// Builds the project and returns the compilation output.
137137 fn build ( & self ) -> Result < ProjectCompileOutput , Box < PhoundryError > > {
138- let build_opts =
139- BuildOpts {
140- project_paths : ProjectPathOpts {
141- root : self . root . clone ( ) ,
142- // FIXME(Odysseas): this essentially hard-codes the location of the assertions to live in
143- // assertions/src
144- contracts : Some ( PathBuf :: from ( "assertions/src" ) ) ,
145- ..Default :: default ( )
146- } ,
138+ let build_opts = BuildOpts {
139+ project_paths : ProjectPathOpts {
140+ root : self . root . clone ( ) ,
141+ // FIXME(Odysseas): this essentially hard-codes the location of the assertions to live in
142+ // assertions/src
143+ contracts : Some ( PathBuf :: from ( "assertions/src" ) ) ,
147144 ..Default :: default ( )
148- } ;
145+ } ,
146+ ..Default :: default ( )
147+ } ;
149148
150149 crate :: compile:: compile ( build_opts)
151150 }
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ use crate::error::PhoundryError;
88
99/// Compiles the project and returns the compilation output.
1010pub fn compile ( build_opts : BuildOpts ) -> Result < ProjectCompileOutput , Box < PhoundryError > > {
11- let build_cmd = BuildArgs { build : build_opts, ..Default :: default ( ) } ;
11+ let build_cmd = BuildArgs {
12+ build : build_opts,
13+ ..Default :: default ( )
14+ } ;
1215
1316 let config = build_cmd. load_config ( ) ?;
1417
Original file line number Diff line number Diff line change 11pub mod build;
22pub mod build_and_flatten;
3+ pub mod compile;
34pub mod error;
45pub mod phorge_test;
5- pub mod compile;
You can’t perform that action at this time.
0 commit comments