Browse Source

generate app version from latest git tag

Will 13 years ago
parent
commit
3895b7c3f6
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Makefile
  2. 1 1
      src/epgsql.app.src

+ 2 - 2
Makefile

@@ -1,5 +1,5 @@
 NAME		:= epgsql
-VERSION		:= 1.4
+VERSION		:= $(shell git describe --always --tags)
 
 ERL  		:= erl
 ERLC 		:= erlc
@@ -43,7 +43,7 @@ ebin/%.beam : src/%.erl
 	$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
 
 ebin/%.app : src/%.app.src Makefile
-	sed -e s/VERSION/$(VERSION)/g $< > $@
+	sed -e s/git/\"$(VERSION)\"/g $< > $@
 
 test_ebin/%.beam : test_src/%.erl
 	$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<

+ 1 - 1
src/epgsql.app.src

@@ -1,6 +1,6 @@
 {application, epgsql,
  [{description, "PostgreSQL Client"},
-  {vsn, "VERSION"},
+  {vsn, git},
   {modules, [pgsql, pgsql_binary, pgsql_connection, pgsql_fdatetime,
              pgsql_idatetime, pgsql_sock, pgsql_types]},
   {registered, []},