Skip to content

Commit 097cbec

Browse files
authored
Merge pull request #2023 from uilianries/feature/skip-build-package
Add --build=!skip for install command
2 parents 8b428c7 + 268c75f commit 097cbec

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

mastering/policies.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ As previously demonstrated, we can use the :command:`--build` option to change t
1313
- :command:`--build cascade` will build from code all the nodes with some dependency being built (for any reason). Can be used together with any
1414
other build policy. Useful to make sure that any new change introduced in a dependency is incorporated by building again the package.
1515
- :command:`--build pattern*` will build only the packages with the reference starting with "pattern".
16+
- :command:`--build --build=!some_package` will build all requirements from sources, except for some_package.
1617

1718

1819
With the ``build_policy`` attribute in the `conanfile.py` the package creator can change the default Conan's build behavior. The allowed build_policy values are:

reference/commands/consumer/install.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ generators.
8181
built from source. --build=[pattern] Build packages
8282
from source whose package reference matches the
8383
pattern. The pattern uses 'fnmatch' style wildcards.
84-
Default behavior: If you omit the '--build' option,
85-
the 'build_policy' attribute in conanfile.py will be
86-
used if it exists, otherwise the behavior is like '--
87-
build=never'.
84+
--build=![pattern] Excluded packages, which will not
85+
be built from the source, whose package reference
86+
matches the pattern. The pattern uses 'fnmatch' style
87+
wildcards. Default behavior: If you omit the '--build'
88+
option, the 'build_policy' attribute in conanfile.py
89+
will be used if it exists, otherwise the behavior is
90+
like '--build=never'.
8891
-r REMOTE, --remote REMOTE
8992
Look in the specified remote server
9093
-u, --update Will check the remote and in case a newer version
@@ -244,6 +247,13 @@ Possible values are:
244247
- e.g., :command:`--build=zlib` will match any package named ``zlib`` (same as ``zlib/*``).
245248
- e.g., :command:`--build=z*@conan/stable` will match any package starting with ``z`` with ``conan/stable`` as user/channel.
246249
250+
* :command:`--build=![pattern]`: A fnmatch case-sensitive pattern of a package reference or only the package name.
251+
Conan will exclude the build of the packages whose reference matches the given
252+
**pattern**. Several patterns can be specified, chaining multiple options:
253+
254+
- e.g., :command:`--build=!zlib --build` Build all packages from source, except for zlib.
255+
- e.g., :command:`--build=!z* --build` Build all packages from source, except for those starting with ``z``
256+
247257
If you omit the :command:`--build` option, the ``build_policy`` attribute in `conanfile.py` will be
248258
looked up. If it is set to ``missing`` or ``always``, this build option will be used, otherwise the
249259
command will behave like :command:`--build=never` was set.

reference/commands/creator/create.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@ to know more about 'test_folder' project.
8787
built from source. --build=[pattern] Build packages
8888
from source whose package reference matches the
8989
pattern. The pattern uses 'fnmatch' style wildcards.
90-
Default behavior: If you omit the '--build' option,
91-
the 'build_policy' attribute in conanfile.py will be
92-
used if it exists, otherwise the behavior is like '--
93-
build=package name'.
90+
--build=![pattern] Excluded packages, which will not
91+
be built from the source, whose package reference
92+
matches the pattern. The pattern uses 'fnmatch' style
93+
wildcards. Default behavior: If you omit the '--build'
94+
option, the 'build_policy' attribute in conanfile.py
95+
will be used if it exists, otherwise the behavior is
96+
like '--build=package name'.
9497
-r REMOTE, --remote REMOTE
9598
Look in the specified remote server
9699
-u, --update Will check the remote and in case a newer version

reference/commands/creator/test.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ to be tested must exist in the local cache or any configured remote.
5454
built from source. --build=[pattern] Build packages
5555
from source whose package reference matches the
5656
pattern. The pattern uses 'fnmatch' style wildcards.
57-
Default behavior: If you omit the '--build' option,
58-
the 'build_policy' attribute in conanfile.py will be
59-
used if it exists, otherwise the behavior is like '--
60-
build=never'.
57+
--build=![pattern] Excluded packages, which will not
58+
be built from the source, whose package reference
59+
matches the pattern. The pattern uses 'fnmatch' style
60+
wildcards. Default behavior: If you omit the '--build'
61+
option, the 'build_policy' attribute in conanfile.py
62+
will be used if it exists, otherwise the behavior is
63+
like '--build=never'.
6164
-r REMOTE, --remote REMOTE
6265
Look in the specified remote server
6366
-u, --update Will check the remote and in case a newer version

0 commit comments

Comments
 (0)