aboutsummaryrefslogtreecommitdiffstats
path: root/doc/reference/items/language/product.qdoc
blob: 6a77e7909c871b951f62bef1d13b893d3a5e1043 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
/****************************************************************************
**
** Copyright (C) 2017 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 Probe
    \nextpage Profile
    \qmltype Product
    \inqmlmodule QbsLanguageItems
    \ingroup list-of-items
    \keyword QML.Product

    \brief Represents the result of a build process.

    A Product typically represents the result of a build process. It specifies a set of
    input and output files and a way to transform the former into the latter. For example, the
    following product sets up a very simple C++ application:
    \code
    Product {
        name: "helloworld"
        type: "application"
        files: "main.cpp"
        Depends { name: "cpp" }
    }
    \endcode
    The \l{type} property specifies what will be built (an executable). The
    \l{files} property specifies the input files (one C++ source file), and the
    \l{Depends} item pulls in the logic from the \c cpp module
    about how to do the necessary transformations.
    For some often-used types of products, \QBS pre-defines special derived items that save
    users some typing. These are:
    \list
        \li Application
        \li CppApplication
        \li DynamicLibrary
        \li StaticLibrary
    \endlist
    Therefore, the above example could also be written like this:
    \code
    CppApplication {
        name: "helloworld"
        files: "main.cpp"
    }
    \endcode
    Any property \c prop attached to this item is available in sub-items as \c product.prop, as
    well as in modules that are loaded from this product.

    \section1 Multiplexing Properties

    The following properties are relevant for product multiplexing only.
    Unless multiplexing is desired, they can be left at their default values:

    \list
        \li \l{aggregate}
        \li \l{multiplexedType}
        \li \l{multiplexByQbsProperties}
    \endlist

    \note We do not promise backwards compatibility for multiplexing properties
    as they are likely to change in future \QBS versions.

    \section1 Read-Only Properties

    The following properties are automatically set by \QBS and cannot be
    changed by the user:

    \list
        \li \l{buildDirectory}
        \li \l{sourceDirectory}
    \endlist
*/

/*!
    \qmlproperty bool Product::builtByDefault

    Determines whether the product will be built.

    If \c false, the product will only be built if this is explicitly requested,
    either by listing the product name as an argument to \c --products or by
    giving the \l{build} command the \c --all-products option.

    \defaultvalue \c true
*/

/*!
    \qmlproperty bool Product::condition

    Determines whether the product will be built.

    If \c false, the product will not be built.

    \defaultvalue \c true
*/

/*!
    \qmlproperty string Product::name

    The name of the product. Used to identify the product in a \l{Depends} item, for
    example. The value of this property must be a simple JavaScript expression that
    does not depend on module properties or values that are non-local to this product.

    \code
    CppApplication {
        name: "hello" + "world"
        // valid
    }
    CppApplication {
        name: "app_" + qbs.targetOS.join("_")
        // invalid
    }
    \endcode

    To change the name of your product's target artifact, modify \l{targetName}
    instead.

    \defaultvalue An empty string
*/

/*!
    \qmlproperty stringList Product::type

    The file tags matching the product's target artifacts.

    \defaultvalue An empty list
*/

/*!
    \qmlproperty string Product::targetName

    The base file name of the product's target artifacts.

    \defaultvalue The value of \l{name} with illegal file name characters
    replaced by underscores.
*/

/*!
    \qmlproperty string Product::destinationDirectory

    The directory where the target artifacts will be located. If a relative path
    is given, the base directory will be \l{Project::buildDirectory}
    {project.buildDirectory}.

    \defaultvalue \c{product.buildDirectory}
*/

/*!
    \qmlproperty stringList Product::files

    A list of source files. Syntactic sugar to save a \l{Group} item for simple
    products.

    Relative paths are resolved using the parent directory of the project file
    that sets the property.

    \defaultvalue An empty list
*/

/*!
    \qmlproperty stringList Product::excludeFiles

    A list of source files not to include. Useful with wildcards.
    For more information, see \l{Group}.

    \defaultvalue An empty list
*/

/*!
    \qmlproperty bool Product::consoleApplication

    On Windows, determines whether a console or GUI application is generated.

    If \c true, a console application is generated. If \c false, a GUI
    application is generated.

    On Apple platforms, influences the default application type.

    If \c true, a normal executable is generated.
    If \c false, an application bundle is generated.

    \defaultvalue Linker-dependent
*/

/*!
    \qmlproperty stringList Product::qbsSearchPaths

    The value set here will be merged with the value of
    \l{Project::qbsSearchPaths}{project.qbsSearchPaths}.

    \defaultvalue \l{Project::qbsSearchPaths}{project.qbsSearchPaths}
*/

/*!
    \qmlproperty string Product::version

    The version number of the product. Used in shared library filenames and generated
    Info.plist files in Apple application and framework bundles, for example.

    \nodefaultvalue
*/

/*!
    \qmlproperty bool Product::aggregate

    If \c{true}, an aggregate product will be created that has dependencies on all
    multiplex instances of this product.

    \note If you do not want to do multiplexing, you can use the default value
    \c{undefined}.
*/

/*!
    \qmlproperty stringList Product::multiplexedType

    Specifies the product type for the multiplexed product instances.

    \note If you do not want to do multiplexing, you can use the default value
    \c{undefined}.
*/

/*!
    \qmlproperty stringList Product::multiplexByQbsProperties

    Specifies which properties of the qbs module will be used for product multiplexing.
    Its value must be a subset of \c{["architectures", "buildVariants", "profiles"]}.

    \note If you do not want to do multiplexing, you can use the default value
    \c{["profiles"]}.
*/

/*!
    \qmlproperty path Product::buildDirectory
    \readonly

    The build directory for this product. This is the directory where generated
    files are placed.

    The value of this property is automatically set by \QBS and cannot be
    changed by the user.
*/

/*!
    \qmlproperty path Product::sourceDirectory
    \readonly

    The source directory for this product. This is the directory of the file
    where this product is defined.

    The value of this property is automatically set by \QBS and cannot be
    changed by the user.
*/