From ec9d592cf1c120500e11cb39f92c485aa3d66e4e Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 7 Jun 2020 16:10:43 -0400 Subject: [PATCH] Maybe fix license task for Windows --- app/build.gradle | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f1adaf6f7..0e56b05c3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,6 +29,14 @@ ext { df.setTimeZone(TimeZone.getTimeZone("UTC")) return df.format(new Date()) } + + getGradleWrapper = { + if (System.properties['os.name'].toLowerCase().contains('windows')) { + return '../gradlew.bat' + } else { + return '../gradlew' + } + } } licenseReport { @@ -312,13 +320,13 @@ task copyResources(type: Copy) { task licenseReportPreBuild(type: Exec) { switch (getGradle().getStartParameter().getTaskRequests().toString()) { case ~/.*Standard.*/: - commandLine '../gradlew', 'licenseStandardReleaseReport' + commandLine getGradleWrapper(), 'licenseStandardReleaseReport' break case ~/.*Fdroid.*/: - commandLine '../gradlew', 'licenseFdroidReleaseReport' + commandLine getGradleWrapper(), 'licenseFdroidReleaseReport' break case ~/.*Dev.*/: - commandLine '../gradlew', 'licenseDevReleaseReport' + commandLine getGradleWrapper(), 'licenseDevReleaseReport' break } }