You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the production mode auto-activates when you call Gradle with task vaadinBuildFrontend. That's because Gradle doesn't use profiles the way Maven does. However, this approach is pretty fragile:
There is a bug: the production mode doesn't auto-activate if you just call ./gradlew and you have defaultTasks("clean", "vaadinBuildFrontend", "build") in your build.gradle file.
The production mode doesn't auto-activate if you have build.dependsOn("vaadinBuildFrontend") in your build.gradle file.
You can enforce the production mode by using vaadin { productionMode = true } in your build.gradle file, but it's not a solid approach to control this by editing build.gradle - you don't want your CI to edit your build.gradle
We should either fix this behavior for the productionMode to auto-activate properly whenever vaadinBuildFrontend task is to be executed, or we should make the productionMode setting respond to e.g. ./gradlew blah blah -Dvaadin.productionMode=true.
I wonder if there is any merit in having a WAR file with development mode. The disadvantage is apparent: customers would drop a WAR file into production, and the WAR file will start downloading and populating node_modules. But on the development machine one can wish to e.g. deploy a WAR file into local Tomcat for development purposes, which is also a valid approach. And vice versa - some people who do not want to touch JavaScript at all, will be pretty fine developing having the productionMode turned on.
Sounds to me that the best strategy is to let the developer flip the productionMode switch (either by system property, or permanently in build.gradle), and the build should accommodate accordingly (e.g. auto-call vaadinBuildFrontend but only when the productionMode is true; and auto-call vaadinPrepareFrontend always when the plugin is applied).
This would however auto-create frontend/ folders for every java-based subproject. We should document cleanly how to use the plugin in multi-project builds:
plugins {
id 'java'
id "com.vaadin" version "0.5.1" apply false
}
project("lib") {
apply plugin: 'java'
}
project("web") {
apply plugin: 'war'
apply plugin: "com.vaadin"
}
The text was updated successfully, but these errors were encountered:
Currently the production mode auto-activates when you call Gradle with task
vaadinBuildFrontend
. That's because Gradle doesn't use profiles the way Maven does. However, this approach is pretty fragile:./gradlew
and you havedefaultTasks("clean", "vaadinBuildFrontend", "build")
in your build.gradle file.build.dependsOn("vaadinBuildFrontend")
in your build.gradle file.vaadin { productionMode = true }
in yourbuild.gradle
file, but it's not a solid approach to control this by editingbuild.gradle
- you don't want your CI to edit yourbuild.gradle
We should either fix this behavior for the productionMode to auto-activate properly whenever
vaadinBuildFrontend
task is to be executed, or we should make the productionMode setting respond to e.g../gradlew blah blah -Dvaadin.productionMode=true
.I wonder if there is any merit in having a WAR file with development mode. The disadvantage is apparent: customers would drop a WAR file into production, and the WAR file will start downloading and populating node_modules. But on the development machine one can wish to e.g. deploy a WAR file into local Tomcat for development purposes, which is also a valid approach. And vice versa - some people who do not want to touch JavaScript at all, will be pretty fine developing having the productionMode turned on.
Sounds to me that the best strategy is to let the developer flip the
productionMode
switch (either by system property, or permanently in build.gradle), and the build should accommodate accordingly (e.g. auto-callvaadinBuildFrontend
but only when the productionMode is true; and auto-callvaadinPrepareFrontend
always when the plugin is applied).This would however auto-create
frontend/
folders for every java-based subproject. We should document cleanly how to use the plugin in multi-project builds:The text was updated successfully, but these errors were encountered: