aboutsummaryrefslogtreecommitdiff
path: root/docs/build.7
blob: b9099de7dec209161b32ebef58f2fc25f28c7bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.TH build 1 "June 3, 2011" "Xagasoft" "Geekgene"
.SH NAME
.P
build.conf configuration files.
.SH SYNOPSIS
.P
These files describe how to build something, generally software from source
code, but it can really be anything.
.SH DESCRIPTION
.P
For now, I'm just going to list some things here, here are the functions
available to you for general use at the moment:
.TP
.B
dirs()
Takes any number of string parameters, matches the file system based on glob
patterns and returns all directories that match the given patterns.
.TP
.B
files()
Takes any number of string parameters, matches the file system based on glob
patterns and returns all files that match the given patterns.
.TP
.B
execute()
Takes one string parameter, and executes it as a command using your shell.
.TP
.B
exists()
Checks to see if the given file/directory/etc exists on the file system, if it
does, true is returned, otherwise, false.
.TP
.B
matches()
Checks the input of the function to see if it matches a given wildcard pattern,
the pattern may include any number of * (meaning match any number of any
character) or ? (meaning match one of any character) symbols.  If the input is
a string, then true or false is returned.  If the input is a list, a filtered
version of the list is returned, containing only the elements that matched the
pattern.
.TP
.B
replace()
Takes two string parameters and replaces all occurances of the first with the
second in the input string or list of strings.
.TP
.B
targets()
Returns a list of target outputs, this will return every output for any target
that it finds seperately, so targets with multiple outputs will be in the list
more than once.  With no parametrs it returns a list of all explicitly defined
targets, with a string parameter it returns all targets that have the given
tag.
.TP
.B
toString()
Takes the input and converts it to a string, with no parameters it uses default
formatting, this means that for lists it puts a space between each element.
.TP
.B
unlink()
Unlinks (deletes) the given file or files from the filesystem.  It can take any
number of string or string list parameters.
.TP
.B
getMakeDeps()
Returns a list of files ready for use in a requires statement from the stdout of the command provided in the only string parameter.  The command should output the dependancies in makefile format.
.TP
.B
fileName()
Returns the file portion of the string provided as input.  That is, it returns everything after the last '/' character.  This may not always be a file, it could be a directory, or even just an arbitrary part of a string that may or may not have '/' in it.  If the input ends with a slash this will return an empty string.
.TP
.B
dirName()
Returns the directory portion of the string provided as input.  That is, it returns everything before the last '/' character.  Read the caveat for fileName about what this really means.  If the input ends with a slash this will return the entire string, except the trailing slash.
.TP
.B
range()
Returns a list of numbers that fit in the specified range.  There are three forms of this function, with one parameter it will produce a list of numbers between one and the number specified, inclusive.  With two parameters the first is the starting number, the second is the last number in the range.  With a third parameter you also specify the step size.  At the moment the only way to make a list that is in decending order is to specify a negative step size.
.TP
.B
open()
Opens a file in the filesystem, creating it if it doesn't exist.  This takes two parameters, first is the filename, second is the mode string.  The mode is just a plain string that can contain any number of flag characters.  The flags available are 'w' for write mode, and 'r' for read mode.  You can specify both r and w.  Open returns a file handle that needs to be used for all future file operations on that file.
.TP
.B
write()
Takes a file handle as it's input, and takes a string as it's parameter.  The string is written to the file as is.  If a parameter is specified that isn't a string, it will be converted to a string as best as it can be.
.TP
.B
read()
Takes a file handle as it's input, and takes an integer as it's parameter.  The integer specified is how many bytes to read form the file.  Up to that many bytes will be returned as a string, fewer if fewer are available.
.TP
.B
close()
Takes a file handle as it's input, and no parameters.  Closes the file indicated by the handle provided as input.  While it is reccomended to close all files as soon as you are done with them, any files left open will be closed automatically and safely before build exists.
.P
Here, lets list functions we wish we had...
.SH ENVIRONMENT
.SH FILES
.SH CONFORMING TO
.SH NOTES
.SH BUGS
.SH EXAMPLE
.SH SEE ALSO