diff options
author | hjk <hjk@theqtcompany.com> | 2016-08-23 09:17:04 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2016-08-23 16:35:17 +0000 |
commit | f7e7fc4e29d0456d84186433f28c29f0ef9e63e4 (patch) | |
tree | 6090c46dac6c9f9e136fe3507240d52f93d5b60f /src/plugins/nim | |
parent | 2847e248e616a4dadd23e2f5c673e9a18edda4c6 (diff) | |
download | qt-creator-f7e7fc4e29d0456d84186433f28c29f0ef9e63e4.tar.gz |
Nim: Inline NimBuildInfo into nimbuildconfigurationfactory.cpp
It's only used there. Less code, less disk space.
This code is likely to be copied over and over into future language
plugins.
We cannot afford to spend 1 MB of disk space per build for every 12
lines
of trivial code, so remove this precedent.
Before:
1006824 ./.obj/debug-shared/nimbuildinfo.o
1509784 ./.obj/debug-shared/nimbuildconfigurationfactory.o
After:
1520840 ./.obj/debug-shared/nimbuildconfigurationfactory.o
Change-Id: I8e82b73e50595089d270e52b34cf8bd80ec7e965
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/nim')
-rw-r--r-- | src/plugins/nim/nim.pro | 2 | ||||
-rw-r--r-- | src/plugins/nim/nim.qbs | 1 | ||||
-rw-r--r-- | src/plugins/nim/project/nimbuildconfigurationfactory.cpp | 17 | ||||
-rw-r--r-- | src/plugins/nim/project/nimbuildinfo.cpp | 45 | ||||
-rw-r--r-- | src/plugins/nim/project/nimbuildinfo.h | 48 |
5 files changed, 16 insertions, 97 deletions
diff --git a/src/plugins/nim/nim.pro b/src/plugins/nim/nim.pro index 35b65add00..ffd8f71a2b 100644 --- a/src/plugins/nim/nim.pro +++ b/src/plugins/nim/nim.pro @@ -20,7 +20,6 @@ HEADERS += \ project/nimprojectnode.h \ project/nimbuildconfiguration.h \ project/nimbuildconfigurationfactory.h \ - project/nimbuildinfo.h \ project/nimcompilerbuildstep.h \ project/nimcompilerbuildstepconfigwidget.h \ project/nimcompilercleanstep.h \ @@ -50,7 +49,6 @@ SOURCES += \ project/nimprojectnode.cpp \ project/nimbuildconfiguration.cpp \ project/nimbuildconfigurationfactory.cpp \ - project/nimbuildinfo.cpp \ project/nimcompilerbuildstep.cpp \ project/nimcompilerbuildstepconfigwidget.cpp \ project/nimcompilercleanstep.cpp \ diff --git a/src/plugins/nim/nim.qbs b/src/plugins/nim/nim.qbs index becdb86f50..f020dbe744 100644 --- a/src/plugins/nim/nim.qbs +++ b/src/plugins/nim/nim.qbs @@ -36,7 +36,6 @@ QtcPlugin { "nimbuildconfiguration.h", "nimbuildconfiguration.cpp", "nimbuildconfigurationfactory.h", "nimbuildconfigurationfactory.cpp", "nimbuildconfigurationwidget.h", "nimbuildconfigurationwidget.cpp", - "nimbuildinfo.h", "nimbuildinfo.cpp", "nimcompilerbuildstep.h", "nimcompilerbuildstep.cpp", "nimcompilerbuildstepconfigwidget.h", "nimcompilerbuildstepconfigwidget.cpp", "nimcompilerbuildstepconfigwidget.ui", "nimcompilerbuildstepfactory.h", "nimcompilerbuildstepfactory.cpp", diff --git a/src/plugins/nim/project/nimbuildconfigurationfactory.cpp b/src/plugins/nim/project/nimbuildconfigurationfactory.cpp index 44485c664a..e18f8f745d 100644 --- a/src/plugins/nim/project/nimbuildconfigurationfactory.cpp +++ b/src/plugins/nim/project/nimbuildconfigurationfactory.cpp @@ -25,7 +25,6 @@ #include "nimbuildconfigurationfactory.h" #include "nimbuildconfiguration.h" -#include "nimbuildinfo.h" #include "nimcompilerbuildstep.h" #include "nimcompilercleanstep.h" #include "nimproject.h" @@ -33,6 +32,7 @@ #include "../nimconstants.h" #include <coreplugin/documentmanager.h> +#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildinfo.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildstep.h> @@ -49,6 +49,21 @@ using namespace Utils; namespace Nim { +class NimBuildInfo : public BuildInfo +{ +public: + NimBuildInfo(BuildConfiguration::BuildType buildType, + const NimBuildConfigurationFactory *factory) + : BuildInfo(factory), m_buildType(buildType) + {} + + BuildConfiguration::BuildType buildType() const { return m_buildType; } + +private: + BuildConfiguration::BuildType m_buildType; +}; + + NimBuildConfigurationFactory::NimBuildConfigurationFactory(QObject *parent) : IBuildConfigurationFactory(parent) {} diff --git a/src/plugins/nim/project/nimbuildinfo.cpp b/src/plugins/nim/project/nimbuildinfo.cpp deleted file mode 100644 index eb187750c5..0000000000 --- a/src/plugins/nim/project/nimbuildinfo.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com> -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "nimbuildinfo.h" -#include "nimbuildconfigurationfactory.h" - -using namespace ProjectExplorer; - -namespace Nim { - -NimBuildInfo::NimBuildInfo(BuildConfiguration::BuildType buildType, - const NimBuildConfigurationFactory *factory) - : BuildInfo(factory) - , m_buildType(buildType) -{} - -BuildConfiguration::BuildType NimBuildInfo::buildType() const -{ - return m_buildType; -} - -} - diff --git a/src/plugins/nim/project/nimbuildinfo.h b/src/plugins/nim/project/nimbuildinfo.h deleted file mode 100644 index d6b5fe40d1..0000000000 --- a/src/plugins/nim/project/nimbuildinfo.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com> -** Contact: http://www.qt.io/licensing -** -** This file is part of Qt Creator. -** -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildinfo.h> - -namespace Nim { - -class NimBuildConfigurationFactory; - -class NimBuildInfo : public ProjectExplorer::BuildInfo -{ -public: - NimBuildInfo(ProjectExplorer::BuildConfiguration::BuildType buildType, - const NimBuildConfigurationFactory *factory); - - - ProjectExplorer::BuildConfiguration::BuildType buildType() const; - -private: - ProjectExplorer::BuildConfiguration::BuildType m_buildType; -}; - -} |