aboutsummaryrefslogtreecommitdiffstats
path: root/doc/reference/items/language/joblimit.qdoc
blob: cd68bae317720eb31b68c977e960b4443dd310a1 (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
105
106
107
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
    \contentspage list-of-language-items.html
    \previouspage Group
    \nextpage Module
    \qmltype JobLimit
    \inqmlmodule QbsLanguageItems
    \ingroup list-of-items
    \keyword QML.JobLimit

    \brief Restricts concurrent execution of jobs in a given pool.

    In addition to the global limit on concurrently running commands, a project might
    want to restrict concurrent execution of certain types of commands even further,
    for instance because they are not well-suited to share certain types of resources.

    In the following example, we define a rule that runs a tool of which at most one
    instance can be running for the same project at any given time:
    \code
    Rule {
        // ...
        prepare: {
            var cmd = new Command("my-exclusive-tool", [project.buildDirectory]);
            cmd.description = "running the exclusive tool";
            cmd.jobPool = "exclusive_tool";
            return cmd;
        }
    }
    JobLimit {
        jobPool: "exclusive_tool"
        jobCount: 1
    }
    \endcode

    \c JobLimit items can appear inside \l Product, \l Project and \l Module items.
    In the case of collisions, that is, items matching the same job pool but setting
    different values, the ones defined inside products have the highest precedence,
    and the ones inside modules have the lowest. Items defined in sub-projects have
    higher precedence than those defined in parent projects. For items with the same
    precedence level, the most restrictive one is chosen, that is, the one with the
    lowest job number greater than zero.

    \see {How do I limit the number of concurrent jobs for the linker only?}
*/

/*!
    \qmlproperty bool JobLimit::condition

    Determines whether the job limit is active.

    If this property is set to \c false, the job limit is ignored.

    \defaultvalue \c true
*/

/*!
    \qmlproperty int JobLimit::jobCount

    The maximum number of commands in the given \l{jobPool}{job pool} that can run
    concurrently.

    A value of zero means "unlimited", negative values are not allowed.

    \note The global job limit always applies: For instance, if you set this
          property to 100 for some job pool, and "-j 8" was given on the
          command line, then no more than eight instances of commands from
          the respective job pool will run at any time.

    This property must always be set.

    \nodefaultvalue
*/

/*!
    \qmlproperty string JobLimit::jobPool

    The job pool to which apply the limit.

    This property must always be set to a non-empty value.

    \nodefaultvalue
*/