diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2015-03-04 08:24:16 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2015-03-04 18:19:00 +0000 |
commit | 0b996210f6e0b7d98e505dd313fdc1ed69de3217 (patch) | |
tree | 34fc7d92f279cfda5c4b5bde69bae324769a12c7 /src/qtcreatorplugin.pri | |
parent | e747817c955bef982fac3966e446dd632139c6ed (diff) |
Project: Deduplicate dependency resolving logic
Change-Id: I6af80600b060fa6a99704df0709461799858d41e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/qtcreatorplugin.pri')
-rw-r--r-- | src/qtcreatorplugin.pri | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/qtcreatorplugin.pri b/src/qtcreatorplugin.pri index e3536b35478..a478f498aa3 100644 --- a/src/qtcreatorplugin.pri +++ b/src/qtcreatorplugin.pri @@ -14,33 +14,27 @@ plugin_recmds = $$QTC_PLUGIN_RECOMMENDS include(../qtcreator.pri) -# for substitution in the .json -dependencyList = -for(dep, plugin_deps) { +defineReplace(dependencyName) { dependencies_file = for(dir, QTC_PLUGIN_DIRS) { - exists($$dir/$$dep/$${dep}_dependencies.pri) { - dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri + exists($$dir/$$1/$${1}_dependencies.pri) { + dependencies_file = $$dir/$$1/$${1}_dependencies.pri break() } } isEmpty(dependencies_file): \ error("Plugin dependency $$dep not found") include($$dependencies_file) - dependencyList += " { \"Name\" : \"$$QTC_PLUGIN_NAME\", \"Version\" : \"$$QTCREATOR_VERSION\" }" + return($$QTC_PLUGIN_NAME) +} + +# for substitution in the .json +dependencyList = +for(dep, plugin_deps) { + dependencyList += " { \"Name\" : \"$$dependencyName($$dep)\", \"Version\" : \"$$QTCREATOR_VERSION\" }" } for(dep, plugin_recmds) { - dependencies_file = - for(dir, QTC_PLUGIN_DIRS) { - exists($$dir/$$dep/$${dep}_dependencies.pri) { - dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri - break() - } - } - isEmpty(dependencies_file): \ - error("Plugin dependency $$dep not found") - include($$dependencies_file) - dependencyList += " { \"Name\" : \"$$QTC_PLUGIN_NAME\", \"Version\" : \"$$QTCREATOR_VERSION\", \"Type\" : \"optional\" }" + dependencyList += " { \"Name\" : \"$$dependencyName($$dep)\", \"Version\" : \"$$QTCREATOR_VERSION\", \"Type\" : \"optional\" }" } dependencyList = $$join(dependencyList, ",$$escape_expand(\\n)") |