forked from qt-creator/qt-creator
Lua: Move lua plugins into normal plugin folder
Change-Id: I14ab0bb755a4279bc255673596fe084cd556433c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1129,7 +1129,7 @@ function (add_qtc_lua_plugin name)
|
||||
|
||||
qtc_copy_to_builddir(${name}
|
||||
FILES ${_arg_SOURCES}
|
||||
DESTINATION ${IDE_PLUGIN_PATH}/lua-plugins
|
||||
DESTINATION ${IDE_PLUGIN_PATH}
|
||||
)
|
||||
|
||||
if (NOT _arg_EXCLUDE_FROM_INSTALL)
|
||||
@@ -1138,7 +1138,7 @@ function (add_qtc_lua_plugin name)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
|
||||
DESTINATION ${IDE_PLUGIN_PATH}/lua-plugins/${SOURCE_DIR}
|
||||
DESTINATION ${IDE_PLUGIN_PATH}/${SOURCE_DIR}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
@@ -7,6 +7,6 @@ Product {
|
||||
prefix: sourceDirectory + '/' + product.name + '/'
|
||||
files: luafiles
|
||||
qbs.install: true
|
||||
qbs.installDir: qtc.ide_plugin_path + '/lua-plugins/' + product.name
|
||||
qbs.installDir: qtc.ide_plugin_path + '/' + product.name
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ The Lua plugin provides support for writing plugins using the Lua scripting lang
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin scans the folder `lua-plugins` folder inside the normal plugin folder of Qt Creator
|
||||
The plugin scans the normal plugin folders of Qt Creator
|
||||
`ExtensionSystem::PluginManager::pluginPaths()`. It loads scripts from any folder that contains
|
||||
a .lua script named the same as the folder.
|
||||
Whether or not the script is enabled is determined by the `disabledByDefault` field in the plugin
|
||||
@@ -17,7 +17,7 @@ table and the settings configured via the "About Plugins" dialog in Qt Creator.
|
||||
A Lua script needs to provide the following table to be considered a plugin:
|
||||
|
||||
```lua
|
||||
-- lua-plugins/myluaplugin/myluaplugin.lua
|
||||
-- myluaplugin/myluaplugin.lua
|
||||
return {
|
||||
name = "MyLuaPlugin",
|
||||
version = "1.0.0",
|
||||
@@ -50,13 +50,13 @@ It must only return the plugin specification table and not execute or require an
|
||||
Use `require` to load other files from within the setup function.
|
||||
|
||||
```lua
|
||||
-- lua-plugins/myluaplugin/myluaplugin.lua
|
||||
-- myluaplugin/myluaplugin.lua
|
||||
return {
|
||||
-- ... required fields omitted ..
|
||||
setup = function() require 'init'.setup() end,
|
||||
} --[[@as QtcPlugin]]
|
||||
|
||||
-- lua-plugins/myluaplugin/init.lua
|
||||
-- myluaplugin/init.lua
|
||||
local function setup()
|
||||
print("Hello from Lua!")
|
||||
end
|
||||
|
@@ -106,10 +106,7 @@ public:
|
||||
|
||||
bool delayedInitialize() final
|
||||
{
|
||||
scanForPlugins(transform(PluginManager::pluginPaths(), [](const FilePath &path) {
|
||||
return path / "lua-plugins";
|
||||
}));
|
||||
|
||||
scanForPlugins(PluginManager::pluginPaths());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user