From 5cb4e73758bb6fc575038780e86b913e992df8c2 Mon Sep 17 00:00:00 2001 From: Nabil Benabbou Date: Fri, 9 Jun 2017 17:18:35 +0200 Subject: [PATCH] Set working directory before fetching for gradle wrapper script --- Tasks/Gradle/gradletask.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tasks/Gradle/gradletask.ts b/Tasks/Gradle/gradletask.ts index 3bf0217b9b69..bbd09dd9d9e9 100644 --- a/Tasks/Gradle/gradletask.ts +++ b/Tasks/Gradle/gradletask.ts @@ -151,16 +151,20 @@ 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); } - tl.cd(workingDirectory); let javaHomeSelection: string = tl.getInput('javaHomeSelection', true); let codeCoverageTool: string = tl.getInput('codeCoverageTool');