forked from qt-creator/qt-creator
Nim: Fix building with nimble
Do not expect nimble to be in PATH, but assume it is located where nim resides. Use kit's information of nim to construct the nimble path and add the path of nim explicitly to the build environment as nimble uses it. Also fixes running nimble test. Change-Id: If7be425f7b811486afe39fc1618709dbb2f75ac9 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -24,9 +24,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "nimblerunconfiguration.h"
|
||||
|
||||
#include "nimbuildsystem.h"
|
||||
#include "nimconstants.h"
|
||||
#include "nimbleproject.h"
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/localenvironmentaspect.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
@@ -35,8 +39,6 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QStandardPaths>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Nim {
|
||||
@@ -89,7 +91,14 @@ public:
|
||||
NimbleTestConfiguration(ProjectExplorer::Target *target, Utils::Id id)
|
||||
: RunConfiguration(target, id)
|
||||
{
|
||||
addAspect<ExecutableAspect>()->setExecutable(Utils::FilePath::fromString(QStandardPaths::findExecutable("nimble")));
|
||||
QString nimble;
|
||||
auto bc = this->target()->activeBuildConfiguration();
|
||||
auto nimbleBuildStep = bc->buildSteps()->firstStepWithId(Constants::C_NIMBLEBUILDSTEP_ID);
|
||||
if (nimbleBuildStep && nimbleBuildStep->buildSystem()) {
|
||||
nimble = static_cast<NimBuildSystem *>(nimbleBuildStep->buildSystem())->defaultNimble();
|
||||
}
|
||||
|
||||
addAspect<ExecutableAspect>()->setExecutable(Utils::FilePath::fromString(nimble));
|
||||
addAspect<ArgumentsAspect>()->setArguments("test");
|
||||
addAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(project()->projectDirectory());
|
||||
addAspect<TerminalAspect>();
|
||||
|
||||
Reference in New Issue
Block a user