1 /****************************************************************************
2 **
3 ** Copyright (C) 2019 Denis Shienkov <denis.shienkov@gmail.com>
4 ** Contact: http://www.qt.io/licensing
5 **
6 ** This file is part of Qbs.
7 **
8 ** Commercial License Usage
9 ** Licensees holding valid commercial Qt licenses may use this file in
10 ** accordance with the commercial license agreement provided with the
11 ** Software or, alternatively, in accordance with the terms contained in
12 ** a written agreement between you and The Qt Company. For licensing terms and
13 ** conditions see http://www.qt.io/terms-conditions. For further information
14 ** use the contact form at http://www.qt.io/contact-us.
15 **
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 or version 3 as published by the Free
19 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
20 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
21 ** following information to ensure the GNU Lesser General Public License
22 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
23 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, The Qt Company gives you certain additional
26 ** rights. These rights are described in The Qt Company LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ****************************************************************************/
30
31 #include "iarewsourcefilepropertygroup.h"
32 #include "iarewutils.h"
33
34 #include <generators/generatordata.h>
35
36 #include <tools/stringconstants.h>
37
38 namespace qbs {
39
IarewSourceFilePropertyGroup(const GeneratableProject & genProject,const ArtifactData & sourceArtifact)40 IarewSourceFilePropertyGroup::IarewSourceFilePropertyGroup(
41 const GeneratableProject &genProject,
42 const ArtifactData &sourceArtifact)
43 : gen::xml::PropertyGroup(QByteArrayLiteral("file"))
44 {
45 // Create file path property item.
46 const QString fullFilePath = sourceArtifact.filePath();
47 const QString relativeFilePath = IarewUtils::projectRelativeFilePath(
48 genProject.baseBuildDirectory().absolutePath(),
49 fullFilePath);
50 appendChild<gen::xml::Property>(QByteArrayLiteral("name"),
51 relativeFilePath);
52 }
53
54 } // namespace qbs
55