Permalink
Browse files

Merge pull request #294 from jsuereth/another-version-fix

Yet another attempt to make the version a  good one
  • Loading branch information...
2 parents fb44bb2 + 62422f3 commit 7c5c06f5f421453c46972d079d0eab5550d848fc @jsuereth jsuereth committed Mar 20, 2012
Showing with 4 additions and 44 deletions.
  1. +2 −5 build.xml
  2. +2 −1 tools/get-scala-commit-date
  3. +0 −17 tools/get-scala-commit-drift
  4. +0 −21 tools/get-scala-commit-drift.bat
View
@@ -285,10 +285,7 @@ INITIALISATION
<exec osfamily="windows" executable="tools/get-scala-commit-sha.bat" outputproperty="git.commit.sha" failifexecutionfails="false" />
<exec osfamily="unix" executable="tools/get-scala-commit-date" outputproperty="git.commit.date" failifexecutionfails="false" />
<exec osfamily="windows" executable="tools/get-scala-commit-date.bat" outputproperty="git.commit.date" failifexecutionfails="false" />
- <exec osfamily="unix" executable="tools/get-scala-commit-drift" outputproperty="git.commit.drift" failifexecutionfails="false" />
- <exec osfamily="windows" executable="tools/get-scala-commit-drift.bat" outputproperty="git.commit.drift" failifexecutionfails="false" />
<!-- some default in case something went wrong getting the revision -->
- <property name="git.commit.drift" value="00000000"/>
<property name="git.commit.sha" value="unknown"/>
<property name="git.commit.date" value="unknown"/>
@@ -298,7 +295,7 @@ INITIALISATION
value="${version.major}.${version.minor}.${version.patch}${version.suffix}${maven.version.suffix}"/>
<property
name="version.number"
- value="${maven.version.number}-${git.commit.date}-${git.commit.drift}-${git.commit.sha}"/>
+ value="${version.major}.${version.minor}.${version.patch}${version.suffix}-${git.commit.date}-${git.commit.sha}"/>
<property
name="osgi.version.number"
value="${version.major}.${version.minor}.${version.patch}.v${git.commit.date}${version.suffix}-${git.commit.sha}"/>
@@ -334,8 +331,8 @@ INITIALISATION
<echo message=" java args: ${env.ANT_OPTS} ${jvm.opts}" />
<echo message=" javac args: ${javac.args}" />
<echo message=" scalac args: ${scalac.args}" />
+ <echo message=" git date: ${git.commit.date}" />
<echo message=" git hash: ${git.commit.sha}" />
- <echo message=" git drift: ${git.commit.drift}" />
<echo message=" maven version: ${maven.version.number}"/>
<echo message=" OSGi version: ${osgi.version.number}" />
<echo message="canonical version: ${version.number}" />
@@ -11,6 +11,7 @@
[[ $# -eq 0 ]] || cd "$1"
lastcommitdate=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 1)
+lastcommithours=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 2)
# 20120324
-echo "${lastcommitdate//-/}"
+echo "${lastcommitdate//-/}-${lastcommithours//:/}"
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-#
-# Usage: get-scala-commit-drift [dir]
-# Figures out current commit drift of a git clone.
-# If no dir is given, current working dir is used.
-#
-# Example output string:
-# 123
-#
-# Build drift = # of commits since last tag.
-
-[[ $# -eq 0 ]] || cd "$1"
-
-# git describe is completely useles to us if we're on a tag, or haven't changed since then.
-# This at least gives us a total number of commits included in a release, which should grow steadily.
-counter=$(git shortlog | grep -E '^[ ]+\w+' | wc -l)
-printf "%08d" "$counter"
@@ -1,21 +0,0 @@
-@echo off
-rem
-rem Usage: get-scala-commit-drift.bat [dir]
-rem Figures out current scala commit drift, of a clone.
-rem
-rem If no dir is given, current working dir is used.
-
-@setlocal
-set _DIR=
-if "%*"=="" (
- for /f "delims=;" %%i in ('cd') do set "_DIR=%%i"
-) else (
- set "_DIR=%~1"
-)
-cd %_DIR%
-
-rem TODO - WRITE THIS
-echo "TODO"
-
-:end
-@endlocal

0 comments on commit 7c5c06f

Please sign in to comment.