summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-12-12 13:25:39 -0800
committerPaul Phillips <paulp@improving.org>2011-12-12 13:28:45 -0800
commit5c7086b3c89ef5b7483bf5750b31dd76ab8b0cee (patch)
tree58db75343a26b8bb22ebf27c4c5db8a7ff34b3dc
parent3a3832700f1a61477931fac730200510ffa6bbb1 (diff)
downloadscala-5c7086b3c89ef5b7483bf5750b31dd76ab8b0cee.tar.gz
scala-5c7086b3c89ef5b7483bf5750b31dd76ab8b0cee.tar.bz2
scala-5c7086b3c89ef5b7483bf5750b31dd76ab8b0cee.zip
More build.xml massaging.
Backporting auto starr download to 2.8.x and 2.9.x build.xmls. Trying to get build strings consistent.
-rw-r--r--build.xml46
-rw-r--r--tools/get-scala-revision.bat22
2 files changed, 51 insertions, 17 deletions
diff --git a/build.xml b/build.xml
index 47e5a679ca..c18da4820d 100644
--- a/build.xml
+++ b/build.xml
@@ -192,13 +192,22 @@ PROPERTIES
INITIALISATION
============================================================================ -->
- <target name="init">
+ <condition property="starr.absent">
+ <not><available file="${lib.dir}/scala-library.jar"/></not>
+ </condition>
+
+ <target name="init.starr" if="starr.absent">
+ <echo level="warn" message="Downloading bootstrap libs. (To do this by hand, run ./pull-binary-libs.sh)"/>
+ <exec osfamily="unix" vmlauncher="false" executable="./pull-binary-libs.sh" failifexecutionfails="true" />
+ <exec osfamily="windows" vmlauncher="false" executable="pull-binary-libs.sh" failifexecutionfails="true" />
+ </target>
+
+ <target name="init" depends="init.starr">
<!-- scalac.args.optimise is selectively overridden in certain antcall tasks. -->
<property name="scalac.args.optimise" value=""/>
<!-- scalac.args.quickonly are added to quick.* targets but not others (particularly, locker.)
This is to facilitate testing new command line options which do not yet exist in starr. -->
- <property name="scalac.args.quickonly" value=""/>
-
+ <property name="scalac.args.quickonly" value=""/>
<property name="scalac.args.all" value="${scalac.args} ${scalac.args.optimise}"/>
<property name="scalac.args.quick" value="${scalac.args.all} ${scalac.args.quickonly}"/>
<!-- Setting-up Ant contrib tasks -->
@@ -212,24 +221,27 @@ INITIALISATION
<condition property="os.win">
<os family="windows"/>
</condition>
- <!-- Finding out SVN revision -->
- <exec executable="svn" outputproperty="svn.out"
- failifexecutionfails="false">
- <arg line=" info ${basedir}"/>
- </exec>
- <propertyregex
- property="svn.number" input="${svn.out}" select="\1"
- regexp="Revision: ([0-9]+)"
- defaultValue="0"/>
+
+ <exec osfamily="unix" executable="tools/get-scala-revision" outputproperty="git.describe" failifexecutionfails="false" />
+ <exec osfamily="windows" executable="tools/get-scala-revision.bat" outputproperty="git.describe" failifexecutionfails="false" />
+ <!-- some default in case something went wrong getting the revision -->
+ <property name="git.describe" value="-unknown-"/>
<property name="init.avail" value="yes"/>
- <!-- Generating version number -->
+
+ <!-- Generating version number -->
<property file="${basedir}/build.number"/>
<property
name="version.number"
- value="${version.major}.${version.minor}.${version.patch}.r${svn.number}-b${time.short}"/>
- <!-- And print-out what we are building -->
- <echo level="info" message="Build number is '${version.number}'"/>
- <echo level="info" message="Built ${time.human} from revision ${svn.number} with ${java.vm.name} ${java.version}"/>
+ value="${version.major}.${version.minor}.${version.patch}.${git.describe}"/>
+
+ <!-- And print-out what we are building -->
+ <echo message=" build time: ${time.human}" />
+ <echo message=" java version: ${java.vm.name} ${java.version}" />
+ <echo message=" java args: ${env.ANT_OPTS} ${jvm.opts}" />
+ <echo message=" javac args: ${javac.args}" />
+ <echo message=" scalac args: ${scalac.args}" />
+ <echo message=" build number: ${version.number}" />
+
<!-- Define tasks that can be run with Starr -->
<path id="starr.classpath">
<pathelement location="${lib.starr.jar}"/>
diff --git a/tools/get-scala-revision.bat b/tools/get-scala-revision.bat
new file mode 100644
index 0000000000..f4dc24b71f
--- /dev/null
+++ b/tools/get-scala-revision.bat
@@ -0,0 +1,22 @@
+@echo off
+rem
+rem Usage: get-scala-revison.bat [dir]
+rem Figures out current scala revision of a git 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%
+
+if exist .git\NUL (
+ git describe HEAD --abbrev=7 --match dev
+)
+
+:end
+@endlocal