GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin
Apache License 2.0
153 stars 40 forks source link

How to set warDir #174

Closed RUSSCITY closed 6 years ago

RUSSCITY commented 7 years ago

In the old plugin (com.google.appengine:gradle-appengine-plugin) we could simply set appengine { warDir = file("src/main/webapp") ... This is usefully to explode the app in the same directory as the sources, so you can modify .jsp or .html and see directly all the updates, without having to 'restartApp' each time you do simple layout change, etc.

How to get it working with this plugin? I tried all possible things. E.g. with explodeWar.explodedAppDirectory = file('src/main/webapp') I got to explode the app on the same location like sources, but when appengineRun it takes files from build/.... Setting stage.sourceDirectory doesn't help as well. I tried sourceDirectory = file('src/main/webapp'), sourceDirectory = 'src/main/webapp' and stagingDirectory = 'src/main/webapp'. Nothing helps.

Would be happy if you can help me.

loosebazooka commented 7 years ago

Have you tried using continuous (the gradle feature). This is a little more complicated, but will satisfy what you need.

These are instructions for doing this from the command line. You will need two terminals. Terminal 1 : watch and rebuild changes

$ ./gradlew explodeWar --continuous

Terminal 2 : run the dev server

$ ./gradlew appengineRun

Now when you make changes, explodeWar will rebuild the war and appengine DevServer will pick them up.

If you're running from the Android you might need to do something else since the gradle daemon mechanism inside may not allow you to run all these gradle processes at the same time.