1bdep-init(1) General Commands Manual bdep-init(1)
2
3
4
6 bdep-init - initialize project in build configurations
7
9 bdep init [options] [pkg-spec] [cfg-spec] [pkg-args]
10 bdep init [options] [prj-spec] --empty|-E
11 bdep init [options] [pkg-spec] --config-add|-A cfg-dir [@cfg-name]
12 [pkg-args]
13 bdep init [options] [pkg-spec] --config-create|-C cfg-dir [@cfg-name]
14 [cfg-args] [-- pkg-args]
15
16 cfg-spec = (@cfg-name | --config|-c cfg-dir)... | --all|-a
17 pkg-spec = (--directory|-d pkg-dir)... | prj-spec
18 prj-spec = --directory|-d prj-dir
19 pkg-args = (pkg | cfg-var)...
20 cfg-args = [-- bpkg-options] [--existing|-e | (module | cfg-var)...]
21
23 The init command initializes a project in one or more build configura‐
24 tions. The first form initializes the specified project packages (pkg-
25 spec), or, if the project itself is specified (prj-spec), all its
26 available packages, in one or more build configurations (cfg-spec) that
27 have already been associated with the project (bdep-config(1)).
28
29 If no project directory is specified, then the current working direc‐
30 tory is assumed. If no configuration is specified, then the default
31 configuration is assumed. See bdep-projects-configs(1) for details on
32 specifying projects and configurations. Optional pkg-args are the addi‐
33 tional dependency packages and/or configuration variables to pass to
34 the underlying bpkg-pkg-build(1) command.
35
36 The second form (--empty is specified) initializes an empty project
37 database that can later be used to first add build configurations
38 (bdep-config(1)) and then initialize project packages using the first
39 form.
40
41 The third (--config-add) and fourth (--config-create) forms are short‐
42 cuts to first adding an existing or newly created build configuration
43 and then initializing project packages in that configuration. Semanti‐
44 cally they are equivalent to first performing the config add or config
45 create commands (bdep-config(1)), respectively, followed by the first
46 form. Optional cfg-args in the fourth form are the additional argu‐
47 ments to the underlying bpkg-cfg-create(1) command. Note that in this
48 case to specify pkg-args without specifying cfg-args you have to use
49 two -- separators, for example:
50
51 $ bdep init -C ../prj-gcc @gcc -- -- ?sys:libsqlite3/*
52
54 As an example, consider project prj with two packages, foo and libfoo:
55
56 prj/
57 ├── foo/
58 └── libfoo/
59
60 The following invocations illustrate the common init use cases (the
61 current working directory is shown before the shell prompt).
62
63 Create new build configuration in ../prj-gcc, call it gcc, and initial‐
64 ize project packages foo and libfoo in this configuration:
65
66 prj/$ bdep init -C ../prj-gcc @gcc cc config.cxx=g++
67
68 Create new build configuration in ../prj-clang using bpkg-cfg-cre‐
69 ate(1). Then add it calling it clang and initialize project package foo
70 in this configuration:
71
72 prj/$ bpkg create -d ../prj-clang cc config.cxx=clang++
73 prj/$ cd foo
74 foo/$ bdep init -A ../../prj-clang @clang
75
76 Initialize project package libfoo in the build configuration clang:
77
78 foo/$ cd ..
79 prj/$ bdep init -d libfoo @clang
80
81 The following set of invocations achieves the same end result but using
82 the bdep-config(1) command to manage configuration.
83
84 Initialize an empty project database:
85
86 prj/$ bdep init --empty
87
88 Create new build configuration in ../prj-gcc, call it gcc:
89
90 prj/$ bdep config create ../prj-gcc @gcc cc config.cxx=g++
91
92 Add existing build configuration in ../prj-clang, call it clang.
93
94 prj/$ bdep config add ../prj-clang @clang
95
96 Initialize project packages foo and libfoo in build configurations gcc
97 and clang.
98
99 prj/$ bdep init @gcc @clang
100
101 Or, alternatively, in all the build configurations:
102
103 prj/$ bdep init -a
104
106 --empty|-E
107 Initialize an empty build configuration set.
108
109 --config-add|-A dir
110 Add an existing build configuration dir.
111
112 --config-create|-C dir
113 Create a new build configuration in dir.
114
115 --no-sync
116 Enter the project into the database but do not initialize it in
117 the build configurations. The initialization can be finished
118 later with an explicit bdep-sync(1) command.
119
120 --default
121 Make the added or created configuration the default.
122
123 --no-default
124 Don't make the first added or created configuration the default.
125
126 --forward
127 Make the added or created configuration forwarded.
128
129 --no-forward
130 Don't make the added or created configuration forwarded.
131
132 --auto-sync
133 Make the added or created configuration automatically synchro‐
134 nized.
135
136 --no-auto-sync
137 Don't make the added or created configuration automatically syn‐
138 chronized.
139
140 --existing|-e
141 Initialize a bpkg configuration based on an existing build sys‐
142 tem configuration.
143
144 --wipe Wipe the configuration directory clean before creating the new
145 configuration.
146
147 --all|-a
148 Use all build configurations.
149
150 --config|-c dir
151 Specify the build configuration as a directory.
152
153 --directory|-d dir
154 Assume project/package is in the specified directory rather than
155 in the current working directory.
156
157 --config-name|-n name
158 Specify the build configuration as a name.
159
160 --config-id num
161 Specify the build configuration as an id.
162
164 The common options are summarized below with a more detailed descrip‐
165 tion available in bdep-common-options(1).
166
167 -v Print essential underlying commands being executed.
168
169 -V Print all underlying commands being executed.
170
171 --quiet|-q
172 Run quietly, only printing error messages.
173
174 --verbose level
175 Set the diagnostics verbosity to level between 0 and 6.
176
177 --jobs|-j num
178 Number of jobs to perform in parallel.
179
180 --no-progress
181 Suppress progress indicators for long-lasting operations, such
182 as network transfers, building, etc.
183
184 --bpkg path
185 The package manager program to be used for build configuration
186 management.
187
188 --bpkg-option opt
189 Additional option to be passed to the package manager program.
190
191 --build path
192 The build program to be used to build packages.
193
194 --build-option opt
195 Additional option to be passed to the build program.
196
197 --curl path
198 The curl program to be used for network operations.
199
200 --curl-option opt
201 Additional option to be passed to the curl program.
202
203 --pager path
204 The pager program to be used to show long text.
205
206 --pager-option opt
207 Additional option to be passed to the pager program.
208
209 --options-file file
210 Read additional options from file.
211
212 --default-options dir
213 The directory to load additional default options files from.
214
215 --no-default-options
216 Don't load default options files.
217
219 See bdep-default-options-files(1) for an overview of the default
220 options files. For the init command the search start directory is the
221 project directory. The following options files are searched for in each
222 directory and, if found, loaded in the order listed:
223
224 bdep.options
225 bdep-{config config-add}.options # if --config-add|-A
226 bdep-{config config-add config-create}.options # if --config-create|-C
227 bdep-init.options
228
229 The following init command options cannot be specified in the default
230 options files:
231
232 --directory|-d
233 --config-add|-A
234 --config-create|-C
235 --wipe
236
238 Send bug reports to the users@build2.org mailing list.
239
241 Copyright (c) 2014-2019 Code Synthesis Ltd
242
243 Permission is granted to copy, distribute and/or modify this document
244 under the terms of the MIT License.
245
246
247
248bdep 0.12.0 November 2019 bdep-init(1)