Default fallback for global property, or "How to check if a val is defined globally?" #1640
Unanswered
Sailsman63
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please forgive me if this turns out to be a very basic Scala/Ammonite question. I'm coming at it as a complete novice - actually, I'm evaluating mill as a build tool for a pure-java application ecosystem.
Is there a way to assign a default value to a variable if and only if that variable is not defined in
~/.mill/ammonite/predefScript.sc
?My use case is for a set of plugins to a full-stack application. Obviously, the plugins have a compile-time dependency on the core application. The application is not available as a maven/ivy/other dependency, and would not be well-suited to such deployment anyway. Therefore, the various plugins must treat it as an un-managed jar(s). I don't want to assume that all plugin developers have a full, standard dev checkout for the core application - they may have an actual working production installation - or that they even keep all of their development projects as siblings in the same folder. I also want the most likely case - siblings of a core development build - to just work out of the box.
In the absence of something like #1226, this is the only thing I've come up with that would allow a single configuration for multiple plugin builds.
Beta Was this translation helpful? Give feedback.
All reactions