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>
This commit is contained in:
hjk
2016-08-23 09:17:04 +02:00
committed by hjk
parent 2847e248e6
commit f7e7fc4e29
5 changed files with 16 additions and 97 deletions

View File

@@ -20,7 +20,6 @@ HEADERS += \
project/nimprojectnode.h \ project/nimprojectnode.h \
project/nimbuildconfiguration.h \ project/nimbuildconfiguration.h \
project/nimbuildconfigurationfactory.h \ project/nimbuildconfigurationfactory.h \
project/nimbuildinfo.h \
project/nimcompilerbuildstep.h \ project/nimcompilerbuildstep.h \
project/nimcompilerbuildstepconfigwidget.h \ project/nimcompilerbuildstepconfigwidget.h \
project/nimcompilercleanstep.h \ project/nimcompilercleanstep.h \
@@ -50,7 +49,6 @@ SOURCES += \
project/nimprojectnode.cpp \ project/nimprojectnode.cpp \
project/nimbuildconfiguration.cpp \ project/nimbuildconfiguration.cpp \
project/nimbuildconfigurationfactory.cpp \ project/nimbuildconfigurationfactory.cpp \
project/nimbuildinfo.cpp \
project/nimcompilerbuildstep.cpp \ project/nimcompilerbuildstep.cpp \
project/nimcompilerbuildstepconfigwidget.cpp \ project/nimcompilerbuildstepconfigwidget.cpp \
project/nimcompilercleanstep.cpp \ project/nimcompilercleanstep.cpp \

View File

@@ -36,7 +36,6 @@ QtcPlugin {
"nimbuildconfiguration.h", "nimbuildconfiguration.cpp", "nimbuildconfiguration.h", "nimbuildconfiguration.cpp",
"nimbuildconfigurationfactory.h", "nimbuildconfigurationfactory.cpp", "nimbuildconfigurationfactory.h", "nimbuildconfigurationfactory.cpp",
"nimbuildconfigurationwidget.h", "nimbuildconfigurationwidget.cpp", "nimbuildconfigurationwidget.h", "nimbuildconfigurationwidget.cpp",
"nimbuildinfo.h", "nimbuildinfo.cpp",
"nimcompilerbuildstep.h", "nimcompilerbuildstep.cpp", "nimcompilerbuildstep.h", "nimcompilerbuildstep.cpp",
"nimcompilerbuildstepconfigwidget.h", "nimcompilerbuildstepconfigwidget.cpp", "nimcompilerbuildstepconfigwidget.ui", "nimcompilerbuildstepconfigwidget.h", "nimcompilerbuildstepconfigwidget.cpp", "nimcompilerbuildstepconfigwidget.ui",
"nimcompilerbuildstepfactory.h", "nimcompilerbuildstepfactory.cpp", "nimcompilerbuildstepfactory.h", "nimcompilerbuildstepfactory.cpp",

View File

@@ -25,7 +25,6 @@
#include "nimbuildconfigurationfactory.h" #include "nimbuildconfigurationfactory.h"
#include "nimbuildconfiguration.h" #include "nimbuildconfiguration.h"
#include "nimbuildinfo.h"
#include "nimcompilerbuildstep.h" #include "nimcompilerbuildstep.h"
#include "nimcompilercleanstep.h" #include "nimcompilercleanstep.h"
#include "nimproject.h" #include "nimproject.h"
@@ -33,6 +32,7 @@
#include "../nimconstants.h" #include "../nimconstants.h"
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildinfo.h> #include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
@@ -49,6 +49,21 @@ using namespace Utils;
namespace Nim { 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) NimBuildConfigurationFactory::NimBuildConfigurationFactory(QObject *parent)
: IBuildConfigurationFactory(parent) : IBuildConfigurationFactory(parent)
{} {}

View File

@@ -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;
}
}

View File

@@ -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;
};
}