Skip to content

Commit 5c7086b

Browse files
committed
More build.xml massaging.
Backporting auto starr download to 2.8.x and 2.9.x build.xmls. Trying to get build strings consistent.
1 parent 3a38327 commit 5c7086b

File tree

2 files changed

+51
-17
lines changed

2 files changed

+51
-17
lines changed

build.xml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,22 @@ PROPERTIES
192192
INITIALISATION
193193
============================================================================ -->
194194

195-
<target name="init">
195+
<condition property="starr.absent">
196+
<not><available file="${lib.dir}/scala-library.jar"/></not>
197+
</condition>
198+
199+
<target name="init.starr" if="starr.absent">
200+
<echo level="warn" message="Downloading bootstrap libs. (To do this by hand, run ./pull-binary-libs.sh)"/>
201+
<exec osfamily="unix" vmlauncher="false" executable="./pull-binary-libs.sh" failifexecutionfails="true" />
202+
<exec osfamily="windows" vmlauncher="false" executable="pull-binary-libs.sh" failifexecutionfails="true" />
203+
</target>
204+
205+
<target name="init" depends="init.starr">
196206
<!-- scalac.args.optimise is selectively overridden in certain antcall tasks. -->
197207
<property name="scalac.args.optimise" value=""/>
198208
<!-- scalac.args.quickonly are added to quick.* targets but not others (particularly, locker.)
199209
This is to facilitate testing new command line options which do not yet exist in starr. -->
200-
<property name="scalac.args.quickonly" value=""/>
201-
210+
<property name="scalac.args.quickonly" value=""/>
202211
<property name="scalac.args.all" value="${scalac.args} ${scalac.args.optimise}"/>
203212
<property name="scalac.args.quick" value="${scalac.args.all} ${scalac.args.quickonly}"/>
204213
<!-- Setting-up Ant contrib tasks -->
@@ -212,24 +221,27 @@ INITIALISATION
212221
<condition property="os.win">
213222
<os family="windows"/>
214223
</condition>
215-
<!-- Finding out SVN revision -->
216-
<exec executable="svn" outputproperty="svn.out"
217-
failifexecutionfails="false">
218-
<arg line=" info ${basedir}"/>
219-
</exec>
220-
<propertyregex
221-
property="svn.number" input="${svn.out}" select="\1"
222-
regexp="Revision: ([0-9]+)"
223-
defaultValue="0"/>
224+
225+
<exec osfamily="unix" executable="tools/get-scala-revision" outputproperty="git.describe" failifexecutionfails="false" />
226+
<exec osfamily="windows" executable="tools/get-scala-revision.bat" outputproperty="git.describe" failifexecutionfails="false" />
227+
<!-- some default in case something went wrong getting the revision -->
228+
<property name="git.describe" value="-unknown-"/>
224229
<property name="init.avail" value="yes"/>
225-
<!-- Generating version number -->
230+
231+
<!-- Generating version number -->
226232
<property file="${basedir}/build.number"/>
227233
<property
228234
name="version.number"
229-
value="${version.major}.${version.minor}.${version.patch}.r${svn.number}-b${time.short}"/>
230-
<!-- And print-out what we are building -->
231-
<echo level="info" message="Build number is '${version.number}'"/>
232-
<echo level="info" message="Built ${time.human} from revision ${svn.number} with ${java.vm.name} ${java.version}"/>
235+
value="${version.major}.${version.minor}.${version.patch}.${git.describe}"/>
236+
237+
<!-- And print-out what we are building -->
238+
<echo message=" build time: ${time.human}" />
239+
<echo message=" java version: ${java.vm.name} ${java.version}" />
240+
<echo message=" java args: ${env.ANT_OPTS} ${jvm.opts}" />
241+
<echo message=" javac args: ${javac.args}" />
242+
<echo message=" scalac args: ${scalac.args}" />
243+
<echo message=" build number: ${version.number}" />
244+
233245
<!-- Define tasks that can be run with Starr -->
234246
<path id="starr.classpath">
235247
<pathelement location="${lib.starr.jar}"/>

tools/get-scala-revision.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
rem
3+
rem Usage: get-scala-revison.bat [dir]
4+
rem Figures out current scala revision of a git clone.
5+
rem
6+
rem If no dir is given, current working dir is used.
7+
8+
@setlocal
9+
set _DIR=
10+
if "%*"=="" (
11+
for /f "delims=;" %%i in ('cd') do set "_DIR=%%i"
12+
) else (
13+
set "_DIR=%~1"
14+
)
15+
cd %_DIR%
16+
17+
if exist .git\NUL (
18+
git describe HEAD --abbrev=7 --match dev
19+
)
20+
21+
:end
22+
@endlocal

0 commit comments

Comments
 (0)