forked from qt-creator/qt-creator
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:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "Aggregation"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
Depends { name: "Qt.core" }
|
||||
cpp.defines: base.concat("AGGREGATION_LIBRARY")
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "ExtensionSystem"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
cpp.defines: base.concat([
|
||||
"EXTENSIONSYSTEM_LIBRARY",
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "LanguageServerProtocol"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
Depends { name: "Utils" }
|
||||
cpp.defines: base.concat("LANGUAGESERVERPROTOCOL_LIBRARY")
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "LanguageUtils"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
cpp.defines: base.concat(["LANGUAGEUTILS_LIBRARY"])
|
||||
cpp.optimization: "fast"
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "QmlDebug"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
cpp.defines: base.concat("QMLDEBUG_LIBRARY")
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "QmlJS"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
cpp.defines: base.concat(["QMLJS_LIBRARY"])
|
||||
cpp.optimization: "fast"
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "QtcSsh"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
cpp.defines: base.concat("QTCSSH_LIBRARY")
|
||||
cpp.enableExceptions: true
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -4,8 +4,6 @@ import qbs.FileInfo
|
||||
Project {
|
||||
name: "Utils"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcLibrary {
|
||||
|
||||
cpp.defines: base.concat([
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "Android"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
|
||||
Depends { name: "Core" }
|
||||
|
||||
@@ -5,8 +5,6 @@ import qbs.Utilities
|
||||
Project {
|
||||
name: "Core"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends {
|
||||
name: "Qt"
|
||||
|
||||
@@ -4,8 +4,6 @@ import qbs.FileInfo
|
||||
Project {
|
||||
name: "CppTools"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "Qt.testlib"; condition: project.withAutotests }
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "Debugger"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "network"] }
|
||||
Depends { name: "Aggregation" }
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "ProjectExplorer"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "qml"] }
|
||||
Depends { name: "Aggregation" }
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "QmakeProjectManager"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "network"] }
|
||||
Depends { name: "QmlJS" }
|
||||
|
||||
@@ -4,8 +4,6 @@ import qbs.FileInfo
|
||||
Project {
|
||||
name: "QmlDesigner"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
fileName: FileInfo.fileName(filePath)
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "QtSupport"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml"]; }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "RemoteLinux"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "QtcSsh" }
|
||||
|
||||
@@ -3,8 +3,6 @@ import qbs 1.0
|
||||
Project {
|
||||
name: "ResourceEditor"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml"] }
|
||||
Depends { name: "Aggregation" }
|
||||
|
||||
@@ -5,8 +5,6 @@ import qbs.Environment
|
||||
Project {
|
||||
name: "TextEditor"
|
||||
|
||||
QtcDevHeaders { }
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "printsupport"] }
|
||||
Depends { name: "Aggregation" }
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user