fix: skip vaadinBuildFrontend in development mode - #25002
Conversation
The vaadinBuildFrontend task builds the production bundle and writes a
flow-build-info.json token with productionMode=true, so it is only
meaningful for production builds. When it is wired into the build graph
in development mode (e.g. jar.dependsOn('vaadinBuildFrontend')) the build
failed with a task validation error, because the production-only token
build service is registered by FlowPlugin only in production mode.
Running it in development mode would also overwrite the development token
and make the running application behave as in production.
Guard the task with onlyIf so it is skipped unless production mode is
enabled.
Fixes #25000
|
The task is guarded with Gradle's onlyIf rather than by marking the token Skipping also matters beyond the crash: running vaadinBuildFrontend in Verified against the issue's reproducer: with the released 25.2.2 plugin the |
|
…#25006) This PR cherry-picks changes from the original PR #25002 to branch 25.2. --- #### Original PR description > The Gradle vaadinBuildFrontend task is now skipped when Vaadin production > mode is not enabled. This prevents development and multi-module builds from > failing when the task is part of the build graph, and avoids producing a > production configuration while running in development mode. > > Fixes #25000 Co-authored-by: Marco Collovati <marco@vaadin.com>



The Gradle vaadinBuildFrontend task is now skipped when Vaadin production
mode is not enabled. This prevents development and multi-module builds from
failing when the task is part of the build graph, and avoids producing a
production configuration while running in development mode.
Fixes #25000