Explicitly disable dev/prod tasks based on flag #3358
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With the
production
build flag set tofalse
, gradle may fail when runninggradlew assemble
with an error due to some invalid task dependencies coming from the Compose MP plugin. The reported message is similar to the below:See also discussion in https://lists.apache.org/thread/1l25p9cd9h8ch32jt2ljpmdt3fc9bctq
The error is likely thrown because by default both development and production artifacts are generated on
assemble
. In thewebapp
module, we explicitly depend on tasks and include their outputs based on the variant configured by theproduction
flag, leading to potentially different artifacts being included based on execution order.The current workaround was to set the
production
flag totrue
.Solution
This PR solves the issue of the invalid task dependencies and allows the
production
flag to be set tofalse
again without failing ongradlew assemble
.The
production
flag can be set tofalse
again on our build servers after merging this.Tests
No tests written for gradle execution
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.