File tree 3 files changed +15
-51
lines changed 3 files changed +15
-51
lines changed Original file line number Diff line number Diff line change @@ -232,21 +232,22 @@ INITIALISATION
232
232
<os family =" windows" />
233
233
</condition >
234
234
235
- <exec osfamily =" unix" executable =" tools/get-scala-revision" outputproperty =" svn.number " failifexecutionfails =" false" />
236
- <exec osfamily =" windows" executable =" tools/get-scala-revision.bat" outputproperty =" svn.number " failifexecutionfails =" false" />
235
+ <exec osfamily =" unix" executable =" tools/get-scala-revision" outputproperty =" git.describe " failifexecutionfails =" false" />
236
+ <exec osfamily =" windows" executable =" tools/get-scala-revision.bat" outputproperty =" git.describe " failifexecutionfails =" false" />
237
237
<!-- some default in case something went wrong getting the revision -->
238
- <property name =" svn.number " value =" 0 " />
238
+ <property name =" git.describe " value =" -unknown- " />
239
239
240
240
<property name =" init.avail" value =" yes" />
241
241
242
242
<!-- Generating version number -->
243
243
<property file =" ${ basedir } /build.number" />
244
244
<property
245
245
name =" version.number"
246
- value =" ${ version.major } .${ version.minor } .${ version.patch } .r${ svn.number } -b${ time.short } " />
246
+ value =" ${ version.major } .${ version.minor } .${ version.patch } .${ git.describe } " />
247
+
247
248
<!-- And print-out what we are building -->
248
249
<echo level =" info" message =" Build number is '${ version.number } '" />
249
- <echo level =" info" message =" Built ${ time.human } from revision ${ svn.number } with ${ java.vm.name } ${ java.version } " />
250
+ <echo level =" info" message =" Built ${ time.human } from revision ${ git.describe } with ${ java.vm.name } ${ java.version } " />
250
251
251
252
<!-- Local libs (developer use.) -->
252
253
<mkdir dir =" ${ lib-extra.dir } " />
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
#
3
3
# Usage: get-scala-revision [dir]
4
- # Figures out current scala revision of an svn checkout or
5
- # a git-svn mirror (or a git clone.)
4
+ # Figures out current scala revision of a git clone.
6
5
#
7
6
# If no dir is given, current working dir is used.
8
7
9
- DIR=" "
10
- if [ $# -eq 0 ]; then
11
- DIR=` pwd`
12
- else
13
- DIR=$1
14
- fi
8
+ [[ -n " $1 " ]] && cd " $1 "
15
9
16
- cd $DIR
17
-
18
- if [ -d .svn ]; then
19
- # 2>&1 to catch also error output (e.g. svn warnings)
20
- svn info . 2>&1 | grep ^Revision | sed ' s/Revision: //'
21
- elif [ -d .git ]; then
22
- GIT_PAGER=cat
23
- # this grabs more than one line because otherwise if you have local
24
- # commits which aren't in git-svn it won't see any revision.
25
- git log -10 | grep git-svn-id | head -1 | sed ' s/[^@]*@\([0-9]*\).*/\1/'
26
- else
27
- echo " ${DIR} doesn't appear to be git or svn dir." >&2
28
- echo 0
29
- exit 1
30
- fi
10
+ # dev should be a tag at the merge-base of master and the
11
+ # most recent release.
12
+ git describe head --abbrev=7 --match dev
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
rem
3
3
rem Usage: get-scala-revison.bat [dir]
4
- rem Figures out current scala revision of an svn checkout or
5
- rem a git-svn mirror (or a git clone.)
4
+ rem Figures out current scala revision of a git clone.
6
5
rem
7
6
rem If no dir is given, current working dir is used.
8
7
9
- if " %OS% " NEQ " Windows_NT" (
10
- echo " Sorry, your version of Windows is too old to run Scala."
11
- goto :eof
12
- )
13
8
@ setlocal
14
-
15
9
set _DIR =
16
10
if " %* " == " " (
17
11
for /f " delims=;" %%i in ('cd') do set " _DIR = %%i "
@@ -20,23 +14,10 @@ if "%*"=="" (
20
14
)
21
15
cd %_DIR%
22
16
23
- if exist .svn\NUL (
24
- rem 2> &1 to catch also error output (e.g. svn warnings)
25
- for /f " skip=4 tokens=2" %%i in ('svn info') do (
26
- echo %%i
27
- goto :end
28
- )
29
- ) else ( if exist .git\NUL (
30
- set _GIT_PAGER = type
31
- rem this grabs more than one line because otherwise if you have local
32
- rem commits which aren't in git-svn it won't see any revision.
33
- rem TODO: git log -10 | findstr git-svn-id | ...
17
+ if exist .git\NUL (
18
+ git describe head --abbrev=7 --match dev
34
19
echo 0
35
- ) else (
36
- echo %_DIR% doesn't appear to be git or svn dir.
37
- echo 0
38
- exit 1
39
- ))
20
+ )
40
21
41
22
:end
42
23
@ endlocal
You can’t perform that action at this time.
0 commit comments