forked from qt-creator/qt-creator
Lua: Add supported platfroms list to Project class
Change-Id: I35781b16ca9b7098418654c3bf57a72d2fbd3cf4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -28,11 +28,22 @@ void setupProjectModule()
|
||||
|
||||
sol::table result = lua.create_table();
|
||||
|
||||
result.new_usertype<Kit>(
|
||||
"Kit",
|
||||
sol::no_constructor,
|
||||
"supportedPlatforms",
|
||||
[](Kit *kit) {
|
||||
const auto set = kit->supportedPlatforms();
|
||||
return QList<Utils::Id>(set.constBegin(), set.constEnd());
|
||||
});
|
||||
|
||||
result.new_usertype<RunConfiguration>(
|
||||
"RunConfiguration",
|
||||
sol::no_constructor,
|
||||
"runnable",
|
||||
sol::property(&RunConfiguration::runnable));
|
||||
sol::property(&RunConfiguration::runnable),
|
||||
"kit",
|
||||
sol::property(&RunConfiguration::kit));
|
||||
|
||||
result.new_usertype<Project>(
|
||||
"Project",
|
||||
@@ -99,6 +110,9 @@ void setupProjectModule()
|
||||
result["RunMode"] = lua.create_table_with(
|
||||
"Normal", Constants::NORMAL_RUN_MODE, "Debug", Constants::DEBUG_RUN_MODE);
|
||||
|
||||
result["Platforms"] = lua.create_table_with(
|
||||
"Desktop", Utils::Id(Constants::DESKTOP_DEVICE_TYPE));
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <utils/futuresynchronizer.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/icon.h>
|
||||
#include <utils/id.h>
|
||||
#include <utils/processinterface.h>
|
||||
|
||||
#include <QDesktopServices>
|
||||
@@ -93,6 +94,10 @@ void setupUtilsModule()
|
||||
|
||||
utils["pid"] = QCoreApplication::applicationPid();
|
||||
|
||||
utils.new_usertype<Utils::Id>(
|
||||
"Id",
|
||||
sol::no_constructor);
|
||||
|
||||
auto hostOsInfoType = utils.new_usertype<HostOsInfo>("HostOsInfo");
|
||||
hostOsInfoType["isWindowsHost"] = &HostOsInfo::isWindowsHost;
|
||||
hostOsInfoType["isMacHost"] = &HostOsInfo::isMacHost;
|
||||
|
@@ -9,8 +9,21 @@ project.RunMode {
|
||||
Debug = "RunConfiguration.DebugRunMode",
|
||||
}
|
||||
|
||||
---@enum Platforms
|
||||
project.Platforms {
|
||||
Desktop = 0,
|
||||
}
|
||||
|
||||
---@class Kit
|
||||
project.Kit = {}
|
||||
|
||||
---Returns the list of supported platforms (device types) for this kit.
|
||||
---@return [Id] The list of supported platforms (device types) for this kit.
|
||||
function project.Kit:supportedPlatforms() end
|
||||
|
||||
---@class RunConfiguration
|
||||
---@field runnable ProcessRunData
|
||||
---@field kit Kit
|
||||
project.RunConfiguration = {}
|
||||
|
||||
---@class Project
|
||||
|
@@ -18,6 +18,9 @@ function utils.waitms_cb(ms, callback) end
|
||||
---@return QString Arbitrary UUID string.
|
||||
function utils.createUuid() end
|
||||
|
||||
---@class Id
|
||||
utils.Id = {}
|
||||
|
||||
---@class FilePath
|
||||
utils.FilePath = {}
|
||||
|
||||
|
Reference in New Issue
Block a user