Code Monkey home page Code Monkey logo

rebar_vsn_plugin's People

Contributors

deadzen avatar ericbmerritt avatar jwilberding avatar tsloughter avatar ztmr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rebar_vsn_plugin's Issues

rebar vsn plugin does not seem to affect reltool.config

While it is nice the we can sync the version in app to git tag.
But the version does not propage to reltool.config {rel, "hello", "1", <<<<----- still a default 1, rather than tag version.
Possible to add that to the plugin? It looks like be a huge win. Thanks

Make it rebar3 compatible

The reason why we want to make it compatible with rebar3 is that some other procjects (for example erlcron) uses it. If it is used as a plugin from erlcron, rebar3 will complain about missing rebar_vsn_plugin:init/1 function.

rebar get-deps and semver

If other vsn than ".*" is used in rebar deps section rebar will fail to get dependency because the process of changing version to tag is done at post_compile time.

ERROR: Dependency dir /media/dev/erlang-app/deps/depapp failed application validation with reason:
{version_mismatch,{"/media/dev/erlang-app/deps/depapp/src/depapp.app.src",
{expected,"2.0.*"},
{has,"semver"}}}.
ERROR: 'get-deps' failed while processing /media/dev/erlang-app: rebar_abort

Сompilation of a plugin

It should be mentioned that in order to use this plugin as a dep this section should be added to rebar.config:

{plugin_dir, "deps/rebar_vsn_plugin/src"}.

Without this section if we run

rebar get-deps
rebar compile

All the code will be compiled but the plugin would not work, because at the compile of the application it wasnot already compiled. Plugin_dir will force compiling of a plugin and will load it at run-time.

Compilation failure trying to use reltool.config as .app file

This changes should be done to prevent from failing of compilation if rel directory is set in sub_dirs. Rebar plugin mechanism is calling post and pre hooks for targets both for app files and for reltool.config files, and functions are provided to check wherether it is app dir or rel dir.

rebar_vsn_plugin/src/rebar_vsn_plugin.erl
@@ -29,14 +29,19 @@
 %% API
 %%============================================================================
 post_compile(Config, AppFile) ->
-    {AppName, SrcDetail} =
-        get_app_meta(Config, AppFile),
-    case proplists:get_value(vsn, SrcDetail) of
-        "semver" ->
-            do_vsn_replacement(AppName, Config, AppFile);
-        semver ->
-            do_vsn_replacement(AppName, Config, AppFile);
-        _ ->
+    case rebar_app_utils:is_app_dir() of
+        {true, AppFile} ->
+            {AppName, SrcDetail} =
+                get_app_meta(Config, AppFile),
+            case proplists:get_value(vsn, SrcDetail) of
+                "semver" ->
+                    do_vsn_replacement(AppName, Config, AppFile);
+                semver ->
+                    do_vsn_replacement(AppName, Config, AppFile);
+                _ ->
+                    ok
+            end;
+        false ->
             ok
     end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.