fix(tooling): stop passing --flavor to a project with no product flavors - #37
Merged
Merged
Conversation
build.yml offered a `flavor` input and passed it to `flutter build` for
Android and iOS. android/app/build.gradle.kts declares no productFlavors, so:
Task 'assembleDevelopmentRelease' not found in root project 'android'
[!] The android/app/build.gradle.kts file does not define any custom product
flavors. You cannot use the --flavor option.
The web job in the same workflow already omitted --flavor and passed only
--dart-define=ENVIRONMENT, which is why web was the one platform that built.
That working path is the project's actual convention: app_config.dart:33 reads
ENVIRONMENT from .env or --dart-define, and docs/guides/configuration.md
documents env layering, not Gradle flavors.
So: dropped --flavor rather than inventing productFlavors. Adding real flavors
would also need iOS schemes, which cannot be created from a script here, and
would add surface a starter does not need.
Renamed the input `flavor` -> `environment` with a description saying what it
actually controls. Calling it a flavor is what made the mistake plausible.
Artifact names and the concurrency group follow the rename.
Also removed the `--flavor "$ENV"` line from deploy-android.yml's
commented-out build template, so uncommenting it does not reproduce the bug.
deploy-ios.yml had no such line.
Refs #34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
build.ymloffered aflavorinput and passed it toflutter buildfor Androidand iOS.
android/app/build.gradle.ktsdeclares noproductFlavors, so:The working code path settled the design question
The web job in the same workflow already omitted
--flavorand passed only--dart-define=ENVIRONMENT- which is why web was the one platform that built.That is the project's actual convention, not a workaround:
lib/core/config/app_config.dart:33readsENVIRONMENTfrom.envor--dart-define.docs/guides/configuration.mddocuments env layering and dart-defines.productFlavorshave ever existed in the Gradle config.So I dropped
--flavorrather than inventing flavors. Adding real ones would alsorequire iOS schemes, which cannot be created from a script here, and would add
surface a starter does not need.
Renamed the input
flavor->environment, described as "Value passed as--dart-define=ENVIRONMENT". Calling it a flavor is what made the mistakeplausible in the first place. Artifact names and the concurrency group follow the
rename.
Verified by dispatching
platform=androidandroid-apks-development(32,223,960 bytes)platform=webweb-build-development(14,226,706 bytes) - not regressedThat Android APK is the first this repository has ever produced in CI.
Deploy workflows
deploy-android.ymlhad--flavor "$ENV"inside its commented-out buildtemplate; removed, so uncommenting it does not reproduce the bug.
deploy-ios.ymlturned out to have no such line - I asserted it did and theassertion caught me. Neither was dispatched: they publish to stores.
Refs #34