summaryrefslogtreecommitdiff
path: root/qbs
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2012-04-10 17:28:05 +0200
committerJoerg Bornemann <joerg.bornemann@nokia.com>2012-04-13 16:26:00 +0200
commit65f9152372cbd6c044a6619e5b667ab6d6aa1b96 (patch)
treeb5a293b19f3355d1e32b56215008fbc18ab76a66 /qbs
parent96a56693324ed67b041abd068de9f19872dd831e (diff)
downloadqt-creator-65f9152372cbd6c044a6619e5b667ab6d6aa1b96.tar.gz
qbs files: generate json files from .pluginspec files for Qt5
Change-Id: I70ce3d8b6ead88b2bb7a595c8aaf465d441ffe98 Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
Diffstat (limited to 'qbs')
-rw-r--r--qbs/pluginspec/pluginspec.qbs30
1 files changed, 29 insertions, 1 deletions
diff --git a/qbs/pluginspec/pluginspec.qbs b/qbs/pluginspec/pluginspec.qbs
index 9b186e7474..5dac760880 100644
--- a/qbs/pluginspec/pluginspec.qbs
+++ b/qbs/pluginspec/pluginspec.qbs
@@ -2,7 +2,9 @@ import qbs.base 1.0
import qbs.fileinfo 1.0 as FileInfo
Module {
- additionalProductFileTags: ["pluginSpec"]
+ Depends { id: qtcore; name: "qt.core" }
+
+ additionalProductFileTags: qtcore.versionMajor < 5 ? ["pluginSpec"] : ["pluginJSON"]
property int ide_version_major: project.ide_version_major
property int ide_version_minor: project.ide_version_minor
property int ide_version_release: project.ide_version_release
@@ -58,5 +60,31 @@ Module {
return cmd;
}
}
+
+ Rule {
+ inputs: ["pluginSpec"]
+
+ Artifact {
+ fileTags: ["pluginJSON"]
+ fileName: {
+ var destdir = FileInfo.joinPaths(product.modules["qt/core"].generatedFilesDir,
+ input.fileName);
+ return destdir.replace(/\.[^\.]*$/, '.json');
+ }
+ }
+
+ prepare: {
+ var xslFile = project.path + "/src/pluginjsonmetadata.xsl";
+ var xmlPatternsPath = product.modules["qt/core"].binPath + "/xmlpatterns";
+ var args = [
+ "-no-format", "-output", output.fileName,
+ xslFile, input.fileName
+ ];
+ var cmd = new Command(xmlPatternsPath, args);
+ cmd.description = "generating " + FileInfo.fileName(output.fileName);
+ cmd.highlight = "codegen";
+ return cmd;
+ }
+ }
}