From eac4bba41ed9e68dee9a019e0fedc51d220ef112 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 25 Feb 2014 15:39:22 +0100 Subject: use filePath instead of fileName where applicable This fixes the recently introduced deprecation warnings. Task-number: QBS-258 Change-Id: I10660270895ec89a1444d596922c22e9658ca3ab Reviewed-by: Christian Kandeler --- tests/auto/blackbox/testdata/codegen/codegen.qbs | 4 ++-- .../testdata/dependenciesProperty/dependenciesProperty.qbs | 4 ++-- .../dynamicRuleOutputs/before/flexoptionsreader.js | 2 +- .../testdata/dynamicRuleOutputs/before/genlexer.qbs | 10 +++++----- .../auto/blackbox/testdata/explicitlyDependsOn/project.qbs | 2 +- tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs | 6 +++--- tests/auto/blackbox/testdata/productproperties/header.qbs | 2 +- .../testdata/propertyChanges/modules/TestModule/module.qbs | 2 +- tests/auto/blackbox/testdata/propertyChanges/project.qbs | 4 ++-- tests/auto/blackbox/testdata/qt5plugin/plugin.qbs | 4 ++-- .../testdata/ruleConditions/modules/narfzort/narfzort.qbs | 4 ++-- .../auto/blackbox/testdata/trackFileTags/after/project.qbs | 4 ++-- .../blackbox/testdata/trackFileTags/before/project.qbs | 4 ++-- tests/auto/blackbox/testdata/transformers/transformers.qbs | 14 +++++++------- 14 files changed, 33 insertions(+), 33 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/blackbox/testdata/codegen/codegen.qbs b/tests/auto/blackbox/testdata/codegen/codegen.qbs index bb71a5540..1a05ad4f0 100644 --- a/tests/auto/blackbox/testdata/codegen/codegen.qbs +++ b/tests/auto/blackbox/testdata/codegen/codegen.qbs @@ -54,7 +54,7 @@ Project { var code = '$NUMBERTYPE $FUNCTIONNAME($NUMBERTYPE, $STRINGTYPE) { return 0; }'; code = expandMacros(code, product.replacements); - var args = ['echo ' + code + '>' + output.fileName] + var args = ['echo ' + code + '>' + output.filePath] var cmd if (product.moduleProperty("qbs", "hostOS").contains('windows')) { cmd = new Command('cmd.exe', ['/C'].concat(args)); @@ -64,7 +64,7 @@ Project { args[0] = args[0].replace(/;/g, '\\;') cmd = new Command('/bin/sh', ['-c'].concat(args)) } - cmd.description = 'generate\t' + FileInfo.fileName(output.fileName); + cmd.description = 'generate\t' + FileInfo.fileName(output.filePath); cmd.highlight = 'codegen'; return cmd; } diff --git a/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs b/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs index 052829c1b..a5ff12eb2 100644 --- a/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs +++ b/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs @@ -14,11 +14,11 @@ Project { } prepare: { var cmd = new JavaScriptCommand(); - cmd.description = 'generate ' + FileInfo.fileName(output.fileName); + cmd.description = 'generate ' + FileInfo.fileName(output.filePath); cmd.highlight = 'codegen'; cmd.content = JSON.stringify(product.dependencies); cmd.sourceCode = function() { - file = new TextFile(output.fileName, TextFile.WriteOnly); + file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(content); file.close(); diff --git a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/flexoptionsreader.js b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/flexoptionsreader.js index 232e8338f..f7577c773 100644 --- a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/flexoptionsreader.js +++ b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/flexoptionsreader.js @@ -82,7 +82,7 @@ function readFlexOptions(filePath) } } - var tf = new TextFile(input.fileName); + var tf = new TextFile(input.filePath); var line; var optrex = /^%option\s+(.*$)/; var res; diff --git a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs index b822e852e..bb1bcb03f 100644 --- a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs +++ b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs @@ -55,7 +55,7 @@ Project { inputs: ["flex"] outputFileTags: ["c", "hpp"] outputArtifacts: { - var options = FlexOptionsReader.readFlexOptions(input.fileName); + var options = FlexOptionsReader.readFlexOptions(input.filePath); var sourceFileName = options["outfile"] || "lex.yy.c"; var headerFileName = options["header-file"]; var result = [{ @@ -74,13 +74,13 @@ Project { var cmd; if (product.isFlexAvailable) { // flex is available. Let's call it. - cmd = new Command("flex", [input.fileName]); + cmd = new Command("flex", [input.filePath]); cmd.workingDirectory = product.buildDirectory + "/GeneratedFiles/" + product.name; } else { // No flex available here, generate some C source and header. cmd = new JavaScriptCommand(); - cmd.sourceFileName = outputs["c"][0].fileName; - cmd.headerFileName = outputs["hpp"] ? outputs["hpp"][0].fileName : ""; + cmd.sourceFileName = outputs["c"][0].filePath; + cmd.headerFileName = outputs["hpp"] ? outputs["hpp"][0].filePath : ""; cmd.sourceCode = function() { var fsrc = new TextFile(sourceFileName, TextFile.WriteOnly); if (headerFileName) { @@ -94,7 +94,7 @@ Project { fsrc.close(); }; } - cmd.description = "flexing " + FileInfo.fileName(input.fileName); + cmd.description = "flexing " + FileInfo.fileName(input.filePath); return cmd; } } diff --git a/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs b/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs index 12ae1bd7e..57172a442 100644 --- a/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs +++ b/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs @@ -19,7 +19,7 @@ Product { cmd.description = "Creating output artifact"; cmd.highlight = "codegen"; cmd.sourceCode = function() { - var file = new TextFile(output.fileName, TextFile.WriteOnly); + var file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.close(); } diff --git a/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs index 2bc02e23c..c9d64c8bb 100644 --- a/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs +++ b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs @@ -26,15 +26,15 @@ Project { prepare: { var cmd = new JavaScriptCommand(); cmd.sourceCode = function () { - var file = new TextFile(input.fileName, TextFile.ReadOnly); + var file = new TextFile(input.filePath, TextFile.ReadOnly); var text = file.readAll(); file.close(); - file = new TextFile(output.fileName, TextFile.WriteOnly); + file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(text); file.close(); } - cmd.description = 'generating ' + FileInfo.fileName(output.fileName); + cmd.description = 'generating ' + FileInfo.fileName(output.filePath); cmd.highlight = 'codegen'; return cmd; } diff --git a/tests/auto/blackbox/testdata/productproperties/header.qbs b/tests/auto/blackbox/testdata/productproperties/header.qbs index 51757b29e..56ad8fc78 100644 --- a/tests/auto/blackbox/testdata/productproperties/header.qbs +++ b/tests/auto/blackbox/testdata/productproperties/header.qbs @@ -18,7 +18,7 @@ Product { cmd.highlight = "codegen"; cmd.blubbProp = product.blubbProp; cmd.sourceCode = function() { - file = new TextFile(output.fileName, TextFile.WriteOnly); + file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write("#define BLUBB_PROP " + blubbProp); file.close(); diff --git a/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs b/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs index e1ab9bddc..1c3e363c9 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs @@ -20,7 +20,7 @@ Module { cmd.description = "Making output from input"; cmd.sourceCode = function() { // print('Change in source code'); - File.copy(input.fileName, output.fileName); + File.copy(input.filePath, output.filePath); } return cmd; } diff --git a/tests/auto/blackbox/testdata/propertyChanges/project.qbs b/tests/auto/blackbox/testdata/propertyChanges/project.qbs index 0cba4f630..f6a48e1d4 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/project.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/project.qbs @@ -44,10 +44,10 @@ Project { Artifact { fileName: "generated.txt" } prepare: { var cmd = new JavaScriptCommand(); - cmd.description = "generating " + output.fileName; + cmd.description = "generating " + output.filePath; cmd.highlight = "codegen"; cmd.sourceCode = function() { - file = new TextFile(output.fileName, TextFile.WriteOnly); + file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(product.fileContentPrefix + "contents 1" + project.fileContentSuffix); diff --git a/tests/auto/blackbox/testdata/qt5plugin/plugin.qbs b/tests/auto/blackbox/testdata/qt5plugin/plugin.qbs index 121453d0b..d704ab385 100644 --- a/tests/auto/blackbox/testdata/qt5plugin/plugin.qbs +++ b/tests/auto/blackbox/testdata/qt5plugin/plugin.qbs @@ -32,9 +32,9 @@ DynamicLibrary { } prepare: { var cmd = new JavaScriptCommand(); - cmd.description = "generating " + FileInfo.fileName(output.fileName); + cmd.description = "generating " + FileInfo.fileName(output.filePath); cmd.sourceCode = function() { - File.copy(input.fileName, output.fileName); + File.copy(input.filePath, output.filePath); } return cmd; } diff --git a/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs index b29fb55ec..8e7989573 100644 --- a/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs +++ b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs @@ -18,9 +18,9 @@ Module { }] prepare: { var cmd = new JavaScriptCommand(); - cmd.description = "generating " + FileInfo.fileName(output.fileName); + cmd.description = "generating " + FileInfo.fileName(output.filePath); cmd.sourceCode = function() { - var f = new TextFile(output.fileName, TextFile.WriteOnly); + var f = new TextFile(output.filePath, TextFile.WriteOnly); f.write("NARF! ZORT!"); f.close(); } diff --git a/tests/auto/blackbox/testdata/trackFileTags/after/project.qbs b/tests/auto/blackbox/testdata/trackFileTags/after/project.qbs index e770c6212..df04be64b 100644 --- a/tests/auto/blackbox/testdata/trackFileTags/after/project.qbs +++ b/tests/auto/blackbox/testdata/trackFileTags/after/project.qbs @@ -21,7 +21,7 @@ Project { prepare: { var cmd = new JavaScriptCommand(); - cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);"; cmd.sourceCode += "file.truncate();" cmd.sourceCode += "file.write(\"There's nothing to see here!\");" cmd.sourceCode += "file.close();" @@ -39,7 +39,7 @@ Project { prepare: { var cmd = new JavaScriptCommand(); - cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);"; cmd.sourceCode += "file.truncate();"; cmd.sourceCode += "file.write(\"// There's nothing to see here!\\n\");"; cmd.sourceCode += "file.write(\"int foo() { return 15; }\\n\");"; diff --git a/tests/auto/blackbox/testdata/trackFileTags/before/project.qbs b/tests/auto/blackbox/testdata/trackFileTags/before/project.qbs index dbe4df6c3..8bfd66d53 100644 --- a/tests/auto/blackbox/testdata/trackFileTags/before/project.qbs +++ b/tests/auto/blackbox/testdata/trackFileTags/before/project.qbs @@ -21,7 +21,7 @@ Project { prepare: { var cmd = new JavaScriptCommand(); - cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);"; cmd.sourceCode += "file.truncate();" cmd.sourceCode += "file.write(\"There's nothing to see here!\");" cmd.sourceCode += "file.close();" @@ -39,7 +39,7 @@ Project { prepare: { var cmd = new JavaScriptCommand(); - cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);"; cmd.sourceCode += "file.truncate();"; cmd.sourceCode += "file.write(\"// There's nothing to see here!\\n\");"; cmd.sourceCode += "file.write(\"int foo() { return 15; }\\n\");"; diff --git a/tests/auto/blackbox/testdata/transformers/transformers.qbs b/tests/auto/blackbox/testdata/transformers/transformers.qbs index 7445bea15..efd5cd9ad 100644 --- a/tests/auto/blackbox/testdata/transformers/transformers.qbs +++ b/tests/auto/blackbox/testdata/transformers/transformers.qbs @@ -23,8 +23,8 @@ Project { cmd.description = "generating foo.txt"; cmd.highlight = "linker"; cmd.sourceCode = function () { - File.remove(output.fileName); - var f = new TextFile(output.fileName, TextFile.WriteOnly); + File.remove(output.filePath); + var f = new TextFile(output.filePath, TextFile.WriteOnly); f.write("Dear Sir/Madam,\n\n"); f.write("this is a generated file.\n\n\n"); f.write("Best Regards and Mellow Greetings,\nYour Build Tool.\n"); @@ -45,7 +45,7 @@ Project { cmd.description = "generating foo.xml"; cmd.highlight = "linker"; cmd.sourceCode = function () { - File.remove(output.fileName); + File.remove(output.filePath); var doc = new XmlDomDocument(); var root = doc.createElement("root"); doc.appendChild(root); @@ -53,7 +53,7 @@ Project { var tag = doc.createElement("Greeting"); root.appendChild(tag); tag.appendChild(doc.createTextNode("text node")); - doc.save(output.fileName); + doc.save(output.filePath); } return cmd; } @@ -69,10 +69,10 @@ Project { var cmd = new JavaScriptCommand(); cmd.description = "generating bar.txt"; cmd.highlight = "linker"; - cmd.inputFileName = input.fileName; + cmd.inputFileName = input.filePath; cmd.sourceCode = function() { - File.remove(output.fileName); - var f = new TextFile(output.fileName, TextFile.WriteOnly); + File.remove(output.filePath); + var f = new TextFile(output.filePath, TextFile.WriteOnly); f.write("Dear Sir/Madam,\n\n"); f.write("this file was generated from " + inputFileName + ".\n\n\n"); f.write("Best Regards and Mellow Greetings,\nYour Build Tool.\n"); -- cgit v1.2.3