aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-02-09 10:53:13 +0100
committerEike Ziller <eike.ziller@qt.io>2017-02-16 08:26:32 +0000
commit783e0014a86d4f0ba0496ed65f864a29b9815963 (patch)
treed58a92c954b575e9624a085ea3b208e8a1cee93d
parent750bb2981cf3cec5c6ccdf0b37a4ea3bc306457c (diff)
Add Fossil SCM plugin
submodules.pri is derived from qt5/qt.pro, starting from "# Extract submodules", with a few differences: - removed setting QMAKE_INTERNAL_INCLUDED_FILES - renamed QT_BUILD_MODULES and QT_SKIP_MODULES to QTC_* and removed corresponding argument parsing - removed handling of module.$${mod}.qt - made it look for the module .pro file in the module.$${mod}.path - renamed the sub targets in the Makefile to sub-<module> Change-Id: I4e29027169ce7260b029eef33789814fa20ffc99 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--.gitmodules5
m---------plugins/fossil0
-rw-r--r--qtc-super.pro6
-rw-r--r--qtc-super.qbs50
-rw-r--r--submodules.pri62
5 files changed, 120 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules
index 9593a62..b58ead0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,3 +2,8 @@
path = qtcreator
url = ../qt-creator
branch = master
+[submodule "fossil"]
+ path = plugins/fossil
+ url = ../plugin-fossil-scm
+ depends = qtcreator
+ branch = master
diff --git a/plugins/fossil b/plugins/fossil
new file mode 160000
+Subproject 0d957a88f9fb68a63b9e4ac26857aca82006371
diff --git a/qtc-super.pro b/qtc-super.pro
index 84c5026..4fc45cb 100644
--- a/qtc-super.pro
+++ b/qtc-super.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
mkpath($$OUT_PWD/qtcreator) # so the qtcreator.pro is able to create a .qmake.cache there
-SUBDIRS = \
- qtcreator
-
DISTFILES += .qmake.conf
+
+QTC_SKIP_MODULES =
+include(submodules.pri)
diff --git a/qtc-super.qbs b/qtc-super.qbs
index 59c3eba..d656d0e 100644
--- a/qtc-super.qbs
+++ b/qtc-super.qbs
@@ -1,13 +1,63 @@
import qbs
import qbs.File
import qbs.FileInfo
+import qbs.TextFile
Project {
name: "Qt Creator Super Project"
qbsSearchPaths: ["qtcreator/qbs"]
+// TODO: enable when we can require Qbs 1.8
+// Probe {
+// id: submodules
+// property var modules: []
+
+// configure: {
+// var mods = [];
+// var gitmodules = new TextFile(FileInfo.joinPaths(path, ".gitmodules"));
+// var module = null;
+// while (!gitmodules.atEof()) {
+// var line = gitmodules.readLine();
+// var modLine = line.match(/^\[submodule "([^"]+)"\]$/);
+// if (modLine) {
+// module = { _name: modLine[1] };
+// mods.push(module);
+// } else if (module) {
+// var propLine = line.match(/^\t([^ =]+) *= *(.*)$/);
+// if (propLine)
+// module[propLine[1]] = propLine[2];
+// else
+// console.warn("Malformed line in .gitmodules: " + line);
+// }
+// }
+// modules = mods;
+// }
+// }
+
SubProject {
filePath: "qtcreator/qtcreator.qbs"
+ Properties {
+ additionalPlugins: {
+ // TODO remove when we can use the Probe
+ var submodules = { modules: [
+ { _name: "fossil", path: "plugins/fossil" }
+ ]}
+ var plugins = [];
+ submodules.modules.forEach(function(module) {
+ var modulePath = module.path;
+ var qbsBase = FileInfo.fileName(modulePath);
+ if (qbsBase !== "qtcreator") { // skip qtcreator submodule
+ var file = FileInfo.joinPaths(path, modulePath, "plugins", qbsBase,
+ qbsBase + ".qbs");
+ if (!File.exists(file))
+ file = FileInfo.joinPaths(path, modulePath, qbsBase + ".qbs");
+ if (File.exists(file))
+ plugins.push(file);
+ }
+ });
+ return plugins;
+ }
+ }
}
}
diff --git a/submodules.pri b/submodules.pri
new file mode 100644
index 0000000..86221a5
--- /dev/null
+++ b/submodules.pri
@@ -0,0 +1,62 @@
+# Extract submodules from .gitmodules.
+lines = $$cat(.gitmodules, lines)
+for (line, lines) {
+ mod = $$replace(line, "^\\[submodule \"([^\"]+)\"\\]$", \\1)
+ !equals(mod, $$line) {
+ module = $$mod
+ modules += $$mod
+ } else {
+ prop = $$replace(line, "^$$escape_expand(\\t)([^ =]+) *=.*$", \\1)
+ !equals(prop, $$line) {
+ val = $$replace(line, "^[^=]+= *", )
+ module.$${module}.$$prop = $$split(val)
+ } else {
+ error("Malformed line in .gitmodules: $$line")
+ }
+ }
+}
+
+modules = $$sort_depends(modules, module., .depends .recommends)
+modules = $$reverse(modules)
+for (mod, modules) {
+ deps = $$eval(module.$${mod}.depends)
+ recs = $$eval(module.$${mod}.recommends)
+ for (d, $$list($$deps $$recs)): \
+ !contains(modules, $$d): \
+ error("'$$mod' depends on undeclared '$$d'.")
+
+ contains(QTC_SKIP_MODULES, $$mod): \
+ next()
+ !isEmpty(QTC_BUILD_MODULES):!contains(QTC_BUILD_MODULES, $$mod): \
+ next()
+
+ path = $$eval(module.$${mod}.path)
+ project = $$eval(module.$${mod}.project)
+ isEmpty(project) {
+ !exists($$path/$$section(path, /, -1).pro): \
+ next()
+ $${mod}.subdir = $$path
+ } else {
+ !exists($$path/$$project): \
+ next()
+ $${mod}.file = $$path/$$project
+ $${mod}.makefile = Makefile
+ }
+ $${mod}.target = sub-$$mod
+
+ for (d, deps) {
+ !contains(SUBDIRS, $$d) {
+ $${mod}.target =
+ break()
+ }
+ $${mod}.depends += $$d
+ }
+ isEmpty($${mod}.target): \
+ next()
+ for (d, recs) {
+ contains(SUBDIRS, $$d): \
+ $${mod}.depends += $$d
+ }
+
+ SUBDIRS += $$mod
+}