@@ -4,8 +4,8 @@ use anyhow::Result;
44use clap:: { Args , Parser } ;
55use colored:: { ColoredString , Colorize } ;
66use dojo_bindgen:: { BuiltinPlugins , PluginManager } ;
7- use dojo_world:: local:: { ResourceLocal , WorldLocal } ;
87use dojo_world:: ResourceType ;
8+ use dojo_world:: local:: { ResourceLocal , WorldLocal } ;
99use scarb:: core:: { Config , Package , TargetKind } ;
1010use scarb:: ops:: CompileOpts ;
1111use scarb_ui:: args:: { FeaturesSpec , PackagesFilter } ;
@@ -38,6 +38,10 @@ pub struct BuildArgs {
3838 #[ arg( help = "Generate Unreal Engine bindings." ) ]
3939 pub unrealengine : bool ,
4040
41+ #[ arg( long) ]
42+ #[ arg( help = "Generate Go bindings." ) ]
43+ pub golang : bool ,
44+
4145 #[ arg( long) ]
4246 #[ arg( help = "Output directory." , default_value = "bindings" ) ]
4347 pub bindings_output : String ,
@@ -60,25 +64,25 @@ pub struct BuildArgs {
6064pub struct StatOptions {
6165 #[ arg( long = "stats.by-tag" ) ]
6266 #[ arg( help = "Sort the stats by tag." ) ]
63- #[ arg( conflicts_with_all = [ "stats.by-sierra-mb " , "stats.by-sierra-felts " , "stats.by-casm-felts " ] ) ]
67+ #[ arg( conflicts_with_all = [ "sort_by_sierra_mb " , "sort_by_sierra_felts " , "sort_by_casm_felts " ] ) ]
6468 #[ arg( default_value_t = false ) ]
6569 pub sort_by_tag : bool ,
6670
6771 #[ arg( long = "stats.by-sierra-mb" ) ]
6872 #[ arg( help = "Sort the stats by Sierra file size in MB." ) ]
69- #[ arg( conflicts_with_all = [ "stats.by-tag " , "stats.by-sierra-felts " , "stats.by-casm-felts " ] ) ]
73+ #[ arg( conflicts_with_all = [ "sort_by_tag " , "sort_by_sierra_felts " , "sort_by_casm_felts " ] ) ]
7074 #[ arg( default_value_t = false ) ]
7175 pub sort_by_sierra_mb : bool ,
7276
7377 #[ arg( long = "stats.by-sierra-felts" ) ]
7478 #[ arg( help = "Sort the stats by Sierra program size in felts." ) ]
75- #[ arg( conflicts_with_all = [ "stats.by-tag " , "stats.by-sierra-mb " , "stats.by-casm-felts " ] ) ]
79+ #[ arg( conflicts_with_all = [ "sort_by_tag " , "sort_by_sierra_mb " , "sort_by_casm_felts " ] ) ]
7680 #[ arg( default_value_t = false ) ]
7781 pub sort_by_sierra_felts : bool ,
7882
7983 #[ arg( long = "stats.by-casm-felts" ) ]
8084 #[ arg( help = "Sort the stats by Casm bytecode size in felts." ) ]
81- #[ arg( conflicts_with_all = [ "stats.by-tag " , "stats.by-sierra-mb " , "stats.by-sierra-felts " ] ) ]
85+ #[ arg( conflicts_with_all = [ "sort_by_tag " , "sort_by_sierra_mb " , "sort_by_sierra_felts " ] ) ]
8286 #[ arg( default_value_t = false ) ]
8387 pub sort_by_casm_felts : bool ,
8488}
@@ -138,6 +142,10 @@ impl BuildArgs {
138142 builtin_plugins. push ( BuiltinPlugins :: UnrealEngine ) ;
139143 }
140144
145+ if self . golang {
146+ builtin_plugins. push ( BuiltinPlugins :: Golang ) ;
147+ }
148+
141149 // Custom plugins are always empty for now.
142150 let bindgen = PluginManager {
143151 profile_name : ws. current_profile ( ) . expect ( "Profile expected" ) . to_string ( ) ,
@@ -223,6 +231,7 @@ impl Default for BuildArgs {
223231 recs : false ,
224232 unity : false ,
225233 unrealengine : false ,
234+ golang : false ,
226235 bindings_output : "bindings" . to_string ( ) ,
227236 stats : StatOptions :: default ( ) ,
228237 packages : None ,
0 commit comments