fix: support reading environment files as build assets#193
Open
techouse wants to merge 3 commits into
Open
Conversation
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.
This pull request enhances the environment variable loading logic in the
envied_generatorpackage to support reading environment files as build assets, improving compatibility with build systems and enabling better testability. It also introduces new tests for workspace resolution and updates dependencies to support these changes.Environment variable loading improvements:
loadEnvs,loadEnvsFromPaths, and_loadEnvfunctions inload_envs.dartto accept an optionalBuildStepparameter, allowing environment files to be loaded as build assets when available. This enables compatibility with build systems likebuild_runnerand improves testability. [1] [2] [3]_assetIdForPathhelper to resolve asset IDs for relative paths when aBuildStepis provided, gracefully handling errors and mock build steps.buildStepparameter from the code generator to the environment loading functions to ensure consistent asset resolution during code generation.Testing and dependencies:
workspace_resolution_test.dartto test loading environment files as build assets, including scenarios with inherited environment files and default files, ensuring correctness in a build system context.build_testas a development dependency to support the new tests.