I have a deployment chain setup with Jenkins performing a war build using Gradle. I am attempting to add widgetset compilation to that build script and have found this forum discussion: https://vaadin.com/forum#!/thread/3626284
Which I’m guessing nearly addresses the issue, but leaves off the build the gwt configuration. Is there a full sample available of a gradle build of a Vaadin app which incorporates widgetset and theme compilation?
I’m not presently using that plugin, and I’m not sure it would help. To me the documentation makes it look like the kind of think you have to use from project inception, which was over a year ago. Our push works like this:
We created a project over a year ago in Eclipse. And since then it has lives in SVN where the team edits it.
After a commit, Jenkins extracts the project from SVN and builds it using gradle, storing the new war in Nexus.
I visit the QA box and manually (with a script) deploy the new war to that box.
We test the app on the QA box weekly.
When all problems are addressed, I update the build number in the gradle.properties file, and commit that update. That enables arelease build.
I visit Jenkins and direct it to build a release, which it stores in Nexus.
I visit staging and deploy the war for an “in-situ” test as staging it as close to a mirror as prod as can be achieved.
Staging is smoke tested and when all is well, I deploy to prod.
So, gradle is already installed on our build box, and I suspect there is something missing to “tie the bow”. Below is the build.gradle I pieced together from the forum discussion I referenced above:
You are right in that the Gradle Vaadin Plugin will help you a lot when you are starting a new project with its project initialization methods. But, that has just been added for convienience, the real task of the plugin is actually to correctly build the widgetset and theme and ensure you have the right dependencies to do so. So I think it would help you out signigicantly in your task.
To include the plugin into your build you just need to append the following to the top of the build.gradle file:
plugins { id 'fi.jasoft.plugin.vaadin.groovy' version '1.1.6' }
That is all that is needed.
The plugin comes with a
vaadinCompile task that is doing exactly the same as you are doing in your
compileWidgetset task except it also handles some corner cases. The plugin also binds to the
war task just as you do so I think it should work out of the box for you and should should be able to remove a lot of code in the build.gradle file by just including the plugin.