bdep-new(1)
bdep-new(1) π β create and initialize new project
π NAME π
bdep-new β create and initialize new project
β¨ SYNOPSIS β¨
bdep new [options] [--no-init] spec [name]
bdep new [options] --config-add|-A cfg-dir [@cfg-name] spec [name]
bdep new [options] --config-create|-C cfg-dir [@cfg-name] spec [name]
[cfg-args]
bdep new [options] --package [prj-spec] spec [name]
bdep new [options] --source [prj-spec] spec [name]
spec = [lang] [type] [vcs]
lang = --lang|-l (c|c++)[,lang-opt...]
type = --type|-t (exe|lib|bare|empty)[,type-opt...]
vcs = --vcs|-s (git|none)[,vcs-opt...]
prj-spec = --directory|-d prj-dir
cfg-args = [-- [bpkg-options]] [--existing|-e | (module | cfg-var)...]
πΈ DESCRIPTION πΈ
okay so bdep new is your little project-birthday-party planner. It can create and initialize a brand-new project (the first three forms), add a new package inside an already existing project (the --package form), or drop a new source subdirectory into an already existing project/package (the --source form). Every form except --source first makes a new build2 project/package called name according to spec, and it puts it in the name subdirectory of your current working directory β unless you override that with --output-dir|-o, or, for --package, with --directory|-d. And if name has a directory component in it, then the project/package gets created inside that directory, just like you'd passed it with --output-dir|-o.
The first form then β unless you say --no-init β initializes an empty project database, like running the bdep-init(1) command with --empty. For example:
$ bdep new -l c++ -t exe hello
$ tree hello/
hello/
|-- hello/
| |-- hello.cxx
| `-- buildfile
|-- buildfile
`-- manifest
Same vibe for the second and third forms: they either add an existing build configuration or create a new one, then initialize the project in that configuration, exactly like running bdep-init(1) with --config-add or --config-create, respectively. For example:
$ bdep new -l c++ -t exe -C @gcc hello cc config.cxx=g++
The --package form adds the new package to the packages.manifest file, and it creates that file if it's not there yet. If you don't explicitly pass a project directory with --directory|-d, it gets deduced from your current working directory (peep bdep-projects-configs(1) for the deets on specifying projects). Heads up: nested packages are not allowed. For example:
$ bdep new -t empty hello
$ cd hello
$ bdep new --package -l c++ -t lib libhello
$ bdep new --package -l c++ -t exe hello
$ bdep init -C @gcc cc config.cxx=g++
$ cd ..
$ tree hello/
hello/
|-- hello/
| |-- hello/
| | |-- hello.cxx
| | `-- buildfile
| |-- buildfile
| `-- manifest
|-- libhello/
| |-- libhello/
| | |-- hello.hxx
| | |-- hello.cxx
| | `-- buildfile
| |-- buildfile
| `-- manifest
`-- packages.manifest
The --source form acts like it first creates a temporary project called name according to spec, then copies its source subdirectory (name/name/ by default) over to your current working directory (unless you override with --output-dir|-o). If no project/package directory is explicitly given with --directory|-d, it assumes the current working directory. For example:
$ bdep new -l c++ -t bare hello
$ cd hello
$ bdep new --source -l c++ -t lib libhello
$ bdep new --source -l c++ -t exe hello
$ bdep init -C @gcc cc config.cxx=g++
$ cd ..
$ tree hello/
hello/
|-- hello/
| |-- hello.cxx
| `-- buildfile
|-- libhello/
| |-- hello.hxx
| |-- hello.cxx
| `-- buildfile
|-- buildfile
`-- manifest
In every form, if name is omitted, then the current working directory's name (unless overridden with --output-dir|-o) becomes the project/package/source subdirectory name. For the full tea on project/package names, see Package Name (#package-name).
The source subdirectory can be customized with the subdir project type sub-option (more on that below). For example:
$ bdep new -l c++ -t lib,subdir=libhello/io libhello-io
$ tree libhello-io/
libhello-io/
`-- libhello/
`-- io/
|-- hello-io.hxx
`-- hello-io.cxx
By default, the source subdirectory lives right in the project/package root directory and holds both headers (including public headers for libraries) and sources. You can switch that up in a bunch of ways with the prefix* and split project type sub-options (details below). For example, to move the source subdirectory inside src/:
$ bdep new -l c++ -t exe,prefix=src hello
$ tree hello/
hello/
`-- src/
`-- hello/
`-- hello.cxx
And to split the library source subdirectory into public headers and other source files:
$ bdep new -l c++ -t lib,split libhello
$ tree libhello/
libhello/
|-- include/
| `-- libhello/
| `-- hello.hxx
`-- src/
`-- libhello/
`-- hello.cxx
See the SOURCE LAYOUT section below for details and more examples.
The output directory may already contain existing files provided they don't clash with the files to be created. The new command also recognizes certain well-known files and tries to use the extracted information in the package manifest file. Specifically, it tries to guess the license from the LICENSE file as well as extract the summary from README.md. This allows for the following workflow:
# Create a project with LICENSE and README.md on one of the Git
# hosting services (GitHub, GitLab, etc).
$ git clone .../libhello.git
$ cd libhello
$ bdep new -l c++ -t lib
The project parameters such as language, type (executable, library, etc), and version control system can be customized as described next. Some of these parameters also support parameter-specific sub-options (such as the file extensions to use in a C++ project) that can be specified with a comma after the parameter value.
The project language can be specified with the --lang|-l option. Valid values for this option and their semantics are described next. If unspecified, a C++ project is created by default.
cβ A C project. Recognized language sub-options:c++β A C project that can also use C++. If specified, then thehxx,cxx,ixx,txx, andmxxc++ language sub-options can also be specified.
c++β A C++ project. Recognized language sub-options:cppβ Use the.cpp,.hpp,.ipp,.tpp, and.mppsource file extensions (alias forextension=?pp).extension=patternβ Derive source file extensions frompatternby replacing every?with one of thec(source),h(header),i(inline),t(template), orm(module interface) letters. If unspecified and no individual extensions are specified with the below options, then?xxis used by default.hxx=extensionβ Use the specified extension for header files instead of the default.hxx.cxx=extensionβ Use the specified extension for source files instead of the default.cxx.ixx=extensionβ Use the specified extension for inline files. If unspecified, then assume no inline files are used by the project.txx=extensionβ Use the specified extension for template files. If unspecified, then assume no template files are used by the project.mxx=extensionβ Use the specified extension for module interface files. If unspecified, then assume no modules are used by the project.cβ A C++ project that can also use C.
As an example, the following command creates a header-only C++ library that uses the .h extension for header files and .cpp β for source files:
$ bdep new -l c++,hxx=h,cxx=cpp -t lib,binless libhello
The project type can be specified with the --type|-t option. The empty project type is language-agnostic with the semantics and valid sub-options for the rest being language-dependent, as described next. If unspecified, an executable project is created by default.
exeβ A project that builds a sample C or C++ executable. Recognized executable project sub-options:no-testsβ Don't add support for functional/integration testing.unit-testsβ Add support for unit testing.no-installβ Don't add support for installing.export-stubβ Add support for importing this project's targets from other projects.prefix=dirβ Optional source prefix relative to project/package root.subdir=dirβ Alternative source subdirectory relative to source prefix.no-subdirβ Omit the source subdirectory.buildfile-in-prefixβ Create the buildfile in the source prefix directory rather than in its source subdirectory.third-partyβ Create a package for converting an existing third-party executable to build2. This sub-option automatically enables theno-readmesub-option. It also adds a number of values to manifest that makes sense to specify in a package of a third-party project and, unlessno-package-readmeis specified, generates thePACKAGE-README.mdtemplate (seepackage-description (#manifest-package-description)package manifest value for background).license=nameno-readmeno-package-readmealt-namingβ See common sub-options below.
libβ A project that builds a sample C or C++ library. Recognized library project sub-options:binlessβ Create a header-only library.no-testsβ Don't add support for functional/integration testing.unit-testsβ Add support for unit testing.no-installβ Don't add support for installing.no-versionβ Don't add support for generating the version header.no-symexportβ Don't add support for DLL symbol exporting.auto-symexportβ Add support for automatic DLL symbol exporting.prefix-include=dirβ Optional public header prefix relative to project/package root.prefix-source=dirβ Optional source prefix relative to project/package root.prefix=dirβ Shortcut forprefix-include=dir,prefix-source=dir.splitβ Shortcut forprefix-include=include,prefix-source=src.subdir=dirβ Alternative source subdirectory relative to header/source prefix.no-subdir-includeβ Omit the source subdirectory relative to the header prefix.
okay so the sub-options just keep coming, bestie, and they all get comma-glued onto your type:
no-subdir-sourceβ skip the source subdirectory relative to the source prefix. poof, gone π¨no-subdirβ shortcut forno-subdir-include,no-subdir-source. two-for-one deal πbuildfile-in-prefixβ buildfiles live in the header/source prefix directories instead of inside their source subdirectories.third-partyβ makes a package for converting an existing third-party library to build2. This one is β¨opinionatedβ¨: it automatically turns on theno-versionandno-readmesub-options, plusno-symexportunlessauto-symexportis specified. It also adds a bunch of values tomanifestthat make sense to specify in a package of a third-party project and, unlessno-package-readmeis specified, it generates thePACKAGE-README.mdtemplate (peep thepackage-descriptionpackage manifest value for the background tea β).license=nameno-readmeno-package-readmealt-namingβ see common sub-options below, bestie, it's down there π
bare π«₯
A project without any source code that can be filled later (see --source). The recognized bare project sub-options are:
no-testsβ don't add support for testing.no-installβ don't add support for installing.license=nameno-readmealt-namingβ see common sub-options below.
empty πͺΉ
An empty project that can be filled with packages (see --package). The recognized empty project sub-options are:
third-partyβ create a project for converting an existing third-party project to build2. This sub-option adjusts the wording of the generatedREADME.mdtemplate to reflect such a conversion.no-readmeβ see common sub-options below.
common π«
Common project type sub-options, the ones everybody shares:
license=nameβ specify the project's license. The license name can be an SPDX License Expression (https://spdx.org/licenses/), which, in its simplest form, is just the license ID. Or it can be a free form name in theother: license namescheme. If unspecified, thenother: proprietaryis assumed. The following list has the most commonly used free/open source software license IDs plus a bunch of pre-definedother:names. See thelicensepackage manifest value for more info.MITβ MIT License.BSD-2-Clauseβ BSD 2-Clause "Simplified" LicenseBSD-3-Clauseβ BSD 3-Clause "New" or "Revised" LicenseGPL-3.0-onlyβ GNU General Public License v3.0 onlyGPL-3.0-or-laterβ GNU General Public License v3.0 or laterLGPL-3.0-onlyβ GNU Lesser General Public License v3.0 onlyLGPL-3.0-or-laterβ GNU Lesser General Public License v3.0 or laterAGPL-3.0-onlyβ GNU Affero General Public License v3.0 onlyAGPL-3.0-or-laterβ GNU Affero General Public License v3.0 or laterApache-2.0β Apache License 2.0MPL-2.0β Mozilla Public License 2.0BSL-1.0β Boost Software License 1.0Unlicenseβ The Unlicense (public domain)other: public domainβ Released into the public domainother: available sourceβ Not free/open source with public source codeother: proprietaryβ Not free/open sourceother: TODOβ License is not yet decided
no-readmeβ don't add a newREADME.md(but still check for the existing one π).no-package-readmeβ don't add a newPACKAGE-README.md(but still check for the existing one π).alt-namingβ use the alternative build file/directory naming scheme.
The project version control system can be specified with the --vcs|-s option. Valid values for this option and their semantics are described next. If unspecified, git is assumed by default.
git π³
Initialize a git(1) repository inside the project and generate .gitignore files. Recognized version control system sub-options:
branch=nameβ use the specified name for the initial branch in the newly created repository.
none π
Don't initialize a version control system inside the project.
The created project, package, or source subdirectory can be further customized using the pre and post-creation hooks specified with the --pre-hook and --post-hook options, respectively. The pre hooks run before any new files are created and the post hook runs after all the files have been created. The hook commands are executed in the project, package, or source directory as their current working directory. For example:
$ bdep new --post-hook "echo .idea/ >>.gitignore" hello
The pre hooks are primarily useful for moving/renaming existing files that would otherwise clash with files created by the new command. For example:
$ bdep new --pre-hook "mv .gitignore .gitignore.bak" \
--post-hook "cat .gitignore.bak >>.gitignore" \
--post-hook "rm .gitignore.bak" ...
See the --pre-hook and --post-hook options documentation below for details.
β¨ NEW OPTIONS β¨
--no-initβ don't initialize an empty build configuration set.--packageβ create a new package inside an already existing project rather than a new project.--sourceβ create a new source subdirectory inside an already existing project or package rather than a new project.--output-dir|-odir β create the project, package, or source subdirectory in the specified directory.--directory|-ddir β assume the project/package is in the specified directory rather than in the current working directory. Only used with--packageor--source.--type|-ttype[,opt...]β specify project type and options. Valid values for type areexe(executable project, default),lib(library project),bare(bare project without any source code), andempty(empty project ready to be filled with packages). Valid values for opt are type-specific.--lang|-llang[,opt...]β specify project language and options. Valid values for lang arecandc++(default). Valid values for opt are language-specific.--vcs|-svcs[,opt...]β specify project version control system and options. Valid values for vcs aregit(default) andnone. Valid values for opt are system-specific.--pre-hookcommand--post-hookcommand β run the specified command before/after creating the project, package, or source directory.
The command value is interpreted as a whitespace-separated, potentially quoted command line consisting of a program or a portable builtin (testscript#builtins) optionally followed by arguments and redirects. Specifically, a single level of quotes (either single or double) is removed and whitespaces are not treated as separators inside such quoted fragments. Currently only the stdout redirect to a file is supported. For example:
$ bdep new --post-hook "echo '.idea/ # IDE' >>.gitignore" hello
The command line elements (program, arguments, etc) may optionally contain substitutions β variable names enclosed with the @ substitution symbol β which are replaced with the corresponding variable values to produce the actual command. The following variable names are recognized, with the double substitution symbol (@@) serving as an escape sequence.
@mode@ - one of 'project', 'package', or 'source'
@name@ - project, package, or source subdirectory name
@base@ - name base (name without extension)
@stem@ - name stem (name base without 'lib' prefix)
@root@ - project/package root directory
@pfx@ - combined prefix relative to project/package root
@inc@ - split header prefix relative to project/package root
@src@ - split source prefix relative to project/package root
@sub@ - source subdirectory relative to header/source prefix
@type@ - type (--type|-t value: 'exe', 'lib', etc)
@lang@ - language (--lang|-l value: 'c', 'c++', etc)
@vcs@ - version control system (--vcs|-s value: 'git', etc)
Note that the @inc@ and @src@ variables are only set if the header/source prefix is split, with the combined @pfx@ variable set otherwise.
For example:
$ bdep new --post-hook "echo bin/ >>@name@/.gitignore" hello
These substitution variables are also made available to the hook program as the BDEP_NEW_* environment variables (BDEP_NEW_MODE, BDEP_NEW_NAME, etc).
--no-amalgamationβ create a project with disabled amalgamation support. This option is normally only used for testing.--no-checksβ suppress nested project/package checks. This option is normally only used for testing.--config-add|-Adir β add an existing build configuration dir.--config-create|-Cdir β create a new build configuration in dir.--type|--config-typetyp β the type of the configuration being created. By default, configuration of typetargetis created. Seebpkg-cfg-create(1)for background on configuration types.--defaultβ make the added or created configuration the default.--no-defaultβ don't make the first added or created configuration the default.--forwardβ make the added or created configuration forwarded.--no-forwardβ don't make the added or created configuration forwarded.--auto-syncβ make the added or created configuration automatically synchronized.--no-auto-syncβ don't make the added or created configuration automatically synchronized.--existing|-eβ initialize abpkgconfiguration based on an existing build system configuration.--wipeβ wipe the configuration directory clean before creating the new configuration.--config-name|-nname β specify the build configuration as a name.--config-idnum β specify the build configuration as an id.
β¨ COMMON OPTIONS β¨
okay bestie, these are the options that basically every bdep command shares, so once you learn them here you're set for life π
they're listed below in their quick-and-dirty form, and if you want the full β¨deluxeβ¨ treatment you go read bdep-common-options(1), iykyk.
-vβ prints the essential underlying commands as they get executed, so you can peek at what's actually happening under the hood π-Vβ same vibe but turned ALL the way up: prints all the underlying commands being executed π₯--quiet,-qβ run quietly bestie π€« only error messages get to speak, everything else stays silent--verboselevel β sets how chatty the diagnostics get, with level being a number between 0 and 6 ποΈ--stdout-formatformat β the representation format used when printing to stdout π¨οΈ--jobs,-jnum β how many jobs run in parallel, because multitasking is main character energy π--progressβ shows progress indicators for long-lasting operations like network transfers, building, etc. π--no-progressβ suppresses those progress indicators for long-lasting operations such as network transfers, building, etc. π--diag-colorβ use color in diagnostics, because plain text is giving beige π--no-diag-colorβ don't use color in diagnostics, monochrome mode activated π--bpkgpath β the package manager program that gets used for build configuration management π¦--bpkg-optionopt β an extra option to pass along to the package manager program β¨--buildpath β the build program used to build packages π οΈ--build-optionopt β an extra option to pass along to the build program π«--curlpath β thecurlprogram used for network operations π--curl-optionopt β an extra option to pass along to thecurlprogram π«Ά--pagerpath β the pager program used to show long text π--pager-optionopt β an extra option to pass along to the pager program π--options-filefile β read additional options from file ποΈ--default-optionsdir β the directory to load additional default options files from π--no-default-optionsβ don't load default options files at all, we're going rogue π€
lowkey the pro move: these live in their own page too, so when you forget one (you will, no shade) just run man bdep-common-options and it's all there for you π
πΈ SOURCE LAYOUT πΈ
okay bestie, sit down, grab a boba, because this is where it gets juicy. C and C++ projects are out here living their own lives with a whole chaotic spectrum of source code layouts π β and honestly? most of them fall into two big buckets:
- combined β all the source code for a single executable or library chills in the same directory. one room, everyone together.
- split β headers (usually the public headers of a library) and the other source files live in separate directories. most commonly named
include/andsrc/. separate rooms, very demure, very mindful.
To support all these varying layouts, the new command splits the paths leading to source code inside a package/project into a bunch of customizable components π:
libhello/{include,src}/hello/
^ ^ ^
| | |
project/ source source
package prefix subdirectory
root
ngl, heads up: the same physical layout can be achieved with various combos of source prefix and subdirectory, but the semantics will differ β because headers in the project get included with the source subdirectory (if any) as a prefix. see Canonical Project Structure (intro#proj-struct) for the rationale and the details, iykyk π
As we already saw, the source subdirectory is customizable with the subdir project type sub-option. like, for example:
# libhello/hello/
$ bdep new -l c++ -t lib,subdir=hello libhello
$ tree libhello/
libhello/
`-- hello/
|-- hello.hxx
`-- hello.cxx
Note: pass -l c++,cpp if you prefer the .hpp/.cpp source file naming scheme β¨
The source prefix can be combined, and in that case you customize it with the single prefix project type sub-option. for example:
# hello/src/hello/
$ bdep new -l c++ -t exe,prefix=src hello
$ tree hello/
hello/
`-- src/
`-- hello/
`-- hello.cxx
The prefix can also be split, and then you get prefix-include and prefix-source sub-options to customize each directory independently π
if either one is omitted, the corresponding prefix is just left empty. for example:
# libhello/{include,.}/libhello/
$ bdep new -l c++ -t lib,prefix-include=include libhello
$ tree libhello/
libhello/
|-- include/
| `-- libhello/
| `-- hello.hxx
`-- libhello/
`-- hello.cxx
The split sub-option is the convenient little shortcut for the most common case, where the header prefix is include/ and the source prefix is src/ π«Ά for example:
# libhello/{include,src}/libhello/
$ bdep new -l c++ -t lib,split libhello
$ tree libhello/
libhello/
|-- include/
| `-- libhello/
| `-- hello.hxx
`-- src/
`-- libhello/
`-- hello.cxx
You can omit the source subdirectory entirely by specifying the no-subdir project type sub-option. for example:
# hello/src/
$ bdep new -l c++ -t exe,prefix=src,no-subdir hello
$ tree hello/
hello/
`-- src/
`-- hello.cxx
Same energy but for the split layout (and we also have to disable the generated version header, which is not supported in this layout π«):
# libhello/{include,src}/
$ bdep new -l c++ -t lib,split,no-subdir,no-version libhello
$ tree libhello/
libhello/
|-- include/
| `-- hello.hxx
`-- src/
`-- hello.cxx
To get the layout where all the source code lives in the project root, we omit both the source prefix and the subdirectory (and yep, we also have to disable a couple of other features that are not supported in this layout π):
# hello/
$ bdep new -l c++ -t lib,no-subdir,no-version,no-tests libhello
$ tree libhello/
libhello/
|-- hello.cxx
`-- hello.hxx
We can also omit the source subdirectory but only in the source prefix of the split layout, by specifying the no-subdir-source sub-option. for example:
# libhello/{include/hello,src}/
$ bdep new -l c++ -t lib,split,subdir=hello,no-subdir-source libhello
$ tree libhello/
libhello/
|-- include/
| `-- hello/
| `-- hello.hxx
`-- src/
`-- hello.cxx
Similarly, we can omit the source subdirectory but only in the header prefix of the split layout, by specifying the no-subdir-include sub-option (and again we have to disable the generated version header, which is not supported here π):
# libhello/{include,src/hello}/
$ bdep new \
-l c++ \
-t lib,split,subdir=hello,no-subdir-include,no-version \
libhello
$ tree libhello/
libhello/
|-- include/
| `-- hello.hxx
`-- src/
`-- hello/
`-- hello.cxx
To achieve the split layout where the include/ directory is inside src/:
# libhello/src/{include,.}/hello/
$ bdep new \
-l c++ \
-t lib,prefix-include=src/include,prefix-source=src,subdir=hello \
libhello
$ tree libhello/
libhello/
`-- src/
|-- include/
| `-- hello/
| `-- hello.hxx
`-- hello/
`-- hello.cxx
A similar layout but without the source subdirectory in src/:
# libhello/src/{include/hello,.}/
$ bdep new \
-l c++ \
-t lib,prefix-include=src/include,prefix-source=src,\
subdir=hello,no-subdir-source \
libhello
$ tree libhello/
libhello/
`-- src/
|-- include/
| `-- hello/
| `-- hello.hxx
`-- hello.cxx
The layout used by the Boost libraries π:
# libhello/{include/hello,libs/hello/src}/
$ bdep new \
-l c++ \
-t lib,prefix-include=include,prefix-source=libs/hello/src,\
subdir=hello,no-subdir-source \
libhello
$ tree libhello/
libhello/
|-- include/
| `-- hello/
| `-- hello.hxx
`-- libs/
`-- hello/
`-- src/
`-- hello.cxx
A layout where multiple components each have their own include/src split π₯:
# hello/libhello1/{include/hello1,src}/
# hello/libhello2/{include/hello2,src}/
$ bdep new -l c++ -t bare hello
$ bdep new -d hello --source \
-l c++ \
-t lib,\
prefix-include=libhello1/include,prefix-source=libhello1/src,\
subdir=hello1,no-subdir-source \
libhello1
$ bdep new -d hello --source \
-l c++ \
-t lib,\
prefix-include=libhello2/include,prefix-source=libhello2/src,\
subdir=hello2,no-subdir-source \
libhello2
$ tree hello/
hello/
|-- libhello1/
| |-- include/
| | `-- hello1/
| | `-- hello1.hxx
| `-- src/
| `-- hello1.cxx
`-- libhello2/
|-- include/
| `-- hello2/
| `-- hello2.hxx
`-- src/
`-- hello2.cxx
A layout where libraries and executables have different prefixes π :
# hello/libs/libhello/{include/hello,src}/
# hello/src/hello/
$ bdep new -l c++ -t bare hello
$ bdep new -d hello --source \
-l c++ \
-t lib,\
prefix-include=libs/libhello/include,prefix-source=libs/libhello/src,\
subdir=hello,no-subdir-source \
libhello
$ bdep new -d hello --source -l c++ -t exe,prefix=src hello
$ tree hello/
hello/
|-- libs/
| `-- libhello/
| |-- include/
| | `-- hello/
| | `-- hello.hxx
| `-- src/
| `-- hello.cxx
`-- src/
`-- hello/
`-- hello.cxx
When packaging a third-party project for build2, one of the common approaches is to create a project with the split layout and the buildfiles in the source prefix directories rather than in the source subdirectories π:
# hello/libhello/{include,src}/hello/
# hello/libhello/{include,src}/buildfile
$ bdep new -l c -t empty hello
$ bdep new -d hello --package \
-l c \
-t lib, \
split,subdir=hello,no-version,no-symexport,buildfile-in-prefix \
libhello
$ tree hello/
hello/
`-- libhello/
|-- include/
| |-- buildfile
| `-- hello/
| `-- hello.h
`-- src/
|-- buildfile
`-- hello/
`-- hello.c
After that, the upstream project is added as a git submodule to the project root directory, and the source subdirectories are replaced with symbolic links to the directories inside the upstream project directory π¦:
$ tree hello/
hello/
|-- libhello/
| |-- include/
| | |-- buildfile
| | `-- hello/ -> ../../upstream/include/hello/
| `-- src/
| |-- buildfile
| `-- hello/ -> ../../upstream/src/
`-- upstream/
|-- include/
| `-- hello/
| `-- hello.h
`-- src/
`-- hello.c
π DEFAULT OPTIONS FILES π
See bdep-default-options-files(1) for the whole overview of the default options files π
For the new command, the search start directory is:
- the project directory in the
packageandsourcemodes, and - the parent directory of the new project in all other modes β¨
The following options files are searched for in each directory and, if found, loaded in the order listed π:
bdep.options
bdep-{config config-add}.options # if --config-add|-A
bdep-{config config-add config-create}.options # if --config-create|-C
bdep-new.options
bdep-new-{project|package|source}.options # (mode-dependent)
The following new command options cannot be specified in the default options files π«:
--output-dir|-o
--directory|-d
--package
--source
--no-checks
--config-add|-A
--config-create|-C
--wipe
and while we're here β if the--pre-hookor--post-hookoptions show up in remote default options files, that will trigger a prompt π³ so, like, be aware.
πΈ ENVIRONMENT πΈ
Okay bestie, this is where you can whisper secrets to bdep new through the environment, and there's literally one (1) variable doing the heavy lifting:
BDEP_AUTHOR_EMAILβ this is how you tellbdep newwhat email address to slap on the package. π
And here's the little chain of command it follows if you don't set it, because of course there's a whole fallback saga:
- If
BDEP_AUTHOR_EMAILisn't set,newfirst tries to snag the email from the version control system (but only if you're actually using one, iykyk). - If that doesn't pan out either, it goes for the
EMAILenvironment variable. π - And if every single one of those fails? It just shrugs and uses a dummy
you@example.orgemail. Not iconic, but it works. π«Ά
π BUGS π
Found something cursed? Don't suffer in silence, bestie. Send those bug reports to the users@build2.org mailing list and let the build2 girlies handle it. π
π COPYRIGHT π
Copyright (c) 2014-2024 the build2 authors.
Permission is granted to copy, distribute and/or modify this document under the terms of the MIT License. Slay, honestly β free to share, free to remix, just keep the receipts. β¨
And that's a wrap on bdep-new(1), fr fr! π This whole thing is from bdep 0.17.0, dated June 2024 β so if you're reading this from the future, hey, hope the vibes are still immaculate. π Go forth and scaffold some truly stunning packages, bestie. Periodt. π¦
π¦ where this page comes from
- fedora 43: bdep 0.17.0-5.fc43 Β· MIT
- fedora 44: bdep 0.17.0-7.fc44 Β· MIT
- nixos 26.05: bdep 0.17.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms