Android gradle google appengine task

I am trying to write a gradle task for my Android application that launches the Google appengine developer server, runs a test, and then closes the server.

What I tried looks like this:

task runAppEngine (dependsOn: ":backend:appengineRun") <<{ //run test //stop development server } 

The appengineRun task is executed, but everything that I insert in the doLast section of the gradle task never starts. For example, if I set the println statement, it never prints to the console.

I'm also not sure how to handle the appengineStop call from a task to stop the development server.

Thanks for any help anyone can offer!

+7
android google-app-engine build.gradle gradle
source share
1 answer

You probably need to run the backend:appengineRun task in daemon so that it continues the gradle process. See: https://github.com/GoogleCloudPlatform/gradle-appengine-plugin#convention-properties

This hack seems to work in my testing

 task runAppEngine (dependsOn: ":backend:appengineRun") { project(":backend").afterEvaluate { backend -> backend.extensions.appengine.daemon = true } doLast { println "started the server!" } } runAppEngine.finalizedBy ":backend:appengineStop" // or whatever task you want it to stop after 
+10
source share

All Articles