Skip to content
Permalink
Browse files

Improved: Define ‘gradlew’ variable in “build.gradle” only once

  • Loading branch information
mthl committed Nov 18, 2019
1 parent d00208c commit 174b92475f47997c9ee17fe9a3991ec813997169
Showing with 2 additions and 4 deletions.
  1. +2 −4 build.gradle
@@ -74,6 +74,7 @@ apply from: 'common.gradle'

// global properties
ext.os = System.getProperty('os.name').toLowerCase()
ext.gradlew = os.contains('windows') ? 'gradlew.bat' : './gradlew'
ext.pluginsDir = "${rootDir}/plugins"

application {
@@ -1020,11 +1021,10 @@ def createOfbizBackgroundCommandTask(taskName) {
def sourceTask = taskName.tokenize().first()
def arguments = (taskName - sourceTask)
def serverCommand = "ofbiz ${arguments}".toString()
def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'

task (taskName) {
doLast {
spawnProcess([gradleRunner, "--no-daemon", serverCommand])
spawnProcess([gradlew, "--no-daemon", serverCommand])
}
}
}
@@ -1083,7 +1083,5 @@ def taskExistsInproject(fullyQualifiedProject, taskName) {
}

def gradlewSubprocess(commandList) {
def gradlew = os.contains('windows') ? 'gradlew.bat' : './gradlew'
exec { commandLine(gradlew, "--no-daemon", *commandList) }
}

0 comments on commit 174b924

Please sign in to comment.
You can’t perform that action at this time.