qbs build: Remove code for creating deployment packages

Not a use case anymore, and if it were, we'd do it using built-in
capabilities.

Change-Id: I4c588ad7fb282530880210cb4c5795677074b1e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-02-15 17:13:33 +01:00
parent 185598f303
commit 7d4a632cb2
29 changed files with 3 additions and 236 deletions

View File

@@ -1,17 +0,0 @@
import qbs
import qbs.FileInfo
Product {
property string productName: project.name
property string baseDir: sourceDirectory
name: productName + " dev headers"
condition: qtc.make_dev_package
Depends { name: "qtc" }
Group {
prefix: baseDir + '/'
files: ["**/*.h"]
qbs.install: true
qbs.installDir: qtc.ide_include_path + '/' + FileInfo.fileName(product.sourceDirectory)
qbs.installSourceBase: baseDir
}
}

View File

@@ -3,7 +3,7 @@ import qbs.FileInfo
import QtcFunctions
QtcProduct {
type: ["dynamiclibrary", "dynamiclibrary_symlink", "qtc.dev-module"]
type: ["dynamiclibrary", "dynamiclibrary_symlink"]
installDir: qtc.ide_library_path
installTags: ["dynamiclibrary", "dynamiclibrary_symlink", "debuginfo_dll"]
useNonGuiPchFile: true

View File

@@ -3,7 +3,7 @@ import qbs.FileInfo
import QtcFunctions
QtcProduct {
type: ["dynamiclibrary", "pluginSpec", "qtc.dev-module"]
type: ["dynamiclibrary", "pluginSpec"]
installDir: qtc.ide_plugin_path
installTags: ["dynamiclibrary", "debuginfo_dll"]
useGuiPchFile: true

View File

@@ -88,12 +88,6 @@ Product {
qbs.installSourceBase: installSourceBase
}
Group {
fileTagsFilter: ["qtc.dev-module"]
qbs.install: true
qbs.installDir: qtc.ide_qbs_modules_path + '/' + product.name
}
Group {
name: "standard pch file (non-gui)"
condition: useNonGuiPchFile

View File

@@ -1,84 +0,0 @@
var File = require("qbs.File");
var FileInfo = require("qbs.FileInfo");
var TextFile = require("qbs.TextFile");
function getExportBlock(productFile)
{
var exportBlock = "";
var exportIndex = -1;
while (!productFile.atEof()) {
var line = productFile.readLine();
if (exportIndex === -1) {
exportIndex = line.indexOf("Export {");
continue;
}
if (line.indexOf('}') === exportIndex)
break;
exportBlock += " " + line.trim() + '\n';
}
return exportBlock;
}
function insertOrAddToProperty(product, content, propertyName, value)
{
var valueAsList = '[' + value + ']';
var propertyNameIndex = content.indexOf(propertyName + ':');
if (propertyNameIndex !== -1) {
var endListIndex = content.indexOf(']', propertyNameIndex);
if (endListIndex === -1)
throw "Failed to parse Export item of product '" + product.name + "'";
var contentStart = content.slice(0, endListIndex + 1);
var contentEnd = content.slice(endListIndex + 1);
return contentStart + ".concat(" + valueAsList + ')' + contentEnd;
}
return content + '\n' + propertyName + ": " + valueAsList;
}
function transformedExportBlock(product, input, output)
{
var productFilePath = FileInfo.joinPaths(product.sourceDirectory, product.fileName);
var productFile = new TextFile(productFilePath, TextFile.ReadOnly);
try {
var exportBlock = getExportBlock(productFile);
exportBlock = " Depends { name: 'cpp' }\n" + exportBlock;
var modulePath = FileInfo.joinPaths("/",
product.moduleProperty("qtc", "ide_qbs_modules_path"), product.name);
var includePath = FileInfo.joinPaths("/",
product.moduleProperty("qtc", "ide_include_path"));
var relPathToIncludes = FileInfo.relativePath(modulePath, includePath);
var absPathToIncludes = "path + '/" + relPathToIncludes + "'";
exportBlock = exportBlock.replace(/product.sourceDirectory/g, absPathToIncludes + " + '/"
+ FileInfo.fileName(product.sourceDirectory) + "'");
var dataPath = FileInfo.joinPaths("/", product.moduleProperty("qtc", "ide_data_path"));
var relPathToData = FileInfo.relativePath(modulePath, dataPath);
exportBlock = exportBlock.replace(/qtc.export_data_base/g, "path + '/"
+ relPathToData + "'");
exportBlock = insertOrAddToProperty(product, exportBlock, "cpp.includePaths",
absPathToIncludes);
if (input.fileTags.contains("dynamiclibrary") || input.fileTags.contains("staticlibrary")) {
var libInstallPath = FileInfo.joinPaths("/", input.moduleProperty("qbs", "installDir"));
var relPathToLibrary = FileInfo.relativePath(modulePath, libInstallPath);
var fullPathToLibrary = "path + '/" + relPathToLibrary + "/" + input.fileName + "'";
var libType = input.fileTags.contains("dynamiclibrary") ? "dynamic" : "static";
exportBlock = insertOrAddToProperty(product, exportBlock, "cpp." + libType
+ "Libraries", fullPathToLibrary);
}
return exportBlock;
} finally {
productFile.close();
}
}
function writeModuleFile(output, content)
{
var moduleFile = new TextFile(output.filePath, TextFile.WriteOnly);
try {
moduleFile.writeLine("import qbs");
moduleFile.writeLine("");
moduleFile.writeLine("Module {")
moduleFile.writeLine(content);
moduleFile.writeLine("}");
} finally {
moduleFile.close();
}
}

View File

@@ -1,7 +1,6 @@
import qbs
import qbs.Environment
import qbs.FileInfo
import "qtc.js" as HelperFunctions
Module {
property string qtcreator_display_version: '4.15.0-beta1'
@@ -91,27 +90,4 @@ Module {
"QT_USE_QSTRINGBUILDER",
].concat(testsEnabled ? ["WITH_TESTS"] : [])
.concat(qbs.toolchain.contains("msvc") ? ["_CRT_SECURE_NO_WARNINGS"] : [])
Rule {
condition: make_dev_package
inputs: product.type.filter(function f(t) {
return t === "dynamiclibrary" || t === "staticlibrary" || t === "qtc.dev-headers";
})
explicitlyDependsOn: ["qbs"]
Artifact {
filePath: product.name + "-module.qbs"
fileTags: ["qtc.dev-module"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Creating " + output.fileName;
cmd.sourceCode = function() {
var transformedExportBlock = HelperFunctions.transformedExportBlock(product, input,
output);
HelperFunctions.writeModuleFile(output, transformedExportBlock);
};
return [cmd];
}
}
}

View File

@@ -4,32 +4,6 @@ import qbs.FileInfo
import qbs.Environment
Project {
QtcDevHeaders {
productName: "syntax-highlighting (3rd party)"
baseDir: sourceDirectory + "/src/lib"
}
QtcDevHeaders {
productName: "syntax-highlighting autogenerated (3rd party)"
baseDir: sourceDirectory + "/autogenerated/src/lib"
Group {
prefix: baseDir + '/'
files: [
"AbstractHighlighter",
"Definition",
"DefinitionDownloader",
"FoldingRegion",
"Format",
"Repository",
"State",
"SyntaxHighlighter",
"Theme"
]
qbs.install: true
qbs.installDir: qtc.ide_include_path + '/' + FileInfo.fileName(product.sourceDirectory)
qbs.installSourceBase: baseDir
}
}
QtcLibrary {
name: "KSyntaxHighlighting"

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "Aggregation"
QtcDevHeaders { }
QtcLibrary {
Depends { name: "Qt.core" }
cpp.defines: base.concat("AGGREGATION_LIBRARY")

View File

@@ -3,12 +3,6 @@ import qbs 1.0
Project {
name: "CPlusPlus"
QtcDevHeaders { }
QtcDevHeaders {
productName: "cplusplus (3rd party)"
baseDir: sourceDirectory + "/../3rdparty/cplusplus"
}
QtcLibrary {
cpp.includePaths: base.concat("../3rdparty")
cpp.defines: base.concat([

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "ExtensionSystem"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat([
"EXTENSIONSYSTEM_LIBRARY",

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "LanguageServerProtocol"
QtcDevHeaders { }
QtcLibrary {
Depends { name: "Utils" }
cpp.defines: base.concat("LANGUAGESERVERPROTOCOL_LIBRARY")

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "LanguageUtils"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat(["LANGUAGEUTILS_LIBRARY"])
cpp.optimization: "fast"

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "QmlDebug"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat("QMLDEBUG_LIBRARY")

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "QmlJS"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat(["QMLJS_LIBRARY"])
cpp.optimization: "fast"

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "QtcSsh"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat("QTCSSH_LIBRARY")
cpp.enableExceptions: true

View File

@@ -5,8 +5,6 @@ import QtcLibrary
Project {
name: "Tracing"
QtcDevHeaders { }
QtcLibrary {
Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] }
Depends { name: "Qt.testlib"; condition: project.withAutotests }

View File

@@ -4,8 +4,6 @@ import qbs.FileInfo
Project {
name: "Utils"
QtcDevHeaders { }
QtcLibrary {
cpp.defines: base.concat([

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "Android"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
Depends { name: "Core" }

View File

@@ -5,8 +5,6 @@ import qbs.Utilities
Project {
name: "Core"
QtcDevHeaders { }
QtcPlugin {
Depends {
name: "Qt"

View File

@@ -4,8 +4,6 @@ import qbs.FileInfo
Project {
name: "CppTools"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt.widgets" }
Depends { name: "Qt.testlib"; condition: project.withAutotests }

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "Debugger"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "network"] }
Depends { name: "Aggregation" }

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "ProjectExplorer"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "qml"] }
Depends { name: "Aggregation" }

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "QmakeProjectManager"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "network"] }
Depends { name: "QmlJS" }

View File

@@ -4,8 +4,6 @@ import qbs.FileInfo
Project {
name: "QmlDesigner"
QtcDevHeaders { }
QtcPlugin {
fileName: FileInfo.fileName(filePath)

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "QtSupport"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "xml"]; }
Depends { name: "Utils" }

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "RemoteLinux"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt.widgets" }
Depends { name: "QtcSsh" }

View File

@@ -3,8 +3,6 @@ import qbs 1.0
Project {
name: "ResourceEditor"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "xml"] }
Depends { name: "Aggregation" }

View File

@@ -5,8 +5,6 @@ import qbs.Environment
Project {
name: "TextEditor"
QtcDevHeaders { }
QtcPlugin {
Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "printsupport"] }
Depends { name: "Aggregation" }

View File

@@ -1,38 +1,8 @@
import qbs
QtcDevHeaders {
Product {
name: "ProParser"
condition: true
type: ["qtc.dev-headers", "qtc.dev-module"]
productName: name
property string fileName: "proparser.qbs"
Group {
fileTagsFilter: ["qtc.dev-module"]
qbs.install: true
qbs.installDir: qtc.ide_qbs_modules_path + '/' + product.name
}
// TODO: Remove when qbs 1.6 is out.
FileTagger {
patterns: ["*.h"]
fileTags: ["qtc.dev-headers-input"]
}
Rule {
inputs: ["qtc.dev-headers-input"]
multiplex: true
Artifact {
filePath: "dummy"
fileTags: ["qtc.dev-headers"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.silent = true;
cmd.sourceCode = function() { };
return [cmd];
}
}
Export {
Depends { name: "cpp" }