ExtensionSystem: Allow .md files for License and LongDescription

Change-Id: Ic5f6ebf72ee97f30c0bca01a046f04aeff319c1f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-09-02 15:11:37 +02:00
parent 8aeb967fcd
commit d0ec82f54d
5 changed files with 49 additions and 15 deletions

View File

@@ -328,10 +328,22 @@ function(add_qtc_library name)
endif()
endfunction(add_qtc_library)
function(markdown_to_json resultVarName filepath)
file(STRINGS ${filepath} markdown)
list(TRANSFORM markdown REPLACE "\\\\" "\\\\\\\\") # Replace \ with \\
list(TRANSFORM markdown REPLACE "\\\"" "\\\\\"") # Replace " with \"
list(TRANSFORM markdown PREPEND " \"" )
list(TRANSFORM markdown APPEND "\"")
list(JOIN markdown ",\n" result)
set(result "[\n${result}\n ]")
set("${resultVarName}" ${result} PARENT_SCOPE)
endfunction()
function(add_qtc_plugin target_name)
cmake_parse_arguments(_arg
"SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH"
"VERSION;COMPAT_VERSION;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS"
"VERSION;COMPAT_VERSION;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS;LONG_DESCRIPTION_MD;LICENSE_MD"
"CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;SYSTEM_INCLUDES;PUBLIC_INCLUDES;PUBLIC_SYSTEM_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PLUGIN_MANUAL_DEPENDS;PROPERTIES;PRIVATE_COMPILE_OPTIONS;PUBLIC_COMPILE_OPTIONS"
${ARGN}
)
@@ -446,6 +458,19 @@ function(add_qtc_plugin target_name)
set(IDE_PLUGIN_DEPENDENCIES ${_arg_DEPENDENCY_STRING})
set(LONG_DESCRIPTION "[]")
if (_arg_LONG_DESCRIPTION_MD)
markdown_to_json(LONG_DESCRIPTION ${_arg_LONG_DESCRIPTION_MD})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${_arg_LONG_DESCRIPTION_MD})
endif()
set(LICENSE "[]")
if (_arg_LICENSE_MD)
markdown_to_json(LICENSE ${_arg_LICENSE_MD})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${_arg_LICENSE_MD})
endif()
### Configure plugin.json file:
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.json.in")
list(APPEND _arg_SOURCES ${name}.json.in)

View File

@@ -6,22 +6,10 @@
"VendorId" : "kdenecessitas",
"Vendor" : "KDE Necessitas",
"Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd",
"License" : [ "Commercial Usage",
"",
"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.",
"",
"GNU General Public License Usage",
"",
"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html."
],
"License" : ${LICENSE},
"Category" : "Device Support",
"Description" : "Develop applications for Android devices.",
"LongDescription" : [
"Connect devices with USB to run, debug, and analyze applications built for them.",
"You also need:",
"- Qt for Android",
"- Android development tools"
],
"LongDescription" : ${LONG_DESCRIPTION},
"Url" : "https://www.qt.io",
"DocumentationUrl" : "https://doc.qt.io/qtcreator/creator-developing-android.html",
${IDE_PLUGIN_DEPENDENCIES},

View File

@@ -1,6 +1,8 @@
add_qtc_plugin(Android
DEPENDS QmlDebug Qt::Xml LanguageServerProtocol
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport LanguageClient
LONG_DESCRIPTION_MD plugindescription.md
LICENSE_MD LICENSE.md
SOURCES
android.qrc
androidtr.h

View File

@@ -0,0 +1,13 @@
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt
Commercial License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and The Qt Company.
GNU General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU General Public License version 3
as published by the Free Software Foundation with exceptions as appearing in the file
LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following
information to ensure the GNU General Public License requirements will be met:
https://www.gnu.org/licenses/gpl-3.0.html

View File

@@ -0,0 +1,6 @@
Connect devices with USB to run, debug, and analyze applications built for them.
You also need:
* Qt for Android
* Android development tools