diff --git a/Tasks/Gradle/gradletask.ts b/Tasks/Gradle/gradletask.ts index 3bf0217b9b69..aa0140a6910a 100644 --- a/Tasks/Gradle/gradletask.ts +++ b/Tasks/Gradle/gradletask.ts @@ -151,16 +151,19 @@ async function run() { try { tl.setResourcePath(path.join(__dirname, 'task.json')); + // Set working directory + let workingDirectory: string = tl.getPathInput('cwd', false, true); + if (workingDirectory) { + tl.cd(workingDirectory); + } + // Configure wrapperScript let wrapperScript: string = tl.getPathInput('wrapperScript', true, true); wrapperScript = configureWrapperScript(wrapperScript); - // Set working directory - let workingDirectory: string = tl.getPathInput('cwd', false, true); if (!workingDirectory) { workingDirectory = path.dirname(wrapperScript); } - tl.cd(workingDirectory); let javaHomeSelection: string = tl.getInput('javaHomeSelection', true); let codeCoverageTool: string = tl.getInput('codeCoverageTool');