diff --git a/src/plugins/lua/bindings/project.cpp b/src/plugins/lua/bindings/project.cpp index e104d5c4d66..22cc904ea50 100644 --- a/src/plugins/lua/bindings/project.cpp +++ b/src/plugins/lua/bindings/project.cpp @@ -48,6 +48,8 @@ void setupProjectModule() result.new_usertype( "Project", sol::no_constructor, + "displayName", + sol::property(&Project::displayName), "directory", sol::property(&Project::projectDirectory), "activeRunConfiguration", @@ -64,7 +66,8 @@ void setupProjectModule() }; result["runStartupProject"] = - [guard](const sol::optional &runnable) { + [guard](const sol::optional &runnable, + const sol::optional &displayName) { auto project = ProjectManager::instance()->startupProject(); if (!project) throw sol::error("No startup project"); @@ -83,6 +86,9 @@ void setupProjectModule() rc->setEnvironment(runnable->environment); } + if (displayName) + rc->setDisplayName(displayName.value()); + BuildForRunConfigStatus status = BuildManager::potentiallyBuildForRunConfig( runConfiguration); diff --git a/src/plugins/lua/meta/project.lua b/src/plugins/lua/meta/project.lua index 3c5b568d048..7a90c67c154 100644 --- a/src/plugins/lua/meta/project.lua +++ b/src/plugins/lua/meta/project.lua @@ -27,6 +27,7 @@ function project.Kit:supportedPlatforms() end project.RunConfiguration = {} ---@class Project +---@field displayName string The display name of the project. ---@field directory FilePath The directory of the 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. ---@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