Skip to content

Commit

Permalink
why grails console always hang at :bootRun - Fixes #641
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Jul 1, 2015
1 parent 1e6fe83 commit aba2e52
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions profiles/base/commands/run-app.groovy
Expand Up @@ -14,7 +14,7 @@ if(!commandLine.isEnvironmentSet()) {
// add debug flag if present
try {

def arguments = []
def arguments = ['--quiet']
arguments.addAll commandLine.remainingArgs

def port = flag('port')
Expand Down Expand Up @@ -59,11 +59,21 @@ try {
}
}

console.updateStatus "Running application..."
def future
if(flag('debug-jvm')) {
gradle."bootRun --debug-jvm"(*arguments)
future = gradle.async."bootRun --debug-jvm"(*arguments)
}
else {
gradle.bootRun(*arguments)
future = gradle.async."bootRun"(*arguments)
}

while(!isServerAvailable()) {
if(future.done) {
// the server exited for some reason, so break
break
}
sleep 100
}
}
catch(org.gradle.tooling.BuildCancelledException e) {
Expand Down

0 comments on commit aba2e52

Please sign in to comment.