Ok, what about code like this:
version: version()
> ...
> defp version do
> "0.0.1"
> end
or like this:
version: File.read!("VERSION")
as you might imagine from these examples, a regex or an AST transformation
will never be able to handle several common cases such as these.
On Friday, September 30, 2016 at 1:07:49 AM UTC-4, Jaap Frolich wrote:
>
> Why is there no way to modify it programmatically? We can do a pretty good
> regex probably, but maybe even better is to do a ast-transformation of some
> kind? Why do you think it is impossible.
>
> What I really liked about elixir, is that publishing a package is so
> simple out of the box, with no additional packages needed.
>
> Updating version number is fairly trivial, as I think almost all of the
> community is striving to adhere to semver. And bumping version number
> tagging it etc. is quite repetitive and prone to error. That's why we have
> computers! ;)
>
> Cheers,
>
> Jaap
>
>
> On Friday, September 30, 2016 at 12:34:20 AM UTC+8, Eric Entin wrote:
>>
>> Unfortunately, it is not as simple as you might think to "bump the
>> version number," as mix.exs is any arbitrary Elixir code. There is no way
>> to safely modify it programmatically.
>>
>> -1 on this, as everyone may have different versions or release processes
>> and I don't think it's worth the maintenance burden in Elixir Core. I
>> welcome it as a hex package, however, since there is nothing here AFAIK
>> that requires it to be implemented in core.
>>
>> On Thursday, September 29, 2016 at 5:34:14 AM UTC-4, Jaap Frolich wrote:
>>>
>>> I agree this would be a very nice feature to have. It would be even
>>> nicer if it automatically bumps up the version number, and perhaps a
>>> command line argument to do a major release.
>>>
>>> Cheers,
>>>
>>> Jaap
>>>
>>> On Wednesday, September 21, 2016 at 8:25:16 PM UTC+8, Aleksei Matiushkin
>>> wrote:
>>>>
>>>> Indeed, but the name is likely not a problem.
>>>> • mix release
>>>> • mix tag.publish
>>>> • mix full.publish
>>>>
>>>> whatever. The question is whether this task is really needed.
>>>>
>>>> On Wed, Sep 21, 2016 at 2:21 PM, Ben Wilson <[email protected]>
>>>> wrote:
>>>>
>>>>> Problematically, Elixir already has a notion of what a "release" (
>>>>> http://erlang.org/doc/design_principles/release_structure.html) is
>>>>> and it has nothing to do with hex. We probably do not want to overload
>>>>> that
>>>>> term.
>>>>>
>>>>> mix hex.publish is also already a thing, so we'd need some other name
>>>>> here.
>>>>>
>>>>> On Wednesday, September 21, 2016 at 7:48:54 AM UTC-4, Allen Madsen
>>>>> wrote:
>>>>>>
>>>>>> I agree with Alexsei that it is pretty standard. If you want to do
>>>>>> something off the beaten path, you still have that option with the
>>>>>> individual commands available.
>>>>>>
>>>>>> Allen Madsen
>>>>>> http://www.allenmadsen.com
>>>>>>
>>>>>> On Wed, Sep 21, 2016 at 7:29 AM, Alexsei Matiushkin <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> For hex publishing, this process is more or less the same and it’s
>>>>>>> implicitly proven by `rake release` existence. I have no problem
>>>>>>> writing
>>>>>>> shell function, but in my opinion, mix task here is more appropriate
>>>>>>> since
>>>>>>> it has a direct access to the version and in shell I would parse
>>>>>>> `mix.exs`
>>>>>>> which is a bit ugly.
>>>>>>>
>>>>>>> Anyway, I got your reasoning, thx for reaching out.
>>>>>>>
>>>>>>> On Wed, Sep 21, 2016 at 1:19 PM, Louis Pilfold <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Heya
>>>>>>>>
>>>>>>>> I'm not a fan of this as everyone will have a different steps in
>>>>>>>> their
>>>>>>>> release process.
>>>>>>>>
>>>>>>>> Personally I would just write a little shell script (or mix task)
>>>>>>>> to do this.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Louis
>>>>>>>>
>>>>>>>> On 21 September 2016 at 12:17, Alexsei Matiushkin
>>>>>>>> <[email protected]> wrote:
>>>>>>>> > It would be handy to have a mix task, similar to what rake
>>>>>>>> release does in
>>>>>>>> > the ruby world
>>>>>>>> >
>>>>>>>> https://github.com/bundler/bundler/blob/master/lib/bundler/gem_helper.rb#L55
>>>>>>>> > :
>>>>>>>> >
>>>>>>>> > mix.compile
>>>>>>>> > mix test
>>>>>>>> > source control commit with tag=CURRENT_VERSION
>>>>>>>> > mix hex.publish
>>>>>>>> >
>>>>>>>> > Everything save for the third item in this list might be easily
>>>>>>>> done with
>>>>>>>> > shell alias/function, but this beast in the middle literally
>>>>>>>> screws me up:
>>>>>>>> > sometimes I forget to push a tag, sometimes I forget to update a
>>>>>>>> version,
>>>>>>>> > etc. It would be really great to implement the functionality that
>>>>>>>> tries
>>>>>>>> > tests, reads a version from mix.exs, uses it as a tag in commit,
>>>>>>>> publishes
>>>>>>>> > to hex.pm if everything above succeeded.
>>>>>>>> >
>>>>>>>> > I could put some effort in implementing this, but I really need
>>>>>>>> kinda
>>>>>>>> > feedback on whether it’s needed and—if so—some guidance on how to
>>>>>>>> approach
>>>>>>>> > it.
>>>>>>>> >
>>>>>>>> > Rgds, AM-73
>>>>>>>> >
>>>>>>>> > --
>>>>>>>> > You received this message because you are subscribed to the
>>>>>>>> Google Groups
>>>>>>>> > "elixir-lang-core" group.
>>>>>>>> > To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an
>>>>>>>> > email to [email protected].
>>>>>>>> > To view this discussion on the web visit
>>>>>>>> >
>>>>>>>> https://groups.google.com/d/msgid/elixir-lang-core/0095086f-2c3d-4dce-9263-c71e72151486%40googlegroups.com
>>>>>>>> .
>>>>>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>>> the Google Groups "elixir-lang-core" group.
>>>>>>>> To unsubscribe from this topic, visit
>>>>>>>> https://groups.google.com/d/topic/elixir-lang-core/MMB3ru8Rcxc/unsubscribe
>>>>>>>> .
>>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>>> [email protected].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/elixir-lang-core/CAM-pwt5DQCck2G6G9B%3D7EMMBOs%3D0rnjjxHcBv%3D9gqXQZ_ynagw%40mail.gmail.com
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> *Alexsei Matiushkin*, Software Engineer - R&D
>>>>>>>
>>>>>>> Office (+34) 935 679 834
>>>>>>>
>>>>>>> <http://kantox.com> <http://kantox.com/en>
>>>>>>>
>>>>>>> 6 Bevis Marks, London, EC3A 7BA, United Kingdom
>>>>>>> Torre Mapfre, Planta 10, Marina, 16-18, 08005 Barcelona, Spain
>>>>>>> *kantox.com <http://kantox.com/>*
>>>>>>>
>>>>>>> <http://www.linkedin.com/company/1871617>
>>>>>>> <http://www.linkedin.com/company/1871617>[image: LinkedIn]
>>>>>>> <https://www.linkedin.com/company/1871617>
>>>>>>> <https://twitter.com/kantox>[image: Twitter]
>>>>>>> <https://twitter.com/kantox>
>>>>>>> <http://www.youtube.com/user/kantoxfx>[image: YouTube]
>>>>>>> <https://www.youtube.com/user/kantoxfx>
>>>>>>>
>>>>>>> Kantox Limited is registered in England and Wales as a Limited
>>>>>>> Company: No 07657495 and is authorised by the Financial Conduct
>>>>>>> Authority,
>>>>>>> FRN: 580343, as a Payments Institution under the Payment Services
>>>>>>> Regulations 2009. This email is subject to professional secrecy. It is
>>>>>>> confidential and for the exclusive use of its addressee. If you are not
>>>>>>> the
>>>>>>> addressee, you are not authorised to read, keep or disseminate it.
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "elixir-lang-core" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/elixir-lang-core/CAGF5_6f-83u_Uue8QEYEw74S%2BBF_hpt9VmOAKtA0QxK2XB%3D5kA%40mail.gmail.com
>>>>>>>
>>>>>>> <https://groups.google.com/d/msgid/elixir-lang-core/CAGF5_6f-83u_Uue8QEYEw74S%2BBF_hpt9VmOAKtA0QxK2XB%3D5kA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "elixir-lang-core" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/elixir-lang-core/MMB3ru8Rcxc/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/elixir-lang-core/6e0f7ab2-db66-432c-b5e2-b1c150591c52%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/elixir-lang-core/6e0f7ab2-db66-432c-b5e2-b1c150591c52%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Alexsei Matiushkin*, Software Engineer - R&D
>>>>
>>>> Office (+34) 935 679 834
>>>>
>>>> <http://kantox.com> <http://kantox.com/en>
>>>>
>>>> 6 Bevis Marks, London, EC3A 7BA, United Kingdom
>>>> Torre Mapfre, Planta 10, Marina, 16-18, 08005 Barcelona, Spain
>>>> *kantox.com <http://kantox.com/>*
>>>>
>>>> <http://www.linkedin.com/company/1871617>
>>>> <http://www.linkedin.com/company/1871617>[image: LinkedIn]
>>>> <https://www.linkedin.com/company/1871617>
>>>> <https://twitter.com/kantox>[image: Twitter]
>>>> <https://twitter.com/kantox>
>>>> <http://www.youtube.com/user/kantoxfx>[image:
>>>> YouTube] <https://www.youtube.com/user/kantoxfx>
>>>>
>>>> Kantox Limited is registered in England and Wales as a Limited Company:
>>>> No 07657495 and is authorised by the Financial Conduct Authority, FRN:
>>>> 580343, as a Payments Institution under the Payment Services Regulations
>>>> 2009. This email is subject to professional secrecy. It is confidential
>>>> and
>>>> for the exclusive use of its addressee. If you are not the addressee, you
>>>> are not authorised to read, keep or disseminate it.
>>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/c77971a2-808a-493e-a987-5aae5aa6f4d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.