diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-05-16 14:24:29 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-05-20 13:54:01 +0200 |
commit | 67f05790924646fe3623976f7794e2e7c97e3c3a (patch) | |
tree | 2d751fa3ebbc98194250080b946035b4ae37d984 /share | |
parent | db6d4dbe277469b5b39413ca51b9067559566b28 (diff) |
use {input|output}.fileName where appropriate
Change-Id: I793210ba6eeeb3a15e78282e14b8e5ad6459c078
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/UnixUtils/unix-utils.js | 5 | ||||
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 20 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 10 | ||||
-rw-r--r-- | share/qbs/modules/cpp/windows-mingw.qbs | 3 | ||||
-rw-r--r-- | share/qbs/modules/cpp/windows-msvc.qbs | 4 | ||||
-rw-r--r-- | share/qbs/modules/ib/IBModule.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/nodejs/NodeJS.qbs | 2 | ||||
-rwxr-xr-x | share/qbs/modules/nsis/NSISModule.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/typescript/TypeScriptModule.qbs | 5 | ||||
-rw-r--r-- | share/qbs/modules/wix/WiXModule.qbs | 4 |
11 files changed, 28 insertions, 31 deletions
diff --git a/share/qbs/imports/qbs/UnixUtils/unix-utils.js b/share/qbs/imports/qbs/UnixUtils/unix-utils.js index d9491b53e..261d1bb5b 100644 --- a/share/qbs/imports/qbs/UnixUtils/unix-utils.js +++ b/share/qbs/imports/qbs/UnixUtils/unix-utils.js @@ -1,12 +1,9 @@ -var FileInfo = loadExtension("qbs.FileInfo"); - -function soname(product, outputFilePath) { +function soname(product, outputFileName) { function majorVersion(version, defaultValue) { var n = parseInt(version, 10); return isNaN(n) ? defaultValue : n; } - var outputFileName = FileInfo.fileName(outputFilePath); if (product.version) { var major = majorVersion(product.version); if (major) { diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index 590964c92..d20b69b35 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -112,7 +112,7 @@ CppModule { prepare: { // Actual linker command. - var libFilePath = outputs["dynamiclibrary"][0].filePath; + var lib = outputs["dynamiclibrary"][0]; var platformLinkerFlags = ModUtils.moduleProperties(product, 'platformLinkerFlags'); var linkerFlags = ModUtils.moduleProperties(product, 'linkerFlags'); var commands = []; @@ -123,13 +123,13 @@ CppModule { args = args.concat([ '-Wl,--hash-style=gnu', '-Wl,--as-needed', - '-Wl,-soname=' + UnixUtils.soname(product, libFilePath) + '-Wl,-soname=' + UnixUtils.soname(product, lib.fileName) ]); } else if (product.moduleProperty("qbs", "targetOS").contains('darwin')) { var installNamePrefix = product.moduleProperty("cpp", "installNamePrefix"); if (installNamePrefix !== undefined) args.push("-Wl,-install_name," - + installNamePrefix + FileInfo.fileName(libFilePath)); + + installNamePrefix + lib.fileName); args.push("-Wl,-headerpad_max_install_names"); } args = args.concat(platformLinkerFlags); @@ -146,11 +146,11 @@ CppModule { } args.push('-o'); - args.push(libFilePath); + args.push(lib.filePath); args = args.concat(Gcc.linkerFlags(product, inputs)); args = args.concat(Gcc.additionalCompilerAndLinkerFlags(product)); var cmd = new Command(ModUtils.moduleProperty(product, "linkerPath"), args); - cmd.description = 'linking ' + FileInfo.fileName(libFilePath); + cmd.description = 'linking ' + lib.fileName; cmd.highlight = 'linker'; cmd.responseFileUsagePrefix = '@'; commands.push(cmd); @@ -207,12 +207,12 @@ CppModule { var links = outputs["dynamiclibrary_symlink"]; var symlinkCount = links.length; for (var i = 0; i < symlinkCount; ++i) { - cmd = new Command("ln", ["-sf", FileInfo.fileName(libFilePath), + cmd = new Command("ln", ["-sf", lib.fileName, links[i].filePath]); cmd.highlight = "filegen"; cmd.description = "creating symbolic link '" - + FileInfo.fileName(links[i].filePath) + "'"; - cmd.workingDirectory = FileInfo.path(libFilePath); + + links[i].fileName + "'"; + cmd.workingDirectory = FileInfo.path(lib.filePath); commands.push(cmd); } } @@ -252,7 +252,7 @@ CppModule { for (var i in inputs.obj) args.push(inputs.obj[i].filePath); var cmd = new Command(ModUtils.moduleProperty(product, "archiverPath"), args); - cmd.description = 'creating ' + FileInfo.fileName(output.filePath); + cmd.description = 'creating ' + output.fileName; cmd.highlight = 'linker' cmd.responseFileUsagePrefix = '@'; return cmd; @@ -327,7 +327,7 @@ CppModule { args = args.concat(Gcc.linkerFlags(product, inputs)); args = args.concat(Gcc.additionalCompilerAndLinkerFlags(product)); var cmd = new Command(ModUtils.moduleProperty(product, "linkerPath"), args); - cmd.description = 'linking ' + FileInfo.fileName(output.filePath); + cmd.description = 'linking ' + output.fileName; cmd.highlight = 'linker' cmd.responseFileUsagePrefix = '@'; return cmd; diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 8f34c80c0..9045da4e6 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -300,7 +300,7 @@ function prepareCompiler(project, product, inputs, outputs, input, output) { } var cmd = new Command(compilerPath, args); - cmd.description = (pchOutput ? 'pre' : '') + 'compiling ' + FileInfo.fileName(input.filePath); + cmd.description = (pchOutput ? 'pre' : '') + 'compiling ' + input.fileName; if (pchOutput) cmd.description += ' (' + tag + ')'; cmd.highlight = "compiler"; diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 49e113c60..3eb805556 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -102,7 +102,7 @@ function prepareCompiler(product, input, outputs, platformDefines, defines, incl args = wrapperArgs.concat(args); } var cmd = new Command(compilerPath, args) - cmd.description = (pchOutput ? 'pre' : '') + 'compiling ' + FileInfo.fileName(input.filePath); + cmd.description = (pchOutput ? 'pre' : '') + 'compiling ' + input.fileName; if (pchOutput) cmd.description += ' (' + tag + ')'; cmd.highlight = "compiler"; @@ -111,7 +111,7 @@ function prepareCompiler(product, input, outputs, platformDefines, defines, incl // cl.exe outputs the cpp file name. We filter that out. cmd.stdoutFilterFunction = "function(output) {"; cmd.stdoutFilterFunction += "return output.replace(/" - + FileInfo.fileName(input.filePath) + "\\r\\n/g, '');"; + + input.fileName + "\\r\\n/g, '');"; cmd.stdoutFilterFunction += "}"; return cmd; } @@ -162,7 +162,7 @@ function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries, linkerOutputNativeFilePath = FileInfo.toWindowsSeparators( FileInfo.path(primaryOutput.filePath) + "/intermediate." - + FileInfo.fileName(primaryOutput.filePath)); + + primaryOutput.fileName); manifestFileName = linkerOutputNativeFilePath + ".manifest"; args.push('/MANIFEST', '/MANIFESTFILE:' + manifestFileName) } else { @@ -199,7 +199,7 @@ function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries, var commands = []; var cmd = new Command(product.moduleProperty("cpp", "linkerPath"), args) - cmd.description = 'linking ' + FileInfo.fileName(primaryOutput.filePath) + cmd.description = 'linking ' + primaryOutput.fileName; cmd.highlight = 'linker'; cmd.workingDirectory = FileInfo.path(primaryOutput.filePath) cmd.responseFileUsagePrefix = '@'; @@ -223,7 +223,7 @@ function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries, "/outputresource:" + outputNativeFilePath + ";#" + (linkDLL ? "2" : "1") ] cmd = new Command("mt.exe", args) - cmd.description = 'embedding manifest into ' + FileInfo.fileName(primaryOutput.filePath) + cmd.description = 'embedding manifest into ' + primaryOutput.fileName; cmd.highlight = 'linker'; cmd.workingDirectory = FileInfo.path(primaryOutput.filePath) commands.push(cmd); diff --git a/share/qbs/modules/cpp/windows-mingw.qbs b/share/qbs/modules/cpp/windows-mingw.qbs index a3e7680a5..ea66d61f4 100644 --- a/share/qbs/modules/cpp/windows-mingw.qbs +++ b/share/qbs/modules/cpp/windows-mingw.qbs @@ -1,5 +1,4 @@ import qbs 1.0 -import qbs.FileInfo import qbs.ModUtils import qbs.WindowsUtils @@ -70,7 +69,7 @@ GenericGCC { args = args.concat(['-i', input.filePath, '-o', output.filePath]); var cmd = new Command(ModUtils.moduleProperty(product, "windresPath"), args); - cmd.description = 'compiling ' + FileInfo.fileName(input.filePath); + cmd.description = 'compiling ' + input.fileName; cmd.highlight = 'compiler'; return cmd; } diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs index 96277066d..2af9065a6 100644 --- a/share/qbs/modules/cpp/windows-msvc.qbs +++ b/share/qbs/modules/cpp/windows-msvc.qbs @@ -183,7 +183,7 @@ CppModule { args.push(fileName) } var cmd = new Command("lib.exe", args); - cmd.description = 'creating ' + FileInfo.fileName(output.filePath) + cmd.description = 'creating ' + output.fileName; cmd.highlight = 'linker'; cmd.workingDirectory = FileInfo.path(output.filePath) cmd.responseFileUsagePrefix = '@'; @@ -230,7 +230,7 @@ CppModule { args = args.concat(['/fo', output.filePath, input.filePath]); var cmd = new Command('rc', args); - cmd.description = 'compiling ' + FileInfo.fileName(input.filePath); + cmd.description = 'compiling ' + input.fileName; cmd.highlight = 'compiler'; // Remove the first two lines of stdout. That's the logo. diff --git a/share/qbs/modules/ib/IBModule.qbs b/share/qbs/modules/ib/IBModule.qbs index b94e6bb57..c8037f243 100644 --- a/share/qbs/modules/ib/IBModule.qbs +++ b/share/qbs/modules/ib/IBModule.qbs @@ -126,7 +126,7 @@ Module { args.push(input.filePath); var cmd = new Command("ibtool", args); - cmd.description = 'ibtool ' + FileInfo.fileName(input.filePath); + cmd.description = 'ibtool ' + input.fileName; // Also display the language name of the XIB being compiled if it has one var localizationKey = DarwinTools.localizationKey(input.filePath); diff --git a/share/qbs/modules/nodejs/NodeJS.qbs b/share/qbs/modules/nodejs/NodeJS.qbs index 24a22d6de..a18d5d98b 100644 --- a/share/qbs/modules/nodejs/NodeJS.qbs +++ b/share/qbs/modules/nodejs/NodeJS.qbs @@ -46,7 +46,7 @@ Module { prepare: { var cmd = new JavaScriptCommand(); - cmd.description = "copying " + FileInfo.fileName(input.filePath); + cmd.description = "copying " + input.fileName; cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; diff --git a/share/qbs/modules/nsis/NSISModule.qbs b/share/qbs/modules/nsis/NSISModule.qbs index 7c9f2adbe..ad8b84238 100755 --- a/share/qbs/modules/nsis/NSISModule.qbs +++ b/share/qbs/modules/nsis/NSISModule.qbs @@ -193,7 +193,7 @@ Module { var inputFileNames = []; for (i in inputs.nsi) { - inputFileNames.push(FileInfo.fileName(inputs.nsi[i].filePath)); + inputFileNames.push(inputs.nsi[i].fileName); if (product.moduleProperty("qbs", "hostOS").contains("windows")) { args.push(FileInfo.toWindowsSeparators(inputs.nsi[i].filePath)); } else { diff --git a/share/qbs/modules/typescript/TypeScriptModule.qbs b/share/qbs/modules/typescript/TypeScriptModule.qbs index ad1395a04..8f80b7ce6 100644 --- a/share/qbs/modules/typescript/TypeScriptModule.qbs +++ b/share/qbs/modules/typescript/TypeScriptModule.qbs @@ -240,8 +240,9 @@ Module { cmd = new Command(ModUtils.moduleProperty(product, "compilerPath"), args); cmd.description = "compiling " + (ModUtils.moduleProperty(product, "singleFile") - ? FileInfo.fileName(primaryOutput.filePath) - : inputs.typescript.map(function(obj) { return FileInfo.fileName(obj.filePath) }).join(", ")); + ? primaryOutput.fileName + : inputs.typescript.map(function(obj) { + return obj.fileName; }).join(", ")); cmd.highlight = "compiler"; cmds.push(cmd); diff --git a/share/qbs/modules/wix/WiXModule.qbs b/share/qbs/modules/wix/WiXModule.qbs index 64df89767..39a56f5f8 100644 --- a/share/qbs/modules/wix/WiXModule.qbs +++ b/share/qbs/modules/wix/WiXModule.qbs @@ -280,7 +280,7 @@ Module { args.push(FileInfo.toWindowsSeparators(inputs.wxs[0].filePath)); var cmd = new Command(ModUtils.moduleProperty(product, "compilerPath"), args); - cmd.description = "compiling " + FileInfo.fileName(inputs.wxs[0].filePath); + cmd.description = "compiling " + inputs.wxs[0].fileName; cmd.highlight = "compiler"; cmd.workingDirectory = FileInfo.path(output.filePath); return cmd; @@ -377,7 +377,7 @@ Module { } var cmd = new Command(ModUtils.moduleProperty(product, "linkerPath"), args); - cmd.description = "linking " + FileInfo.fileName(primaryOutput.filePath); + cmd.description = "linking " + primaryOutput.fileName; cmd.highlight = "linker"; cmd.workingDirectory = FileInfo.path(primaryOutput.filePath); return cmd; |