-
Notifications
You must be signed in to change notification settings - Fork 24
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
Version File Instead of Mix.exs #16
Comments
I think a behaviour like the following would be the cleanest:
|
I have no problem with that, but then I guess the question becomes - do we by always have the version in the source somewhere? Or would it bifurcate on |
You can reference a module anywhere, but I wouldn't do it there. We'd provide one called
|
Got it. That seems like it would do what we need. |
Was there anything done on this? I have need of this too so might pick this one up |
Nothing explicitly was done for this, but I have just recently pushed an addition (but not released it yet, because its untested and I still want to try it out) that allows you to manage multiple "readme" files, which may also help with what you're needing. e.g you can say |
@zachdaniel is this README managing feature merged? If so I could take a stab at this. Currently I calculate my project's version using this function: def version() do
version =
Path.join(__DIR__, "VERSION")
|> File.read!()
|> String.trim()
git =
System.cmd("git", ["rev-parse", "--short", "HEAD"])
|> elem(0)
|> String.trim()
[version, git]
|> Enum.reject(&(is_nil(&1) or &1 == ""))
|> Enum.join("-")
end If I'd imagine that what I'd need to do would be to read the |
It kind of is, but it looks for |
I'll see if I can get one done this week! :) I already started a little bit, but looking at the code so far I realise that maybe one would want to point out where to source the version explicitly, rather than have options such as Instead – with backwards compatibility – one could have |
So inside a
mix.exs
file, you can read files frompriv
, and in order to play nicely with different tools that interact with version files, it might be nice to be able read from e.g./priv/VERSION.txt
or something along those lines. Would it be possible to add the ability to specify the location of the version? The@version
tag would then@version File.read!("/priv/VERSION.txt")
in that case.One concern I have is that then
:manage_mix_version?
becomes weird, so it may need to be broken our to (e.g.):manages_version?
and:version_location
with special behavior based on if that ismix.exs
.The text was updated successfully, but these errors were encountered: