Comments (24)
There's a little quirk here you should be aware of. Because the way the gradle plugin explodes applications, it will blow away the local datastore. If you want to persist the datastore you might want to pick an alternative location for the datastore file by adding another jvmFlag :
-Ddatastore.backing_store="/path/to/datastore/file/location/local_db.bin"
from gradle-appengine-plugin.
I think you can work around this. You might be able to have your own task that writes over the exploded-app directory the necessary files. This seems to work okay for me, try it out. Add this to your build file, and when you want to reload classes do a ./gradlew customReload
it will pull any changes you made in to your classes and your webapp files (html/css/js and excluding the WEB-INF dir). It's a little complicated, but it should work for you.
import com.google.appengine.AppEnginePlugin
task reloadClasses (type: Copy) {
from sourceSets.main.output
into "${AppEnginePlugin.getExplodedAppDirectory(project)}/WEB-INF/classes"
dependsOn classes
}
task reloadWebAppDir (type: Copy) {
from (project.convention.getPlugin(WarPluginConvention).webAppDir) {
exclude "WEB-INF/*"
}
into AppEnginePlugin.getExplodedAppDirectory(project)
}
task customReload {
dependsOn reloadClasses, reloadWebAppDir
}
from gradle-appengine-plugin.
I haven't really investigated this, will add as an enhancement. Does it not work? What have you tried?
from gradle-appengine-plugin.
I guess the problem is that if you use this plugin you can no longer hot swap even the static files as it works on the regular dev server because the app is been running from build/exploded-app
directory. there may be more solutions to do this, but I had to synchronize watch the resources for changes and synchronize them to exploded-app
directory in Gradle Gaelyk Plugin.
from gradle-appengine-plugin.
Gaelyk runs in RAD mode by default, where you don't need to output to build/exploded-app
and you can use the dev server's own mechanisms to hot swap.
from gradle-appengine-plugin.
not really. since version 0.6 we've switched from the original gradle-gae-plugin
and we had to introduce new synchronization mechanism. actually, you can probably use it as well I don't think there is not that much specific things to gaelyk. the biggest problem with the old approach was that there is no way how to use old RAD with EAR based application.
from gradle-appengine-plugin.
Ah, I didn't know Gaelyk plugin worked around that, that's cool.
from gradle-appengine-plugin.
Could this be implemented based on the maven plugin? https://developers.google.com/appengine/docs/java/tools/maven
they basically add the flag "fullScanSeconds", very convenient
from gradle-appengine-plugin.
Yes, so I had a chance to look into this, hot code replace works with fullScanSeconds.
What you can do to enable this is manually add in the flag to jvm parameters in your build.gradle file and the appengineRun task will pass it on to the devappserver:
appengine {
jvmFlags = ["-Dappengine.fullscan.seconds=5"]
}
Then if you want to update, run the gradle assemble
task, it will then explode a whole new app and try to reload that.
from gradle-appengine-plugin.
Thanks @loosebazooka ! That sorted it for me and it'll do for now.
I would still like to not have to run gradle assemble
in order to see the changes, so any other suggestions welcome.
I'm happy enough though. I've now moved my gae project from ant/ivy/eclipse, to gradle/intellij.
That's 2 days of faffing I won't get back ;)
from gradle-appengine-plugin.
Ahh, yes, so it does, I found it only does it on appengineExplodeApp
, and not on assemble
.
I hadn't noticed, thanks for the tip, that saved me a future headache :)
from gradle-appengine-plugin.
Yeah, assemble creates the .war
file, but explode-app creates the exploded-app directory which the devappserver uses to run your application.
from gradle-appengine-plugin.
I set the JVM flag, started a local server via gradlew appengineRun
and when I call gradlew assemble
I get
:backend:appengineExplodeApp FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:appengineExplodeApp'.
> Unable to delete file Path\To\Project\backend\build\exploded-app\WEB-INF\lib\appengine-api-1.0-sdk-1.9.20.jar
I'm on version 1.9.19. Any advice?
from gradle-appengine-plugin.
Are you running on windows by any chance? I wonder if something is loading that jar and windows doesn't allow it to be ovewritten/deleted.
from gradle-appengine-plugin.
@loosebazooka Exactly
from gradle-appengine-plugin.
Works great. Thank you very much!
from gradle-appengine-plugin.
@loosebazooka Thanks.
For me it was only working for resource files (.html/.css/.js), not for source files (.java). So I've added these two lines to the customReload task:
File appengineWebXml = file("${AppEnginePlugin.getExplodedAppDirectory(project)}/WEB-INF/appengine-web.xml")
appengineWebXml.lastModified = new Date().getTime()
Since I'm using gradle version 2.5, I've added the -t option when running the task:
gradle -t customReload
This way it's possible to just save the source/resource, hit F5 on the browser and see the changes.
from gradle-appengine-plugin.
Based on tips from @loosebazooka & @marcosbozzani, for non-windows users I suggest this:
appengine {
appcfg {
jvmFlags = ['-Ddatastore.backing_store=../../src/main/webapp/WEB-INF/appengine-generated/local_db.bin', '-Dappengine.fullscan.seconds=5']
...
And then :
gradle appengineRun
gradle -t assemble
That's the best I've come up with (updates web files and java and "enhances" the DTOs etc.) . It still takes ages to reload and blats away my Session (forcing me to re-login to my webapp) but it's the best I have... Improvement suggestions welcome
from gradle-appengine-plugin.
Has there been any progress on this issue? Would also be very interested
from gradle-appengine-plugin.
Currently the suggested mechanism is to follow the instructions in this
thread
On Jan 23, 2016 12:31, "Robin Hellemans" [email protected] wrote:
Has there been any progress on this issue? Would also be very interested
—
Reply to this email directly or view it on GitHub
#97 (comment)
.
from gradle-appengine-plugin.
Jus run
./gradlew appengineExplodeApp
It should reload everything.
from gradle-appengine-plugin.
I previously said to use gradle -t assemble
but this just spins in a cycle for me now. I'm pretty sure it's because it monitors the classes directory for changes then triggers appengineEnhance on so it goes in an infinite loop of rebuilding. Any suggestions?
from gradle-appengine-plugin.
It looks like --continuous might not work well with data nucleus. Maybe you
could muck around with the task up to date checks to get this working. But
you might just have to initiate the rebuild yourself... :/
On Jul 22, 2016 08:12, "Matt Burns" [email protected] wrote:
I previously said to use gradle -t assemble but this just spins in a
cycle for me now. I'm pretty sure it's because it monitors the classes
directory for changes then triggers appengineEnhance on so it goes in an
infinite loop of rebuilding. Any suggestions?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#97 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPo-smkIUzH1oyUyo8CcXYC-06I67mYks5qYN3ogaJpZM4B_Ry5
.
from gradle-appengine-plugin.
Hi all, I've built a standalone application that 'solves' this problem by monitoring the IDE build output directories and copying the class files to the WEB-INF directory. It allows you to make changes to the source code of the main project and dependencies and have those changes applied in a couple of seconds with no restart. Contributions welcome!
https://github.com/JFL110/gae-hot-reloader
from gradle-appengine-plugin.
Related Issues (20)
- JSPs not supported. HOT 3
- exclude jars HOT 6
- README.md - incorrect endpoints parameters HOT 1
- Skip functional tests HOT 3
- Connection timed out HOT 2
- JSP build step not honoring bootstrap classpath HOT 3
- appengineRun task looking in wrong directory for appengine-web.xml HOT 4
- task compileJava throws warnings HOT 2
- Warning messages when using Gradle 4.0 HOT 6
- services/pubsub: setup topic & subscription on deployment
- Java 8 compatability HOT 7
- Confusing error when src/main/webapp/appengine-web.xml not found HOT 2
- appengineDeploy works but appenginRun fails HOT 4
- GAE_ENV + GAE_RUNTIME HOT 8
- Update to 1.9.55 SDK
- Migrate to 1.9.56 HOT 1
- helloworld-new-plugins java-docs-samples seem to have issues when running locally. HOT 5
- Publish plugin on Gradle Plugin Portal HOT 2
- Failed to apply plugin for gradle 5.0 HOT 4
- Appengine plugin build error for gradle:3.4.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-appengine-plugin.