aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/generator/iarew/iarewworkspace.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-07-23 15:45:29 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-07-31 13:12:01 +0000
commit86747ff36bb162764fd8c2f741a1674d16b0b3cd (patch)
treeebc9323f57c601ae49af9cff9fe0674fd71bb6ca /src/plugins/generator/iarew/iarewworkspace.cpp
parent2363f13f8fbd001a3544acb2a600010893e4cf80 (diff)
baremetal: Share common generators code
Common code which are used for the 'iarew' and 'keiluv' generators was moved to the corelib/generators library. Besides, this code also can be used in future for the XML-based generators. Change-Id: I79a21e3e078d563600d7f365785731fe9e847045 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/generator/iarew/iarewworkspace.cpp')
-rw-r--r--src/plugins/generator/iarew/iarewworkspace.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/plugins/generator/iarew/iarewworkspace.cpp b/src/plugins/generator/iarew/iarewworkspace.cpp
index 19542ebae..bfe22aea7 100644
--- a/src/plugins/generator/iarew/iarewworkspace.cpp
+++ b/src/plugins/generator/iarew/iarewworkspace.cpp
@@ -37,38 +37,27 @@
**
****************************************************************************/
-#include "iarewproperty.h"
-#include "iarewpropertygroup.h"
#include "iarewworkspace.h"
-#include "iiarewnodevisitor.h"
+
+#include <generators/xmlpropertygroup.h>
namespace qbs {
IarewWorkspace::IarewWorkspace(const QString &workspacePath)
+ : gen::xml::Workspace(workspacePath)
{
- m_baseDirectory = QFileInfo(workspacePath).absoluteDir();
-
- appendChild<IarewPropertyGroup>(QByteArrayLiteral("batchBuild"));
+ appendChild<gen::xml::PropertyGroup>(
+ QByteArrayLiteral("batchBuild"));
}
-void IarewWorkspace::addProjectPath(const QString &projectFilePath)
+void IarewWorkspace::addProject(const QString &projectFilePath)
{
const QString relativeProjectPath = QLatin1String("$WS_DIR$/")
+ m_baseDirectory.relativeFilePath(projectFilePath);
- const auto projectGroup = appendChild<IarewPropertyGroup>(
+ const auto projectGroup = appendChild<gen::xml::PropertyGroup>(
QByteArrayLiteral("project"));
projectGroup->appendProperty("path", relativeProjectPath);
}
-void IarewWorkspace::accept(IIarewNodeVisitor *visitor) const
-{
- visitor->visitStart(this);
-
- for (const auto &child : children())
- child->accept(visitor);
-
- visitor->visitEnd(this);
-}
-
} // namespace qbs