halostatue
Is there a way to make a file that always recompiles?
I have a file that returns some information about the current release for our application, such as the git hashref, etc.
Is there a way to tell mix that a particular file should always be recompiled so that this never becomes stale during development?
Marked As Solved
OvermindDL1
Use @external_resource on something relevant like the application module. ![]()
Also Liked
ConnorRigby
Fwiw i just tried @external_resource "/dev/random" and sadly it didn’t work
OvermindDL1
Oh right! I had it backwards!
Well you could add a custom compiler to the compiler stage that runs before elixir and just delete that compiled file, or touch's it or whatever. 
halostatue
I don’t remember what, if anything I did for this, but I’m wondering if @external_resource ".git/HEAD" might work… (or whatever recipe is necessary to make that happen).
(Actually, it might be necessary to read the .git/HEAD to see the ref: to which it refers, e.g., .git/refs/heads/master.)
halostatue
This is a ~95% solution, as it looks like it expects to be a file, and not something transient. If it were possible to specify @external_resource true, that would probably solve my particular use-case.







