summaryrefslogtreecommitdiffstats
path: root/examples/doc/dependencies.qdoc
blob: 96be950c284a53ce5791c8a3a77d3ba299af251f (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
/****************************************************************************
**
** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Installer Framework.
**
** $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 Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example dependecies
    \ingroup qtifwexamples
    \title Dependency Solving Example

    \brief Using components' package.xml files to define dependencies and
    automatic dependencies between components.

    \image qtifw-examples-dependencies.png

    \e{Dependency Solving} illustrates how to specify dependencies and automatic
    dependencies between components in the package information files and how
    that influences the installation and maintenance processes.

    \include installerfw-examples-configuring.qdocinc

    \list
        \li The \c <CreateLocalRepository> element is set to \c true to create
            a local repository. This enables end users to run the maintenance
            tool after the initial installation to install additional components
            or to uninstall components. The changes in the installation will
            respect the dependencies defined in the example.
    \endlist

    \quotefile dependencies/config/config.xml

    \include installerfw-examples-packaging.qdocinc

    \list
        \li The \c <SortingPriority> element specifies the location of the
            component in the component tree. The tree is sorted from highest to
            lowest priority, with the highest priority on the top.
    \endlist

    In this example, the package.xml files for the components contain additional
    elements that specify the dependencies. The following sections illustrate
    how the elements are used.

    \section1 Specifying Dependencies on Other Components

    We define a dependency for \e{Component C} on \e{Component A} and
    \e{Component B}. Thus, if we select Component C for installation, both
    Component A and Component B are installed as well. We define the
    dependencies in the \c <Dependencies> element in Component C's package.xml
    file as a comma-separated list of the identifiers of the components that
    this component depends on:

    \quotefile dependencies/packages/componentC/meta/package.xml

    \section1 Specifying Automatic Dependencies on Other Components

    We define an automatic dependency for \e{Component D} on Component A and
    Component B. Thus, if Component A and Component B are both marked for
    installation, Component D is automatically installed as well.
    We define the automatic dependency in the \c <AutoDependOn> element in
    Component D's package.xml file:

    \quotefile dependencies/packages/componentD/meta/package.xml

    \section1 Forcing the Installation of a Component

    We define that \e{Component E} is always automatically installed and the end
    user cannot deselect it. To define this, we set the \c <ForcedInstallation>
    element to \c true in Component E's package.xml file:

    \quotefile dependencies/packages/componentE/meta/package.xml

    \section1 Installing Components by Default

    We define a dependency for \e{Component G} on Component A, and we mark G as
    a default component. Thus, Component G is marked for installation by
    default, and so is Component A, because it is required by G. To define this,
    we set the value of the \c <Default> element to \c true in Component G's
    package.xml file:

    \quotefile dependencies/packages/componentG/meta/package.xml

    \section1 Solving the Dependencies

    Selecting component C for installation also selects the following
    components:

    \list
        \li Component A and Component B, because Component C requires them.
        \li Component D, because both Component A and Component B are marked for
            installation and thus the conditions for installing Component D are
            met.
    \endlist

    \include installerfw-examples-generating.qdocinc
*/