Move the shipped Lua plugins to the resources directory

On macOS, files in Contents/PlugIns/ need to be codesigned individually.
Since Lua plugins are not really binaries, per Apple's documentation
that is to be avoided (and we currently only sign executables there).

Just move Lua plugins generally to the resources directory, like we do
for other scripts like the debugger Python scripts, and load them from
there.

Change-Id: Idabd6b7c0c7c6e842b1752488cb7073f00e7be49
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Eike Ziller
2024-06-19 15:21:44 +02:00
parent 3f1906dc20
commit f5dde31558
27 changed files with 8 additions and 87 deletions

View File

@@ -1119,27 +1119,3 @@ function(qtc_add_public_header header)
COMPONENT Devel EXCLUDE_FROM_ALL
)
endfunction()
function (add_qtc_lua_plugin name)
cmake_parse_arguments(_arg "EXCLUDE_FROM_INSTALL" "" "SOURCES" ${ARGN})
if (${_arg_UNPARSED_ARGUMENTS})
message(FATAL_ERROR "add_qtc_lua_plugin had unparsed arguments!")
endif()
qtc_copy_to_builddir(${name}
FILES ${_arg_SOURCES}
DESTINATION ${IDE_PLUGIN_PATH}
)
if (NOT _arg_EXCLUDE_FROM_INSTALL)
foreach(SOURCE ${_arg_SOURCES})
get_filename_component(SOURCE_DIR "${SOURCE}" DIRECTORY)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
DESTINATION ${IDE_PLUGIN_PATH}/${SOURCE_DIR}
)
endforeach()
endif()
endfunction()

View File

@@ -618,11 +618,11 @@
"QDocModule": "qtcreator",
"QtParts": ["tools"],
"QtUsage": "Used for pretty printing from Lua scripts.",
"Path": "src/plugins/luatests/luatests",
"Path": "share/qtcreator/lua-plugins/luatests",
"Description": "inspect.lua is a library for pretty printing complex objects in Lua.",
"Homepage": "https://github.com/kikito/inspect.lua",
"License": "MIT License",
"LicenseFile": "src/plugins/luatests/luatests/INSPECT-LICENSE.txt",
"LicenseFile": "share/qtcreator/lua-plugins/luatests/INSPECT-LICENSE.txt",
"Copyright": "Copyright (c) 2022 Enrique García Cota"
}
]

View File

@@ -4,6 +4,7 @@ set(resource_directories
glsl
indexer_preincludes
jsonschemas
lua-plugins
modeleditor
qmldesigner
qmlicons

View File

@@ -177,8 +177,11 @@ static inline int askMsgSendFailed()
static inline QStringList getPluginPaths()
{
QStringList rc(QDir::cleanPath(QApplication::applicationDirPath()
+ '/' + RELATIVE_PLUGIN_PATH));
QStringList rc;
rc << (QDir::cleanPath(QApplication::applicationDirPath()
+ '/' + RELATIVE_PLUGIN_PATH))
<< (QDir::cleanPath(QApplication::applicationDirPath()
+ '/' + RELATIVE_DATA_PATH + "/lua-plugins"));
// Local plugin path: <localappdata>/plugins/<ideversion>
// where <localappdata> is e.g.
// "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later

View File

@@ -119,7 +119,3 @@ endif()
add_subdirectory(qnx)
add_subdirectory(mcusupport)
add_subdirectory(qtapplicationmanager)
add_subdirectory(luatests)
add_subdirectory(tellajoke)
add_subdirectory(luals)
add_subdirectory(rustls)

View File

@@ -1,4 +0,0 @@
add_qtc_lua_plugin(luals
SOURCES luals/luals.lua
luals/init.lua
)

View File

@@ -1,8 +0,0 @@
QtcLuaPlugin {
name: "luals"
luafiles: [
"init.lua",
"luals.lua",
]
}

View File

@@ -1,11 +0,0 @@
add_qtc_lua_plugin(luatests
SOURCES
luatests/luatests.lua
luatests/tests.lua
luatests/inspect.lua
luatests/qtctest.lua
luatests/tst_aspectcontainer.lua
luatests/tst_fetch.lua
luatests/tst_utils.lua
luatests/guidemo.lua
)

View File

@@ -1,14 +0,0 @@
QtcLuaPlugin {
name: "luatests"
luafiles: [
"inspect.lua",
"guidemo.lua",
"luatests.lua",
"qtctest.lua",
"tests.lua",
"tst_aspectcontainer.lua",
"tst_fetch.lua",
"tst_utils.lua",
]
}

View File

@@ -1,4 +0,0 @@
add_qtc_lua_plugin(rustls
SOURCES rustls/rustls.lua
rustls/init.lua
)

View File

@@ -1,8 +0,0 @@
QtcLuaPlugin {
name: "rustls"
luafiles: [
"init.lua",
"rustls.lua",
]
}

View File

@@ -1 +0,0 @@
add_qtc_lua_plugin(tellajoke SOURCES tellajoke/tellajoke.lua)

View File

@@ -1,5 +0,0 @@
QtcLuaPlugin {
name: "tellajoke"
luafiles: "tellajoke.lua"
}