diff --git a/lib/generator._js b/lib/generator._js index 545c36d..18ee141 100644 --- a/lib/generator._js +++ b/lib/generator._js @@ -60,13 +60,14 @@ function ScriptGenerator(repositoryRoot, projectType, projectPath, solutionPath, projectType = projectType.toUpperCase(); if (!scriptType) { + // use posh by default // If no script type is passed, use the default one if (projectType === ProjectType.wap || projectType === ProjectType.website || projectType === ProjectType.python) { // For .NET the default script type is batch - scriptType = ScriptType.batch; + scriptType = ScriptType.posh; } else { // Otherwise the default depends on the os - scriptType = isWindows ? ScriptType.batch : ScriptType.bash; + scriptType = isWindows ? ScriptType.posh : ScriptType.bash; } } else { scriptType = scriptType.toUpperCase(); diff --git a/lib/generator.js b/lib/generator.js index b0491d3..0b46339 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -61,12 +61,13 @@ function ScriptGenerator(repositoryRoot, projectType, projectPath, solutionPath, if (!scriptType) { + if ((((projectType === ProjectType.wap) || (projectType === ProjectType.website)) || (projectType === ProjectType.python))) { - scriptType = ScriptType.batch; } + scriptType = ScriptType.posh; } else { - scriptType = (isWindows ? ScriptType.batch : ScriptType.bash); } ; } + scriptType = (isWindows ? ScriptType.posh : ScriptType.bash); } ; } else { scriptType = scriptType.toUpperCase(); @@ -133,54 +134,54 @@ function ScriptGenerator(repositoryRoot, projectType, projectPath, solutionPath, this.generators[ProjectType.php] = generatePHPDeploymentScript;}; -function generateGoDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateGoDeploymentScript", line: 136 }; return __func(_, this, arguments, generateGoDeploymentScript, 1, __frame, function __$generateGoDeploymentScript() { +function generateGoDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateGoDeploymentScript", line: 137 }; return __func(_, this, arguments, generateGoDeploymentScript, 1, __frame, function __$generateGoDeploymentScript() { return scriptGenerator.generateGoDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateAspNetCoreDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateAspNetCoreDeploymentScript", line: 140 }; return __func(_, this, arguments, generateAspNetCoreDeploymentScript, 1, __frame, function __$generateAspNetCoreDeploymentScript() { +function generateAspNetCoreDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateAspNetCoreDeploymentScript", line: 141 }; return __func(_, this, arguments, generateAspNetCoreDeploymentScript, 1, __frame, function __$generateAspNetCoreDeploymentScript() { return scriptGenerator.generateAspNetCoreDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateDotNetConsoleDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateDotNetConsoleDeploymentScript", line: 144 }; return __func(_, this, arguments, generateDotNetConsoleDeploymentScript, 1, __frame, function __$generateDotNetConsoleDeploymentScript() { +function generateDotNetConsoleDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateDotNetConsoleDeploymentScript", line: 145 }; return __func(_, this, arguments, generateDotNetConsoleDeploymentScript, 1, __frame, function __$generateDotNetConsoleDeploymentScript() { return scriptGenerator.generateDotNetConsoleDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateWapDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateWapDeploymentScript", line: 148 }; return __func(_, this, arguments, generateWapDeploymentScript, 1, __frame, function __$generateWapDeploymentScript() { +function generateWapDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateWapDeploymentScript", line: 149 }; return __func(_, this, arguments, generateWapDeploymentScript, 1, __frame, function __$generateWapDeploymentScript() { return scriptGenerator.generateWapDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateWebSiteDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateWebSiteDeploymentScript", line: 152 }; return __func(_, this, arguments, generateWebSiteDeploymentScript, 1, __frame, function __$generateWebSiteDeploymentScript() { +function generateWebSiteDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateWebSiteDeploymentScript", line: 153 }; return __func(_, this, arguments, generateWebSiteDeploymentScript, 1, __frame, function __$generateWebSiteDeploymentScript() { return scriptGenerator.generateWebSiteDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateNodeDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateNodeDeploymentScript", line: 156 }; return __func(_, this, arguments, generateNodeDeploymentScript, 1, __frame, function __$generateNodeDeploymentScript() { +function generateNodeDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateNodeDeploymentScript", line: 157 }; return __func(_, this, arguments, generateNodeDeploymentScript, 1, __frame, function __$generateNodeDeploymentScript() { return scriptGenerator.generateNodeDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generatePythonDeploymentScript(scriptGenerator, _) { var __frame = { name: "generatePythonDeploymentScript", line: 160 }; return __func(_, this, arguments, generatePythonDeploymentScript, 1, __frame, function __$generatePythonDeploymentScript() { +function generatePythonDeploymentScript(scriptGenerator, _) { var __frame = { name: "generatePythonDeploymentScript", line: 161 }; return __func(_, this, arguments, generatePythonDeploymentScript, 1, __frame, function __$generatePythonDeploymentScript() { return scriptGenerator.generatePythonDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateRubyDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateRubyDeploymentScript", line: 164 }; return __func(_, this, arguments, generateRubyDeploymentScript, 1, __frame, function __$generateRubyDeploymentScript() { +function generateRubyDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateRubyDeploymentScript", line: 165 }; return __func(_, this, arguments, generateRubyDeploymentScript, 1, __frame, function __$generateRubyDeploymentScript() { return scriptGenerator.generateRubyDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generatePHPDeploymentScript(scriptGenerator, _) { var __frame = { name: "generatePHPDeploymentScript", line: 168 }; return __func(_, this, arguments, generatePHPDeploymentScript, 1, __frame, function __$generatePHPDeploymentScript() { +function generatePHPDeploymentScript(scriptGenerator, _) { var __frame = { name: "generatePHPDeploymentScript", line: 169 }; return __func(_, this, arguments, generatePHPDeploymentScript, 1, __frame, function __$generatePHPDeploymentScript() { return scriptGenerator.generatePHPDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -function generateBasicWebSiteDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateBasicWebSiteDeploymentScript", line: 172 }; return __func(_, this, arguments, generateBasicWebSiteDeploymentScript, 1, __frame, function __$generateBasicWebSiteDeploymentScript() { +function generateBasicWebSiteDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateBasicWebSiteDeploymentScript", line: 173 }; return __func(_, this, arguments, generateBasicWebSiteDeploymentScript, 1, __frame, function __$generateBasicWebSiteDeploymentScript() { if (scriptGenerator.solutionPath) { return _(new Error("Solution path is not supported with this website type")); } ; return scriptGenerator.generateWebSiteDeploymentScript(__cb(_, __frame, 4, 2, _, true)); });}; -function generateFunctionAppDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateFunctionAppDeploymentScript", line: 179 }; return __func(_, this, arguments, generateFunctionAppDeploymentScript, 1, __frame, function __$generateFunctionAppDeploymentScript() { +function generateFunctionAppDeploymentScript(scriptGenerator, _) { var __frame = { name: "generateFunctionAppDeploymentScript", line: 180 }; return __func(_, this, arguments, generateFunctionAppDeploymentScript, 1, __frame, function __$generateFunctionAppDeploymentScript() { return scriptGenerator.generateFunctionAppDeploymentScript(__cb(_, __frame, 1, 2, _, true)); });}; -ScriptGenerator.prototype.generateDeploymentScript = function ScriptGenerator_prototype_generateDeploymentScript__1(_) { var generator, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDeploymentScript__1", line: 183 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDeploymentScript__1, 0, __frame, function __$ScriptGenerator_prototype_generateDeploymentScript__1() { +ScriptGenerator.prototype.generateDeploymentScript = function ScriptGenerator_prototype_generateDeploymentScript__1(_) { var generator, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDeploymentScript__1", line: 184 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDeploymentScript__1, 0, __frame, function __$ScriptGenerator_prototype_generateDeploymentScript__1() { generator = __this.generators[__this.projectType]; if (!generator) { return _(new Error(("Invalid project type received: " + __this.projectType))); } ; @@ -199,19 +200,19 @@ function isPathSubDir(parentPath, childPath) { -ScriptGenerator.prototype.generateGoDeploymentScript = function ScriptGenerator_prototype_generateGoDeploymentScript__2(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateGoDeploymentScript__2", line: 202 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateGoDeploymentScript__2, 0, __frame, function __$ScriptGenerator_prototype_generateGoDeploymentScript__2() { +ScriptGenerator.prototype.generateGoDeploymentScript = function ScriptGenerator_prototype_generateGoDeploymentScript__2(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateGoDeploymentScript__2", line: 203 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateGoDeploymentScript__2, 0, __frame, function __$ScriptGenerator_prototype_generateGoDeploymentScript__2() { log.info("Generating deployment script for Go Web Site"); return __this.generateBasicDeploymentScript("go.template", __cb(_, __frame, 3, 2, _, true)); });}; -ScriptGenerator.prototype.generateNodeDeploymentScript = function ScriptGenerator_prototype_generateNodeDeploymentScript__3(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateNodeDeploymentScript__3", line: 208 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateNodeDeploymentScript__3, 0, __frame, function __$ScriptGenerator_prototype_generateNodeDeploymentScript__3() { +ScriptGenerator.prototype.generateNodeDeploymentScript = function ScriptGenerator_prototype_generateNodeDeploymentScript__3(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateNodeDeploymentScript__3", line: 209 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateNodeDeploymentScript__3, 0, __frame, function __$ScriptGenerator_prototype_generateNodeDeploymentScript__3() { log.info("Generating deployment script for node.js Web Site"); return __this.generateBasicDeploymentScript("node.template", __cb(_, __frame, 3, 2, _, true)); });}; -ScriptGenerator.prototype.generateFunctionAppDeploymentScript = function ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4", line: 214 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4, 0, __frame, function __$ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4() { +ScriptGenerator.prototype.generateFunctionAppDeploymentScript = function ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4", line: 215 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4, 0, __frame, function __$ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4() { log.info("Generating deployment script for function App"); options = { }; return (function __$ScriptGenerator_prototype_generateFunctionAppDeploymentScript__4(__then) { @@ -240,7 +241,7 @@ ScriptGenerator.prototype.generateFunctionAppDeploymentScript = function ScriptG -ScriptGenerator.prototype.generatePythonDeploymentScript = function ScriptGenerator_prototype_generatePythonDeploymentScript__5(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generatePythonDeploymentScript__5", line: 243 }; return __func(_, this, arguments, ScriptGenerator_prototype_generatePythonDeploymentScript__5, 0, __frame, function __$ScriptGenerator_prototype_generatePythonDeploymentScript__5() { +ScriptGenerator.prototype.generatePythonDeploymentScript = function ScriptGenerator_prototype_generatePythonDeploymentScript__5(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generatePythonDeploymentScript__5", line: 244 }; return __func(_, this, arguments, ScriptGenerator_prototype_generatePythonDeploymentScript__5, 0, __frame, function __$ScriptGenerator_prototype_generatePythonDeploymentScript__5() { log.info("Generating deployment script for python Web Site"); if ((__this.scriptType != ScriptType.batch)) { @@ -250,19 +251,19 @@ ScriptGenerator.prototype.generatePythonDeploymentScript = function ScriptGenera return __this.generateBasicDeploymentScript("python.template", __cb(_, __frame, 7, 2, _, true)); });}; -ScriptGenerator.prototype.generateRubyDeploymentScript = function ScriptGenerator_prototype_generateRubyDeploymentScript__6(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateRubyDeploymentScript__6", line: 253 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateRubyDeploymentScript__6, 0, __frame, function __$ScriptGenerator_prototype_generateRubyDeploymentScript__6() { +ScriptGenerator.prototype.generateRubyDeploymentScript = function ScriptGenerator_prototype_generateRubyDeploymentScript__6(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generateRubyDeploymentScript__6", line: 254 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateRubyDeploymentScript__6, 0, __frame, function __$ScriptGenerator_prototype_generateRubyDeploymentScript__6() { log.info("Generating deployment script for Ruby Web Site"); return __this.generateBasicDeploymentScript("ruby.template", __cb(_, __frame, 3, 2, _, true)); });}; -ScriptGenerator.prototype.generatePHPDeploymentScript = function ScriptGenerator_prototype_generatePHPDeploymentScript__7(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generatePHPDeploymentScript__7", line: 259 }; return __func(_, this, arguments, ScriptGenerator_prototype_generatePHPDeploymentScript__7, 0, __frame, function __$ScriptGenerator_prototype_generatePHPDeploymentScript__7() { +ScriptGenerator.prototype.generatePHPDeploymentScript = function ScriptGenerator_prototype_generatePHPDeploymentScript__7(_) { var __this = this; var __frame = { name: "ScriptGenerator_prototype_generatePHPDeploymentScript__7", line: 260 }; return __func(_, this, arguments, ScriptGenerator_prototype_generatePHPDeploymentScript__7, 0, __frame, function __$ScriptGenerator_prototype_generatePHPDeploymentScript__7() { log.info("Generating deployment script for PHP Web Site"); return __this.generateBasicDeploymentScript("php.template", __cb(_, __frame, 3, 2, _, true)); });}; -ScriptGenerator.prototype.generateWapDeploymentScript = function ScriptGenerator_prototype_generateWapDeploymentScript__8(_) { var msbuildArguments, msbuildArgumentsForInPlace, solutionDir, solutionArgs, options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateWapDeploymentScript__8", line: 265 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateWapDeploymentScript__8, 0, __frame, function __$ScriptGenerator_prototype_generateWapDeploymentScript__8() { +ScriptGenerator.prototype.generateWapDeploymentScript = function ScriptGenerator_prototype_generateWapDeploymentScript__8(_) { var msbuildArguments, msbuildArgumentsForInPlace, solutionDir, solutionArgs, options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateWapDeploymentScript__8", line: 266 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateWapDeploymentScript__8, 0, __frame, function __$ScriptGenerator_prototype_generateWapDeploymentScript__8() { argNotNull(__this.projectPath, "projectPath"); if (((__this.scriptType != ScriptType.batch) && (__this.scriptType != ScriptType.posh))) { @@ -313,7 +314,7 @@ ScriptGenerator.prototype.generateWapDeploymentScript = function ScriptGenerator return __this.generateDotNetDeploymentScript("aspnet.wap.template", options, __cb(_, __frame, 48, 2, _, true)); });}; -ScriptGenerator.prototype.generateAspNetCoreDeploymentScript = function ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9(_) { var options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9", line: 316 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9, 0, __frame, function __$ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9() { +ScriptGenerator.prototype.generateAspNetCoreDeploymentScript = function ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9(_) { var options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9", line: 317 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9, 0, __frame, function __$ScriptGenerator_prototype_generateAspNetCoreDeploymentScript__9() { argNotNull(__this.absoluteProjectPath, "absoluteProjectPath"); @@ -326,7 +327,7 @@ ScriptGenerator.prototype.generateAspNetCoreDeploymentScript = function ScriptGe -ScriptGenerator.prototype.generateDotNetConsoleDeploymentScript = function ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10(_) { var msbuildArguments, solutionDir, solutionArgs, options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10", line: 329 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10, 0, __frame, function __$ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10() { +ScriptGenerator.prototype.generateDotNetConsoleDeploymentScript = function ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10(_) { var msbuildArguments, solutionDir, solutionArgs, options, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10", line: 330 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10, 0, __frame, function __$ScriptGenerator_prototype_generateDotNetConsoleDeploymentScript__10() { argNotNull(__this.projectPath, "projectPath"); if (((__this.scriptType != ScriptType.batch) && (__this.scriptType != ScriptType.posh))) { @@ -371,7 +372,7 @@ ScriptGenerator.prototype.generateDotNetConsoleDeploymentScript = function Scrip return __this.generateDotNetDeploymentScript("dotnetconsole.template", options, __cb(_, __frame, 42, 2, _, true)); });}; -ScriptGenerator.prototype.generateWebSiteDeploymentScript = function ScriptGenerator_prototype_generateWebSiteDeploymentScript__11(_) { var msbuildArguments, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateWebSiteDeploymentScript__11", line: 374 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateWebSiteDeploymentScript__11, 0, __frame, function __$ScriptGenerator_prototype_generateWebSiteDeploymentScript__11() { return (function __$ScriptGenerator_prototype_generateWebSiteDeploymentScript__11(__then) { +ScriptGenerator.prototype.generateWebSiteDeploymentScript = function ScriptGenerator_prototype_generateWebSiteDeploymentScript__11(_) { var msbuildArguments, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateWebSiteDeploymentScript__11", line: 375 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateWebSiteDeploymentScript__11, 0, __frame, function __$ScriptGenerator_prototype_generateWebSiteDeploymentScript__11() { return (function __$ScriptGenerator_prototype_generateWebSiteDeploymentScript__11(__then) { if (__this.solutionPath) { log.info("Generating deployment script for .NET Web Site"); @@ -396,7 +397,7 @@ ScriptGenerator.prototype.generateWebSiteDeploymentScript = function ScriptGener -ScriptGenerator.prototype.generateBasicDeploymentScript = function ScriptGenerator_prototype_generateBasicDeploymentScript__12(templateFileName, _) { var lowerCaseScriptType, fixedSitePath, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateBasicDeploymentScript__12", line: 399 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateBasicDeploymentScript__12, 1, __frame, function __$ScriptGenerator_prototype_generateBasicDeploymentScript__12() { +ScriptGenerator.prototype.generateBasicDeploymentScript = function ScriptGenerator_prototype_generateBasicDeploymentScript__12(templateFileName, _) { var lowerCaseScriptType, fixedSitePath, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateBasicDeploymentScript__12", line: 400 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateBasicDeploymentScript__12, 1, __frame, function __$ScriptGenerator_prototype_generateBasicDeploymentScript__12() { argNotNull(templateFileName, "templateFileName"); lowerCaseScriptType = __this.scriptType.toLowerCase(); @@ -410,7 +411,7 @@ ScriptGenerator.prototype.generateBasicDeploymentScript = function ScriptGenerat return __this.writeDeploymentFiles(templateContent, __cb(_, __frame, 11, 2, _, true)); });}; -ScriptGenerator.prototype.generateFunctionAppScript = function ScriptGenerator_prototype_generateFunctionAppScript__13(templateFileName, options, _) { var lowerCaseScriptType, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateFunctionAppScript__13", line: 413 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateFunctionAppScript__13, 2, __frame, function __$ScriptGenerator_prototype_generateFunctionAppScript__13() { +ScriptGenerator.prototype.generateFunctionAppScript = function ScriptGenerator_prototype_generateFunctionAppScript__13(templateFileName, options, _) { var lowerCaseScriptType, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateFunctionAppScript__13", line: 414 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateFunctionAppScript__13, 2, __frame, function __$ScriptGenerator_prototype_generateFunctionAppScript__13() { argNotNull(templateFileName, "templateFileName"); lowerCaseScriptType = __this.scriptType.toLowerCase(); @@ -425,7 +426,7 @@ ScriptGenerator.prototype.generateFunctionAppScript = function ScriptGenerator_p return __this.writeDeploymentFiles(templateContent, __cb(_, __frame, 12, 2, _, true)); });}; -ScriptGenerator.prototype.generateDotNetDeploymentScript = function ScriptGenerator_prototype_generateDotNetDeploymentScript__14(templateFileName, options, _) { var lowerCaseScriptType, solutionDir, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDotNetDeploymentScript__14", line: 428 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDotNetDeploymentScript__14, 2, __frame, function __$ScriptGenerator_prototype_generateDotNetDeploymentScript__14() { +ScriptGenerator.prototype.generateDotNetDeploymentScript = function ScriptGenerator_prototype_generateDotNetDeploymentScript__14(templateFileName, options, _) { var lowerCaseScriptType, solutionDir, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateDotNetDeploymentScript__14", line: 429 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateDotNetDeploymentScript__14, 2, __frame, function __$ScriptGenerator_prototype_generateDotNetDeploymentScript__14() { argNotNull(templateFileName, "templateFileName"); @@ -445,7 +446,7 @@ ScriptGenerator.prototype.generateDotNetDeploymentScript = function ScriptGenera return __this.writeDeploymentFiles(templateContent, __cb(_, __frame, 17, 2, _, true)); });}; -ScriptGenerator.prototype.generateAspNetCoreScript = function ScriptGenerator_prototype_generateAspNetCoreScript__15(templateFileName, options, _) { var prop, lowerCaseScriptType, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateAspNetCoreScript__15", line: 448 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateAspNetCoreScript__15, 2, __frame, function __$ScriptGenerator_prototype_generateAspNetCoreScript__15() { +ScriptGenerator.prototype.generateAspNetCoreScript = function ScriptGenerator_prototype_generateAspNetCoreScript__15(templateFileName, options, _) { var prop, lowerCaseScriptType, templateContent, __this = this; var __frame = { name: "ScriptGenerator_prototype_generateAspNetCoreScript__15", line: 449 }; return __func(_, this, arguments, ScriptGenerator_prototype_generateAspNetCoreScript__15, 2, __frame, function __$ScriptGenerator_prototype_generateAspNetCoreScript__15() { argNotNull(templateFileName, "templateFileName"); if ((__this.scriptType === ScriptType.batch)) { @@ -498,7 +499,7 @@ function fixLineEndingsToWindows(contentStr) { return contentStr.replace(/(?:\r\n|\n)/g, "\r\n");}; -ScriptGenerator.prototype.writeDeploymentFiles = function ScriptGenerator_prototype_writeDeploymentFiles__16(templateContent, _) { var deployScriptFileName, deploymentCommand, deployScriptPath, deploymentFilePath, __this = this; var __frame = { name: "ScriptGenerator_prototype_writeDeploymentFiles__16", line: 501 }; return __func(_, this, arguments, ScriptGenerator_prototype_writeDeploymentFiles__16, 1, __frame, function __$ScriptGenerator_prototype_writeDeploymentFiles__16() { +ScriptGenerator.prototype.writeDeploymentFiles = function ScriptGenerator_prototype_writeDeploymentFiles__16(templateContent, _) { var deployScriptFileName, deploymentCommand, deployScriptPath, deploymentFilePath, __this = this; var __frame = { name: "ScriptGenerator_prototype_writeDeploymentFiles__16", line: 502 }; return __func(_, this, arguments, ScriptGenerator_prototype_writeDeploymentFiles__16, 1, __frame, function __$ScriptGenerator_prototype_writeDeploymentFiles__16() { argNotNull(templateContent, "templateContent"); @@ -539,7 +540,7 @@ function getTemplatePath(fileName) { return path.join(templatesDir, fileName);}; -function writeContentToFile(path, content, _) { var __frame = { name: "writeContentToFile", line: 542 }; return __func(_, this, arguments, writeContentToFile, 2, __frame, function __$writeContentToFile() { return (function __$writeContentToFile(__then) { +function writeContentToFile(path, content, _) { var __frame = { name: "writeContentToFile", line: 543 }; return __func(_, this, arguments, writeContentToFile, 2, __frame, function __$writeContentToFile() { return (function __$writeContentToFile(__then) { if (fs.existsSync(path)) { return confirm((("The file: \"" + path) + "\" already exists\nAre you sure you want to overwrite it (y/n): "), __cb(_, __frame, 3, 9, function ___(__0, __2) { var __1 = !__2; return (function __$writeContentToFile(__then) { if (__1) { return _(null); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(function __$writeContentToFile() { diff --git a/lib/templates/deploy.batch.aspnet.template b/lib/templates/deploy.batch.aspnet.template index 6ecf9bd..dbd5104 100644 --- a/lib/templates/deploy.batch.aspnet.template +++ b/lib/templates/deploy.batch.aspnet.template @@ -7,7 +7,3 @@ IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP ( IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%" mkdir "%DEPLOYMENT_TEMP%" ) - -IF DEFINED MSBUILD_PATH goto MsbuildPathDefined -SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe -:MsbuildPathDefined diff --git a/lib/templates/deploy.batch.aspnet.wap.template b/lib/templates/deploy.batch.aspnet.wap.template index 130fa3e..c8cee37 100644 --- a/lib/templates/deploy.batch.aspnet.wap.template +++ b/lib/templates/deploy.batch.aspnet.wap.template @@ -7,15 +7,15 @@ echo Handling .NET Web Application deployment. :: 1. Restore NuGet packages IF /I "{SolutionPath}" NEQ "" ( - call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\{SolutionPath}" + call :ExecuteCmd %NUGETRESTORE% "%DEPLOYMENT_SOURCE%\{SolutionPath}" IF !ERRORLEVEL! NEQ 0 goto error ) :: 2. Build to the temporary path IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( - call :ExecuteCmd "%MSBUILD_PATH%" {MSBuildArguments} + call :ExecuteCmd "%MSBUILD_DIR%\MSBuild.exe" {MSBuildArguments} ) ELSE ( - call :ExecuteCmd "%MSBUILD_PATH%" {MSBuildArgumentsForInPlace} + call :ExecuteCmd "%MSBUILD_DIR%\MSBuild.exe" {MSBuildArgumentsForInPlace} ) IF !ERRORLEVEL! NEQ 0 goto error diff --git a/lib/templates/deploy.batch.aspnet.website.template b/lib/templates/deploy.batch.aspnet.website.template index 23c7798..19eac03 100644 --- a/lib/templates/deploy.batch.aspnet.website.template +++ b/lib/templates/deploy.batch.aspnet.website.template @@ -6,7 +6,7 @@ echo Handling .NET Web Site deployment. :: 1. Build to the repository path -call :ExecuteCmd "%MSBUILD_PATH%" {MSBuildArguments} +call :ExecuteCmd "%MSBUILD_DIR%\MSBuild.exe" {MSBuildArguments} IF !ERRORLEVEL! NEQ 0 goto error :: 2. KuduSync diff --git a/lib/templates/deploy.batch.dotnetconsole.template b/lib/templates/deploy.batch.dotnetconsole.template index abd7d24..2cfece1 100644 --- a/lib/templates/deploy.batch.dotnetconsole.template +++ b/lib/templates/deploy.batch.dotnetconsole.template @@ -7,12 +7,12 @@ echo Handling .NET Console Application deployment. :: 1. Restore NuGet packages IF /I "{SolutionPath}" NEQ "" ( - call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\{SolutionPath}" -MSBuildPath "%MSBUILD_15_DIR%" + call :ExecuteCmd %NUGETRESTORE% "%DEPLOYMENT_SOURCE%\{SolutionPath}" IF !ERRORLEVEL! NEQ 0 goto error ) :: 2. Build to the temporary path -call :ExecuteCmd "%MSBUILD_15_DIR%\MSBuild.exe" {MSBuildArguments} +call :ExecuteCmd "%MSBUILD_DIR%\MSBuild.exe" {MSBuildArguments} IF !ERRORLEVEL! NEQ 0 goto error :: 3. Run web job deploy script diff --git a/lib/templates/deploy.batch.functionmsbuild.template b/lib/templates/deploy.batch.functionmsbuild.template index fbc9fe1..2ae3cf9 100644 --- a/lib/templates/deploy.batch.functionmsbuild.template +++ b/lib/templates/deploy.batch.functionmsbuild.template @@ -2,13 +2,14 @@ :: Deployment :: ---------- echo Handling function App deployment with Msbuild. +:: only works with msbuild15 :: 1. Restore nuget packages -call :ExecuteCmd nuget.exe restore "%DEPLOYMENT_SOURCE%\{RestoreArguments}" -MSBuildPath "%MSBUILD_15_DIR%" +call :ExecuteCmd %NUGETRESTORE% "%DEPLOYMENT_SOURCE%\{RestoreArguments}" IF !ERRORLEVEL! NEQ 0 goto error :: 2. Build and publish -call :ExecuteCmd "%MSBUILD_15_DIR%\MSBuild.exe" "%DEPLOYMENT_SOURCE%\{ProjectPath}" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS% +call :ExecuteCmd "%MSBUILD_DIR%\MSBuild.exe" "%DEPLOYMENT_SOURCE%\{ProjectPath}" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS% IF !ERRORLEVEL! NEQ 0 goto error :: 3. KuduSync diff --git a/lib/templates/deploy.batch.prefix.template b/lib/templates/deploy.batch.prefix.template index 5d80ce9..1d79a72 100644 --- a/lib/templates/deploy.batch.prefix.template +++ b/lib/templates/deploy.batch.prefix.template @@ -21,6 +21,23 @@ IF %ERRORLEVEL% NEQ 0 ( setlocal enabledelayedexpansion SET ARTIFACTS=%~dp0%..\artifacts +:: select msbuild version +IF NOT DEFINED MSBUILD_VERSION GOTO useMsbuild15 +IF %MSBUILD_VERSION% == "15" GOTO useMsbuild15 +IF %MSBUILD_VERSION% == "14" GOTO useMsbuild14 +:: defined an invalid version +GOTO error + +:useMsbuild15 +SET MSBUILD_DIR=%MSBUILD_15_DIR% +GOTO nugetRestore + +:useMsbuild14 +SET MSBUILD_DIR=%MSBUILD_14_DIR% +GOTO nugetRestore + +:nugetRestore +SET NUGETRESTORE=nuget restore -NonInteractive -MSBuildPath "%MSBUILD_DIR%" IF NOT DEFINED DEPLOYMENT_SOURCE ( SET DEPLOYMENT_SOURCE=%~dp0%. diff --git a/lib/templates/deploy.posh.aspnet.template b/lib/templates/deploy.posh.aspnet.template index 6d60520..b7800b8 100644 --- a/lib/templates/deploy.posh.aspnet.template +++ b/lib/templates/deploy.posh.aspnet.template @@ -1,6 +1,5 @@ $DEPLOYMENT_TEMP = $env:DEPLOYMENT_TEMP -$MSBUILD_PATH = $env:MSBUILD_PATH if ($DEPLOYMENT_TEMP -eq $null) { $DEPLOYMENT_TEMP = "$env:temp\___deployTemp$env:random" @@ -13,7 +12,3 @@ if ($CLEAN_LOCAL_DEPLOYMENT_TEMP -eq $true) { } mkdir "$DEPLOYMENT_TEMP" } - -if ($MSBUILD_PATH -eq $null) { - $MSBUILD_PATH = "${env:ProgramFiles(x86)}\MSBuild\14.0\Bin\MSBuild.exe" -} diff --git a/lib/templates/deploy.posh.aspnet.wap.template b/lib/templates/deploy.posh.aspnet.wap.template index 610844c..c24fbc2 100644 --- a/lib/templates/deploy.posh.aspnet.wap.template +++ b/lib/templates/deploy.posh.aspnet.wap.template @@ -7,15 +7,15 @@ echo "Handling .NET Web Application deployment." # 1. Restore NuGet packages if (Test-Path "{SolutionPath}") { - nuget restore "$DEPLOYMENT_SOURCE\{SolutionPath}" + $NUGETRESTORE "$DEPLOYMENT_SOURCE\{SolutionPath}" exitWithMessageOnError "NuGet restore failed" } # 2. Build to the temporary path if ($env:IN_PLACE_DEPLOYMENT -ne "1") { - & "$MSBUILD_PATH" {MSBuildArguments} + & "$MSBUILD_DIR\MSBuild.exe" {MSBuildArguments} } else { - & "$MSBUILD_PATH" {MSBuildArgumentsForInPlace} + & "$MSBUILD_DIR\MSBuild.exe" {MSBuildArgumentsForInPlace} } exitWithMessageOnError "MSBuild failed" diff --git a/lib/templates/deploy.posh.aspnet.website.template b/lib/templates/deploy.posh.aspnet.website.template index 5c8453f..24ced80 100644 --- a/lib/templates/deploy.posh.aspnet.website.template +++ b/lib/templates/deploy.posh.aspnet.website.template @@ -6,7 +6,7 @@ echo "Handling .NET Web Site deployment." # 1. Build to the repository path -& "$MSBUILD_PATH" {MSBuildArguments} +& "$MSBUILD_DIR\MSBuild.exe" {MSBuildArguments} exitWithMessageOnError "MSBuild failed" # 2. KuduSync diff --git a/lib/templates/deploy.posh.dotnetconsole.template b/lib/templates/deploy.posh.dotnetconsole.template index 81f5fe1..ff12439 100644 --- a/lib/templates/deploy.posh.dotnetconsole.template +++ b/lib/templates/deploy.posh.dotnetconsole.template @@ -7,12 +7,12 @@ echo "Handling .NET Console Application deployment." # 1. Restore NuGet packages if (Test-Path "{SolutionPath}") { - nuget restore "$DEPLOYMENT_SOURCE\{SolutionPath}" + $NUGETRESTORE "$DEPLOYMENT_SOURCE\{SolutionPath}" exitWithMessageOnError "NuGet restore failed" } # 2. Build to the temporary path -& "$MSBUILD_PATH" {MSBuildArguments} +& "$MSBUILD_DIR\MSBuild.exe" {MSBuildArguments} exitWithMessageOnError "MSBuild failed" # 3. Run web job deploy script diff --git a/lib/templates/deploy.posh.prefix.template b/lib/templates/deploy.posh.prefix.template index dfd550f..f4433a4 100644 --- a/lib/templates/deploy.posh.prefix.template +++ b/lib/templates/deploy.posh.prefix.template @@ -35,6 +35,14 @@ $DEPLOYMENT_TARGET = $env:DEPLOYMENT_TARGET $NEXT_MANIFEST_PATH = $env:NEXT_MANIFEST_PATH $PREVIOUS_MANIFEST_PATH = $env:PREVIOUS_MANIFEST_PATH +if ($env:MSBUILD_VERSION -eq $null -Or $env:MSBUILD_VERSION -eq "15") { + $MSBUILD_DIR = $env:MSBUILD_15_DIR +} ElseIf ($env:MSBUILD_VERSION -eq "14") { + $MSBUILD_DIR = $env:MSBUILD_14_DIR +} Else { + exitWithMessageOnError "MSBUILD_VERSION is invalid, it needs to be either 14 or 15" +} +$NUGETRESTORE = "nuget restore -NonInteractive -MSBuildPath `"$MSBUILD_DIR`"" if ($DEPLOYMENT_SOURCE -eq $null) { $DEPLOYMENT_SOURCE = $SCRIPT_DIR