59 lines
1.9 KiB
Groff
59 lines
1.9 KiB
Groff
.TH "TBUILD-BUILD" "1" "" "" "TBuild Manual"
|
|
.nh
|
|
.ad l
|
|
.SH "NAME"
|
|
tbuild-build \- Build a project. Aliases: [b|.]
|
|
.SH "SYNOPSIS"
|
|
.SP
|
|
.nf
|
|
\fItbuild build\fR [-z|-Z|--zeal] [-w|-W|--watch]
|
|
.fi
|
|
.SP
|
|
.SH DESCRIPTION
|
|
.sp
|
|
This command build a project based on your current working directory. If a manifest is not found in your current working directory, tbuild will then start to look in parent directories.
|
|
.sp
|
|
When run the following steps will be taken when the command is executed:
|
|
.if n \{\
|
|
.RE
|
|
.\}
|
|
.sp
|
|
\fB1. \fRAll dependencies get updated\&.
|
|
.br
|
|
\fB2. \fRThe build directory is created and files are copied (lib/ and src/)\&.
|
|
.br
|
|
\fB3. \fRScripts are run if a scripts/ directory is present\&.
|
|
.br
|
|
\fB4. \fRZealOS conversion starts if enabled\&.
|
|
.br
|
|
\fB5. \fRAll of the above get repeated if in \fIwatch mode\fR\&.
|
|
.br
|
|
.SH OPTIONS
|
|
.PP
|
|
\-z, \-Z. \-\-zeal
|
|
.RS 4
|
|
After code is generated and built, the built code will then be converted to be ZealOS-compatible. For now, it only does a simple find and replace.
|
|
.RE
|
|
.PP
|
|
\-w, \-W. \-\-watch
|
|
.RS 4
|
|
\fItbuild\fR will enter \fIwatch mode\fR, in which it continues to check for file changes under the src/ and lib/ directories. Whenever a change is detected, the code is the re-built.
|
|
.RE
|
|
.SH SCRIPTS
|
|
.sp
|
|
Scripts are a great feature of tbuild. They enable features like code generation. In order to use it, you need to have a folder called "scripts" inside your root project directory. In it, you can then place various \fBpython\fR(1) scripts to run. Those files are ran in the order provided by your operating system. This feature also supports recursion, which allows you to have a tree-structure of scripts.
|
|
.sp
|
|
An important thing to keep in mind is that python scripts are ran \fBin the current directory\fR you are in. In order to mitigate that, you may want to use something like this:
|
|
.RS 4
|
|
.sp
|
|
.if n \{\
|
|
.RS 4
|
|
.\}
|
|
.nf
|
|
import os
|
|
project_path = os.path.dirname(os.path.realpath(__file__)) + '/..'
|
|
.fi
|
|
.if n \{\
|
|
.RE
|
|
.\}
|