forked from qt-creator/qt-creator
Lua: Support custom display name in Project class
Change-Id: I790dc328694c660dc79c0e0d88cb6d01c091f057 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -48,6 +48,8 @@ void setupProjectModule()
|
|||||||
result.new_usertype<Project>(
|
result.new_usertype<Project>(
|
||||||
"Project",
|
"Project",
|
||||||
sol::no_constructor,
|
sol::no_constructor,
|
||||||
|
"displayName",
|
||||||
|
sol::property(&Project::displayName),
|
||||||
"directory",
|
"directory",
|
||||||
sol::property(&Project::projectDirectory),
|
sol::property(&Project::projectDirectory),
|
||||||
"activeRunConfiguration",
|
"activeRunConfiguration",
|
||||||
@@ -64,7 +66,8 @@ void setupProjectModule()
|
|||||||
};
|
};
|
||||||
|
|
||||||
result["runStartupProject"] =
|
result["runStartupProject"] =
|
||||||
[guard](const sol::optional<ProcessRunData> &runnable) {
|
[guard](const sol::optional<ProcessRunData> &runnable,
|
||||||
|
const sol::optional<QString> &displayName) {
|
||||||
auto project = ProjectManager::instance()->startupProject();
|
auto project = ProjectManager::instance()->startupProject();
|
||||||
if (!project)
|
if (!project)
|
||||||
throw sol::error("No startup project");
|
throw sol::error("No startup project");
|
||||||
@@ -83,6 +86,9 @@ void setupProjectModule()
|
|||||||
rc->setEnvironment(runnable->environment);
|
rc->setEnvironment(runnable->environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayName)
|
||||||
|
rc->setDisplayName(displayName.value());
|
||||||
|
|
||||||
BuildForRunConfigStatus status = BuildManager::potentiallyBuildForRunConfig(
|
BuildForRunConfigStatus status = BuildManager::potentiallyBuildForRunConfig(
|
||||||
runConfiguration);
|
runConfiguration);
|
||||||
|
|
||||||
|
@@ -27,6 +27,7 @@ function project.Kit:supportedPlatforms() end
|
|||||||
project.RunConfiguration = {}
|
project.RunConfiguration = {}
|
||||||
|
|
||||||
---@class Project
|
---@class Project
|
||||||
|
---@field displayName string The display name of the project.
|
||||||
---@field directory FilePath The directory of the project.
|
---@field directory FilePath The directory of the project.
|
||||||
project.Project = {}
|
project.Project = {}
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ function project.canRunStartupProject(runMode) end
|
|||||||
|
|
||||||
---Starts the active run configuration of the current startup project. It will be build first if necessary.
|
---Starts the active run configuration of the current startup project. It will be build first if necessary.
|
||||||
---@param runnable? ProcessRunData Override the run configuration with the specified runnable.
|
---@param runnable? ProcessRunData Override the run configuration with the specified runnable.
|
||||||
function project.runStartupProject(runnable) end
|
---@param displayName? string Override the run configuration display name with the provided name.
|
||||||
|
function project.runStartupProject(runnable, displayName) end
|
||||||
|
|
||||||
return project
|
return project
|
||||||
|
Reference in New Issue
Block a user