Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CompileCmd = &cobra.Command{ Use: "compile", Short: "Generate a factory binary's main.go from factory source", RunE: func(cmd *cobra.Command, args []string) error { return runCompile(cmd, compileCfg) }, } )
View Source
var DepsCmd = &cobra.Command{
Use: "deps",
Short: "Manage a factory's dependencies",
Long: `Manage dependency floors in project.ub and selected versions in project-lock.ub.
A factory or UB library writes imports in .ub source. The project records
its direct dependency floors, and project-lock records the versions and source
hashes the compiler should use.`,
}
DepsCmd is the parent for the dependency-management subcommands.
View Source
var ( FmtCmd = &cobra.Command{ Use: "fmt [paths...]", Short: "Format .ub source files", Long: `Reformat one or more .ub files in canonical form. With no path arguments, fmt reads from stdin and writes the formatted bytes to stdout. With one or more paths, each file is formatted in turn; directory arguments are walked recursively for *.ub files. Flags: -w / --write overwrite each file in place instead of writing to stdout. -l / --list print the names of files whose formatted output differs from their current contents; no other output. Examples: unobin fmt factory.ub unobin fmt -w factory.ub libraries/ unobin fmt -l . `, RunE: func(cmd *cobra.Command, args []string) error { return runFmt(cmd, args, fmtCfg) }, } )
View Source
var GenerateCmd = &cobra.Command{
Use: "generate",
Short: "Generate code and scaffold libraries",
}
View Source
var ( PrintGraphCmd = &cobra.Command{ Use: "print-graph", Short: "Print a factory's dependency graph without compiling it", Long: `Print a factory's dependency graph from its source. Imports are resolved in memory; composite call sites are expanded into their internal sub-nodes the same way the generated binary's print-graph subcommand does. The output is intended to match what the compiled binary would emit. Examples: unobin print-graph unobin print-graph -p factory.ub --format dot | dot -Tsvg > graph.svg`, RunE: func(cmd *cobra.Command, args []string) error { return runPrintGraph(cmd, printGraphCfg) }, } )
View Source
var Version = "dev"
Version is the build time version string. Set via -ldflags.
Functions ¶
func SetCompileResolverForTest ¶
SetCompileResolverForTest replaces the resolver factory and returns a restore function.
func SetDepsListTagsForTest ¶
SetDepsListTagsForTest replaces tag listing and returns a restore function.
func SetRemoteResolverForTest ¶
func SetRemoteResolverForTest(newResolver func() (*resolve.RemoteResolver, error)) func()
SetRemoteResolverForTest replaces remote resolver construction and returns a restore function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.