2012-02-09 14:30:09 +01:00
|
|
|
import qbs.base 1.0
|
2013-03-07 18:21:55 +01:00
|
|
|
import qbs.fileinfo as FileInfo
|
2012-09-05 11:01:43 +02:00
|
|
|
import "qbs/defaults.js" as Defaults
|
2012-02-09 14:30:09 +01:00
|
|
|
|
|
|
|
|
Project {
|
2013-04-19 16:20:22 +02:00
|
|
|
|
2012-02-09 14:30:09 +01:00
|
|
|
property string ide_version_major: '2'
|
2013-02-05 13:57:14 +01:00
|
|
|
property string ide_version_minor: '7'
|
2013-05-29 10:27:35 +02:00
|
|
|
property string ide_version_release: '82'
|
2012-02-09 14:30:09 +01:00
|
|
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
2013-04-19 16:20:22 +02:00
|
|
|
property string ide_app_path: qbs.targetOS == "mac" ? "" : "bin"
|
|
|
|
|
property string ide_app_target: qbs.targetOS == "mac" ? "Qt Creator" : "qtcreator"
|
|
|
|
|
property string ide_library_path: {
|
|
|
|
|
if (qbs.targetOS == "mac")
|
|
|
|
|
return ide_app_target + ".app/Contents/PlugIns"
|
|
|
|
|
else if (qbs.targetOS == "windows")
|
|
|
|
|
return ide_app_path
|
|
|
|
|
else
|
|
|
|
|
return "lib/qtcreator"
|
|
|
|
|
}
|
|
|
|
|
property string ide_plugin_path: {
|
|
|
|
|
if (qbs.targetOS == "mac")
|
|
|
|
|
return ide_library_path
|
|
|
|
|
else if (qbs.targetOS == "windows")
|
|
|
|
|
return "lib/qtcreator/plugins"
|
|
|
|
|
else
|
|
|
|
|
return ide_library_path + "/plugins"
|
|
|
|
|
}
|
|
|
|
|
property string ide_data_path: qbs.targetOS == "mac" ? ide_app_target + ".app/Contents/Resources"
|
|
|
|
|
: "share/qtcreator"
|
|
|
|
|
property string ide_libexec_path: qbs.targetOS == "mac" ? ide_data_path
|
|
|
|
|
: ide_app_path
|
|
|
|
|
property string ide_doc_path: qbs.targetOS == "mac" ? ide_data_path + "/doc"
|
|
|
|
|
: "share/doc/qtcreator"
|
|
|
|
|
property string ide_bin_path: qbs.targetOS == "mac" ? ide_app_target + ".app/Contents/MacOS"
|
|
|
|
|
: ide_app_path
|
2012-02-09 14:30:09 +01:00
|
|
|
moduleSearchPaths: "qbs"
|
|
|
|
|
|
|
|
|
|
references: [
|
|
|
|
|
"lib/qtcreator/qtcomponents/qtcomponents.qbs",
|
|
|
|
|
"share/share.qbs",
|
2012-09-24 12:02:35 +02:00
|
|
|
"share/qtcreator/translations/translations.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/libs/aggregation/aggregation.qbs",
|
|
|
|
|
"src/libs/cplusplus/cplusplus.qbs",
|
|
|
|
|
"src/libs/extensionsystem/extensionsystem.qbs",
|
|
|
|
|
"src/libs/glsl/glsl.qbs",
|
|
|
|
|
"src/libs/languageutils/languageutils.qbs",
|
|
|
|
|
"src/libs/qmleditorwidgets/qmleditorwidgets.qbs",
|
|
|
|
|
"src/libs/qmljs/qmljs.qbs",
|
2012-04-18 12:06:10 +02:00
|
|
|
"src/libs/qmldebug/qmldebug.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/libs/qtcomponents/styleitem/styleitem.qbs",
|
2012-05-18 10:49:35 +02:00
|
|
|
"src/libs/ssh/ssh.qbs",
|
2012-05-23 23:01:59 +03:00
|
|
|
"src/libs/utils/process_stub.qbs",
|
|
|
|
|
"src/libs/utils/process_ctrlc_stub.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/libs/utils/utils.qbs",
|
2012-02-27 13:56:40 +01:00
|
|
|
"src/libs/zeroconf/zeroconf.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/analyzerbase/analyzerbase.qbs",
|
2012-04-25 11:57:06 +02:00
|
|
|
"src/plugins/android/android.qbs",
|
2012-06-10 14:34:39 +03:00
|
|
|
"src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/bazaar/bazaar.qbs",
|
|
|
|
|
"src/plugins/bineditor/bineditor.qbs",
|
|
|
|
|
"src/plugins/bookmarks/bookmarks.qbs",
|
|
|
|
|
"src/plugins/classview/classview.qbs",
|
2011-06-05 17:58:02 +03:00
|
|
|
"src/plugins/clearcase/clearcase.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs",
|
|
|
|
|
"src/plugins/coreplugin/coreplugin.qbs",
|
2012-07-08 17:47:52 +08:00
|
|
|
"src/plugins/coreplugin/images/logo/logo.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/cpaster/cpaster.qbs",
|
|
|
|
|
"src/plugins/cppeditor/cppeditor.qbs",
|
|
|
|
|
"src/plugins/cpptools/cpptools.qbs",
|
|
|
|
|
"src/plugins/cvs/cvs.qbs",
|
|
|
|
|
"src/plugins/debugger/debugger.qbs",
|
2012-09-26 22:33:43 +02:00
|
|
|
"src/plugins/debugger/ptracepreload.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/designer/designer.qbs",
|
2013-02-15 12:49:50 +01:00
|
|
|
"src/plugins/diffeditor/diffeditor.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/fakevim/fakevim.qbs",
|
|
|
|
|
"src/plugins/find/find.qbs",
|
|
|
|
|
"src/plugins/genericprojectmanager/genericprojectmanager.qbs",
|
|
|
|
|
"src/plugins/git/git.qbs",
|
|
|
|
|
"src/plugins/glsleditor/glsleditor.qbs",
|
|
|
|
|
"src/plugins/helloworld/helloworld.qbs",
|
|
|
|
|
"src/plugins/help/help.qbs",
|
|
|
|
|
"src/plugins/imageviewer/imageviewer.qbs",
|
|
|
|
|
"src/plugins/locator/locator.qbs",
|
|
|
|
|
"src/plugins/macros/macros.qbs",
|
|
|
|
|
"src/plugins/madde/madde.qbs",
|
|
|
|
|
"src/plugins/mercurial/mercurial.qbs",
|
|
|
|
|
"src/plugins/perforce/perforce.qbs",
|
|
|
|
|
"src/plugins/projectexplorer/projectexplorer.qbs",
|
2013-01-30 18:19:31 +01:00
|
|
|
"src/plugins/qbsprojectmanager/qbsprojectmanager.qbs",
|
2013-01-14 23:11:10 +04:00
|
|
|
"src/plugins/pythoneditor/pythoneditor.qbs",
|
2012-09-18 16:40:13 +02:00
|
|
|
// "src/plugins/qmldesigner/qmldesigner.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/qmljseditor/qmljseditor.qbs",
|
|
|
|
|
"src/plugins/qmljstools/qmljstools.qbs",
|
|
|
|
|
"src/plugins/qmlprofiler/qmlprofiler.qbs",
|
|
|
|
|
"src/plugins/qmlprojectmanager/qmlprojectmanager.qbs",
|
2012-09-05 20:35:13 +03:00
|
|
|
"src/plugins/qnx/qnx.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/qt4projectmanager/qt4projectmanager.qbs",
|
|
|
|
|
"src/plugins/qtsupport/qtsupport.qbs",
|
|
|
|
|
"src/plugins/remotelinux/remotelinux.qbs",
|
|
|
|
|
"src/plugins/resourceeditor/resourceeditor.qbs",
|
|
|
|
|
"src/plugins/subversion/subversion.qbs",
|
|
|
|
|
"src/plugins/tasklist/tasklist.qbs",
|
|
|
|
|
"src/plugins/texteditor/texteditor.qbs",
|
2012-02-26 19:44:11 +02:00
|
|
|
"src/plugins/todo/todo.qbs",
|
2012-09-26 20:02:42 +02:00
|
|
|
"src/plugins/updateinfo/updateinfo.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/plugins/valgrind/valgrind.qbs",
|
|
|
|
|
"src/plugins/vcsbase/vcsbase.qbs",
|
|
|
|
|
"src/plugins/welcome/welcome.qbs",
|
2012-06-10 13:47:52 +03:00
|
|
|
"src/tools/qtcdebugger/qtcdebugger.qbs",
|
2012-07-04 14:16:26 +02:00
|
|
|
"src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs",
|
2012-09-03 14:48:17 +02:00
|
|
|
"src/tools/qtpromaker/qtpromaker.qbs",
|
2012-09-26 10:01:04 +02:00
|
|
|
"src/plugins/cpaster/frontend/frontend.qbs",
|
2012-09-18 15:58:07 +02:00
|
|
|
"src/tools/sdktool/sdktool.qbs"
|
2012-02-09 14:30:09 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
Product {
|
|
|
|
|
name: "app_version_header"
|
|
|
|
|
type: "hpp"
|
|
|
|
|
files: "src/app/app_version.h.in"
|
|
|
|
|
property string ide_version_major: project.ide_version_major
|
|
|
|
|
property string ide_version_minor: project.ide_version_minor
|
|
|
|
|
property string ide_version_release: project.ide_version_release
|
|
|
|
|
property string qtcreator_version: project.qtcreator_version
|
|
|
|
|
|
|
|
|
|
Transformer {
|
|
|
|
|
inputs: ["src/app/app_version.h.in"]
|
|
|
|
|
Artifact {
|
|
|
|
|
fileName: "app/app_version.h"
|
|
|
|
|
fileTags: "hpp"
|
|
|
|
|
}
|
|
|
|
|
prepare: {
|
|
|
|
|
var cmd = new JavaScriptCommand();
|
|
|
|
|
cmd.description = "generating app_version.h";
|
|
|
|
|
cmd.highlight = "codegen";
|
|
|
|
|
cmd.qtcreator_version = product.qtcreator_version;
|
|
|
|
|
cmd.ide_version_major = product.ide_version_major;
|
|
|
|
|
cmd.ide_version_minor = product.ide_version_minor;
|
|
|
|
|
cmd.ide_version_release = product.ide_version_release;
|
2013-02-20 17:05:32 +01:00
|
|
|
cmd.onWindows = (product.moduleProperty("qbs", "targetOS") === "windows");
|
2012-02-09 14:30:09 +01:00
|
|
|
cmd.sourceCode = function() {
|
|
|
|
|
var file = new TextFile(input.fileName);
|
|
|
|
|
var content = file.readAll();
|
|
|
|
|
// replace quoted quotes
|
2012-06-19 15:36:27 +08:00
|
|
|
content = content.replace(/\\\"/g, '"');
|
2012-02-09 14:30:09 +01:00
|
|
|
// replace Windows line endings
|
|
|
|
|
if (onWindows)
|
|
|
|
|
content = content.replace(/\r\n/g, "\n");
|
|
|
|
|
// replace the magic qmake incantations
|
|
|
|
|
content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 " + qtcreator_version + "\n");
|
|
|
|
|
content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " + ide_version_major + "\n")
|
|
|
|
|
content = content.replace(/(\n#define IDE_VERSION_MINOR) .+\n/, "$1 " + ide_version_minor + "\n")
|
|
|
|
|
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 " + ide_version_release + "\n")
|
|
|
|
|
file = new TextFile(output.fileName, TextFile.WriteOnly);
|
|
|
|
|
file.truncate();
|
|
|
|
|
file.write(content);
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
return cmd;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-09-30 07:26:39 +02:00
|
|
|
|
2013-05-24 15:58:33 +02:00
|
|
|
Export {
|
2012-09-30 07:26:39 +02:00
|
|
|
Depends { name: "cpp" }
|
|
|
|
|
cpp.includePaths: product.buildDirectory
|
|
|
|
|
}
|
2012-02-09 14:30:09 +01:00
|
|
|
}
|
|
|
|
|
|
2013-01-16 11:27:26 +01:00
|
|
|
Application {
|
2013-04-19 16:20:22 +02:00
|
|
|
name: project.ide_app_target
|
2012-04-23 20:26:46 +03:00
|
|
|
consoleApplication: qbs.debugInformation
|
2012-02-09 14:30:09 +01:00
|
|
|
|
2013-04-23 15:41:52 +02:00
|
|
|
cpp.rpaths: qbs.targetOS == "mac" ? ["@executable_path/.."]
|
|
|
|
|
: ["$ORIGIN/../lib/qtcreator"]
|
2012-09-05 11:01:43 +02:00
|
|
|
cpp.defines: Defaults.defines(qbs)
|
2012-08-04 15:27:43 +08:00
|
|
|
cpp.linkerFlags: {
|
|
|
|
|
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw"))
|
|
|
|
|
return ["-Wl,-s"]
|
|
|
|
|
}
|
2012-02-09 14:30:09 +01:00
|
|
|
cpp.includePaths: [
|
|
|
|
|
"src",
|
|
|
|
|
"src/libs",
|
|
|
|
|
"src/shared/qtsingleapplication",
|
|
|
|
|
"src/shared/qtlockedfile",
|
|
|
|
|
buildDirectory
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
Depends { name: "app_version_header" }
|
|
|
|
|
Depends { name: "cpp" }
|
2012-04-10 15:56:23 +02:00
|
|
|
Depends { name: "Qt"; submodules: ["widgets", "network"] }
|
2012-04-01 19:21:05 +03:00
|
|
|
Depends { name: "Utils" }
|
|
|
|
|
Depends { name: "ExtensionSystem" }
|
2012-02-09 14:30:09 +01:00
|
|
|
|
|
|
|
|
files: [
|
|
|
|
|
"src/app/main.cpp",
|
2012-06-24 14:57:41 +03:00
|
|
|
"src/app/qtcreator.rc",
|
2012-02-09 14:30:09 +01:00
|
|
|
"src/shared/qtsingleapplication/qtsingleapplication.h",
|
|
|
|
|
"src/shared/qtsingleapplication/qtsingleapplication.cpp",
|
|
|
|
|
"src/shared/qtsingleapplication/qtlocalpeer.h",
|
|
|
|
|
"src/shared/qtsingleapplication/qtlocalpeer.cpp",
|
2012-09-24 09:56:31 +02:00
|
|
|
"src/shared/qtlockedfile/qtlockedfile.cpp",
|
|
|
|
|
"src/tools/qtcreatorcrashhandler/crashhandlersetup.cpp",
|
|
|
|
|
"src/tools/qtcreatorcrashhandler/crashhandlersetup.h"
|
2012-02-09 14:30:09 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
Group {
|
2013-04-19 16:20:22 +02:00
|
|
|
condition: qbs.targetPlatform.indexOf("unix") != -1 && qbs.targetOS != "mac"
|
2012-02-09 14:30:09 +01:00
|
|
|
files: "bin/qtcreator.sh"
|
2013-01-16 11:27:26 +01:00
|
|
|
qbs.install: true
|
2012-03-30 16:01:03 +02:00
|
|
|
qbs.installDir: "bin"
|
2012-02-09 14:30:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
2013-02-08 17:18:15 +01:00
|
|
|
condition: qbs.targetPlatform.indexOf("unix") != -1
|
2012-02-09 14:30:09 +01:00
|
|
|
files: [
|
|
|
|
|
"src/shared/qtlockedfile/qtlockedfile_unix.cpp"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
condition: qbs.targetOS == "windows"
|
|
|
|
|
files: [
|
|
|
|
|
"src/shared/qtlockedfile/qtlockedfile_win.cpp"
|
|
|
|
|
]
|
|
|
|
|
}
|
2013-01-16 11:27:26 +01:00
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
fileTagsFilter: product.type
|
|
|
|
|
qbs.install: true
|
2013-04-19 16:20:22 +02:00
|
|
|
qbs.installDir: project.ide_app_path
|
2013-01-16 11:27:26 +01:00
|
|
|
}
|
2012-02-09 14:30:09 +01:00
|
|
|
}
|
|
|
|
|
}
|