summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Cotty <raphael.cotty@gmail.com>2021-04-29 20:09:35 +0200
committerRaphaƫl Cotty <raphael.cotty@gmail.com>2021-05-07 09:56:17 +0000
commitc2b7dd88e2f3ac5ebed99301ec8f847ffaedcb87 (patch)
treeb46588e97a52a7c02896f5ee60d0c121a57ccf85
parent3972a77103027b8e1a69754f0b21682b653fa2fb (diff)
downloadqbs-c2b7dd88e2f3ac5ebed99301ec8f847ffaedcb87.tar.gz
Replace "product" variable by "exportingProduct" in Export items
"product" variable in an Export item will point to the "importingProduct" in 1.21. This patch prepares the change by replacing "product" by "importingProduct" when necessary. Task-number: QBS-1576 Change-Id: I215d46484754e76771039a750dc4beb33d8a0c9c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--doc/reference/items/language/export.qdoc4
-rw-r--r--examples/app-and-lib/lib/lib.qbs2
-rw-r--r--qbs-resources/imports/QbsLibrary.qbs12
-rw-r--r--qbs-resources/imports/QbsStaticLibrary.qbs2
-rw-r--r--share/qbs/module-providers/Qt/templates/android_support.qbs4
-rw-r--r--src/lib/corelib/corelib.qbs2
-rw-r--r--src/lib/corelib/language/moduleloader.cpp7
-rw-r--r--src/lib/scriptengine/scriptengine.qbs6
-rw-r--r--tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs2
-rw-r--r--tests/auto/api/testdata/link-static-lib/link-static-lib.qbs4
-rw-r--r--tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs4
-rw-r--r--tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs2
-rw-r--r--tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs2
13 files changed, 27 insertions, 26 deletions
diff --git a/doc/reference/items/language/export.qdoc b/doc/reference/items/language/export.qdoc
index 056233193..96abde2ed 100644
--- a/doc/reference/items/language/export.qdoc
+++ b/doc/reference/items/language/export.qdoc
@@ -44,8 +44,8 @@
name: "A"
Export {
Depends { name: "cpp" }
- cpp.includePaths: product.sourceDirectory
- cpp.defines: ["USING_" + product.name.toUpperCase()]
+ cpp.includePaths: exportingProduct.sourceDirectory
+ cpp.defines: ["USING_" + exportingProduct.name.toUpperCase()]
}
}
diff --git a/examples/app-and-lib/lib/lib.qbs b/examples/app-and-lib/lib/lib.qbs
index 66ec4eccd..b67ba9ba6 100644
--- a/examples/app-and-lib/lib/lib.qbs
+++ b/examples/app-and-lib/lib/lib.qbs
@@ -61,7 +61,7 @@ StaticLibrary {
Export {
Depends { name: "cpp" }
- cpp.includePaths: [product.sourceDirectory]
+ cpp.includePaths: [exportingProduct.sourceDirectory]
}
}
diff --git a/qbs-resources/imports/QbsLibrary.qbs b/qbs-resources/imports/QbsLibrary.qbs
index 6fc6c7791..4923d89c4 100644
--- a/qbs-resources/imports/QbsLibrary.qbs
+++ b/qbs-resources/imports/QbsLibrary.qbs
@@ -61,15 +61,15 @@ QbsProduct {
Depends { name: "Qt"; submodules: ["core"] }
Properties {
- condition: product.hasExporter
+ condition: exportingProduct.hasExporter
prefixMapping: [{
- prefix: product.sourceDirectory,
- replacement: FileInfo.joinPaths(product.qbs.installPrefix,
- product.headerInstallPrefix)
+ prefix: exportingProduct.sourceDirectory,
+ replacement: FileInfo.joinPaths(exportingProduct.qbs.installPrefix,
+ exportingProduct.headerInstallPrefix)
}]
}
- cpp.includePaths: [product.sourceDirectory]
- cpp.defines: product.visibilityType === "static" ? ["QBS_STATIC_LIB"] : []
+ cpp.includePaths: [exportingProduct.sourceDirectory]
+ cpp.defines: exportingProduct.visibilityType === "static" ? ["QBS_STATIC_LIB"] : []
}
}
diff --git a/qbs-resources/imports/QbsStaticLibrary.qbs b/qbs-resources/imports/QbsStaticLibrary.qbs
index 299ca3948..6fa9fde31 100644
--- a/qbs-resources/imports/QbsStaticLibrary.qbs
+++ b/qbs-resources/imports/QbsStaticLibrary.qbs
@@ -4,6 +4,6 @@ QbsProduct {
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["core"] }
- cpp.includePaths: [product.sourceDirectory]
+ cpp.includePaths: [exportingProduct.sourceDirectory]
}
}
diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs
index 68a29bb95..da4c1bd8b 100644
--- a/share/qbs/module-providers/Qt/templates/android_support.qbs
+++ b/share/qbs/module-providers/Qt/templates/android_support.qbs
@@ -20,8 +20,8 @@ Module {
"androiddeployqt")
property string _qtBinaryDir
property string _qtInstallDir
- // TODO: Remove in 1.20
- // From 1.20 product property used from an export item will point to the
+ // TODO: Remove in 1.21
+ // From 1.21 product property used from an export item will point to the
// importingProduct property. So using the importingProduct property will be useless
// and the change will be reverted
property var _importingProduct: (typeof importingProduct !== "undefined") ? importingProduct :
diff --git a/src/lib/corelib/corelib.qbs b/src/lib/corelib/corelib.qbs
index 6a5b33f98..40a4bc44f 100644
--- a/src/lib/corelib/corelib.qbs
+++ b/src/lib/corelib/corelib.qbs
@@ -530,6 +530,6 @@ QbsLibrary {
}
Export {
Depends { name: "cpp" }
- cpp.defines: base.concat(product.projectFileUpdateDefines)
+ cpp.defines: base.concat(exportingProduct.projectFileUpdateDefines)
}
}
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index f65421a35..c66c5cb90 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -3470,10 +3470,11 @@ void ModuleLoader::instantiateModule(ProductContext *productContext, Item *expor
if (exportingProduct) {
const auto exportingProductItemValue = ItemValue::create(exportingProduct);
moduleScope->setProperty(QStringLiteral("exportingProduct"), exportingProductItemValue);
- moduleScope->setProperty(QStringLiteral("importingProduct"),
- ItemValue::create(productContext->item));
- // TODO: Remove in 1.20.
+ const auto importingProductItemValue = ItemValue::create(productContext->item);
+ moduleScope->setProperty(QStringLiteral("importingProduct"), importingProductItemValue);
+
+ // TODO: Remove in 1.21.
moduleScope->setProperty(StringConstants::productVar(), exportingProductItemValue);
moduleScope->setProperty(StringConstants::projectVar(),
diff --git a/src/lib/scriptengine/scriptengine.qbs b/src/lib/scriptengine/scriptengine.qbs
index 3225ceaac..c7061fa98 100644
--- a/src/lib/scriptengine/scriptengine.qbs
+++ b/src/lib/scriptengine/scriptengine.qbs
@@ -368,7 +368,7 @@ Project {
Export {
Depends { name: "QtScriptFwdHeaders" }
Depends { name: "cpp" }
- property stringList includePaths: [product.sourceDirectory + "/include"]
+ property stringList includePaths: [exportingProduct.sourceDirectory + "/include"]
.concat(QtScriptFwdHeaders.publicIncludePaths)
Properties {
condition: qbs.targetOS.contains("unix")
@@ -441,10 +441,10 @@ Project {
Export {
Depends { name: "Qt.core" }
property stringList publicIncludePaths: [
- FileInfo.joinPaths(product.buildDirectory, "include")
+ FileInfo.joinPaths(exportingProduct.buildDirectory, "include")
]
property stringList privateIncludePaths: [
- FileInfo.joinPaths(product.buildDirectory, "include",
+ FileInfo.joinPaths(exportingProduct.buildDirectory, "include",
"QtScript", Qt.core.version, "QtScript")
]
}
diff --git a/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs b/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs
index cc86a4402..2efe8d4e8 100644
--- a/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs
+++ b/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs
@@ -64,7 +64,7 @@ Project {
Export {
Depends { name: "cpp" }
- cpp.includePaths: [product.sourceDirectory]
+ cpp.includePaths: [exportingProduct.sourceDirectory]
}
}
}
diff --git a/tests/auto/api/testdata/link-static-lib/link-static-lib.qbs b/tests/auto/api/testdata/link-static-lib/link-static-lib.qbs
index 6960c7d17..829aa5f3e 100644
--- a/tests/auto/api/testdata/link-static-lib/link-static-lib.qbs
+++ b/tests/auto/api/testdata/link-static-lib/link-static-lib.qbs
@@ -25,7 +25,7 @@ Project {
Depends { name: "helper2" }
Export {
Depends { name: "cpp" }
- cpp.includePaths: [product.sourceDirectory + '/helper1']
+ cpp.includePaths: [exportingProduct.sourceDirectory + '/helper1']
}
}
@@ -38,7 +38,7 @@ Project {
Depends { name: "cpp" }
Export {
Depends { name: "cpp" }
- cpp.includePaths: [product.sourceDirectory + '/helper2']
+ cpp.includePaths: [exportingProduct.sourceDirectory + '/helper2']
}
}
}
diff --git a/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs b/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
index 07f61ba2c..7e1dbf5e3 100644
--- a/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
+++ b/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
@@ -12,8 +12,8 @@ Project {
Export {
Depends { name: "wix" }
wix.defines: base.concat(["msiName=" +
- FileInfo.joinPaths(product.buildDirectory,
- product.targetName + wix.windowsInstallerSuffix)])
+ FileInfo.joinPaths(exportingProduct.buildDirectory,
+ exportingProduct.targetName + wix.windowsInstallerSuffix)])
}
}
diff --git a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
index cf1fabf24..2d9afb134 100644
--- a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
+++ b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
@@ -40,7 +40,7 @@ Project {
Depends { name: "cpp" }
Export {
Depends { name: "cpp" }
- cpp.includePaths: [product.sourceDirectory + '/some helper']
+ cpp.includePaths: [exportingProduct.sourceDirectory + '/some helper']
}
}
}
diff --git a/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs b/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
index 0dc6fb2ea..b01a47a39 100644
--- a/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
@@ -32,7 +32,7 @@ Project {
Depends { name: "protobuf.cpp"; required: false }
cpp.cxxLanguageVersion: "c++11"
cpp.minimumMacosVersion: "10.8"
- cpp.includePaths: product.protobuf.cpp.outputDir
+ cpp.includePaths: exportingProduct.protobuf.cpp.outputDir
}
}