diff --git a/Makefile b/Makefile index b1d36dfe6..4901e21fe 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ all: - go install --ldflags="-X camlistore.org/pkg/buildinfo.GitInfo "`git log --pretty=format:'%ad-%h' --abbrev-commit --date=short -1` `pkg-config --libs sqlite3 1>/dev/null 2>/dev/null && echo "--tags=with_sqlite"` ./pkg/... ./server/... ./cmd/... ./third_party/... + go install --ldflags="-X camlistore.org/pkg/buildinfo.GitInfo "`./misc/gitversion` `pkg-config --libs sqlite3 1>/dev/null 2>/dev/null && echo "--tags=with_sqlite"` ./pkg/... ./server/... ./cmd/... ./third_party/... # Workaround Go bug where the $GOPATH/pkg cache doesn't know about tag changes. # Useful when you accidentally run "make" and then "make presubmit" doesn't work. diff --git a/clients/android/assets/Makefile b/clients/android/assets/Makefile index 3dd98bf65..c3ef5352b 100644 --- a/clients/android/assets/Makefile +++ b/clients/android/assets/Makefile @@ -1,5 +1,5 @@ all: - GOROOT=$(HOME)/armgo GOOS=linux GOARCH=arm CGO_ENABLED=0 $(HOME)/armgo/bin/go build -o camput.arm camlistore.org/cmd/camput + GOROOT=$(HOME)/armgo GOOS=linux GOARCH=arm CGO_ENABLED=0 $(HOME)/armgo/bin/go build -o camput.arm --ldflags="-X camlistore.org/pkg/buildinfo.GitInfo "`../../../misc/gitversion` camlistore.org/cmd/camput /bin/echo -n "package org.camlistore; public final class ChildProcessConfig { // " > ../gen/org/camlistore/ChildProcessConfig.java openssl sha1 camput.arm >> ../gen/org/camlistore/ChildProcessConfig.java /bin/echo "}" >> ../gen/org/camlistore/ChildProcessConfig.java diff --git a/misc/gitversion b/misc/gitversion new file mode 100755 index 000000000..d775d97b7 --- /dev/null +++ b/misc/gitversion @@ -0,0 +1,6 @@ +#!/bin/sh + +ver=$(git show --pretty=format:'%ad-%h' --abbrev-commit --date=short | head -1) +git diff --exit-code >/dev/null || ver=$ver+ +echo $ver +