Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotenv per subproject #109

Open
seglo opened this issue Jun 18, 2021 · 1 comment
Open

dotenv per subproject #109

seglo opened this issue Jun 18, 2021 · 1 comment

Comments

@seglo
Copy link

seglo commented Jun 18, 2021

Hi. In an sbt multi project build I tried defining a envFilename per sub project (each sub project has a main method). Since this setting must be in global scope (ThisBuild) it doesn't matter whether it's defined at the top level or within a subproject in an sbt file, the last value it was set with will be used.

Is there a way to scope dotenv files to projects?

@seglo
Copy link
Author

seglo commented Jun 19, 2021

The self-answered SO post here may define what i'm seeing better

https://stackoverflow.com/questions/33417180/how-to-define-build-scoped-settings-in-multi-project-sbt-builds

Keys in larger scopes like ThisBuild or Global seem to be able to be defined in any project, but "later" projects will then take priority. This is probably related to the order the projects are processed. I have expected that the order of evaluation of lazy vals would affect this, and I've tried adding .aggregate(child) to the root project to force the child project to be evaluated first, but it didn't seem to have any effect: globally scoped values from child project still have priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant