Replace gwt.svnrev with gwt.gitrev.
Change-Id: I3f28322bd6c127b5cfff968c178fa27d001679b8
diff --git a/common.ant.xml b/common.ant.xml
index 654c118..775f263 100755
--- a/common.ant.xml
+++ b/common.ant.xml
@@ -281,20 +281,18 @@
</sequential>
</macrodef>
- <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of a workspace">
+ <macrodef name="gwt.getgitinfo" description="Identifies the GIT info of a workspace">
<sequential>
- <taskdef name="svninfo"
- classname="com.google.gwt.ant.taskdefs.SvnInfo"
- classpath="${gwt.build.lib}/ant-gwt.jar" />
- <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
- outputfileproperty="gwt.svnrev.filename" />
- <!-- Generally, filtering requires a sentinel file so that changes to svn rev will
+ <exec executable="git" searchpath="true" outputproperty="gwt.gitrev">
+ <arg line="rev-parse --short HEAD"/>
+ </exec>
+ <!-- Generally, filtering requires a sentinel file so that changes to git rev will
be noticed as invalidating the previously-generated filter output. This property
names where such a sentinel lives; it is tested with <available/> and created
with <touch/> -->
<mkdir dir="${project.build}/sentinels" />
<property name="filter.sentinel"
- location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}" />
+ location="${project.build}/sentinels/gwt-${gwt.version}-git-${gwt.gitrev}" />
</sequential>
</macrodef>
@@ -305,13 +303,13 @@
description="Source for the filtered copy"/>
<sequential>
<!-- These files must be filtered for versioning -->
- <echo message="Branding as GWT version ${gwt.version}, SVN rev ${gwt.svnrev}"/>
+ <echo message="Branding as GWT version ${gwt.version}, GIT commit ${gwt.gitrev}"/>
<mkdir dir="@{todir}" />
<copy todir="@{todir}" overwrite="true">
<src.fileset/>
<filterset>
<filter token="GWT_VERSION" value="${gwt.version}" />
- <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ <filter token="GWT_GITREV" value="${gwt.gitrev}" />
</filterset>
</copy>
</sequential>
diff --git a/dev/build.xml b/dev/build.xml
index 3336974..fe11cd1 100755
--- a/dev/build.xml
+++ b/dev/build.xml
@@ -203,7 +203,7 @@
</copy>
<!-- Files with hardcoded version information must be filtered -->
- <gwt.getsvninfo />
+ <gwt.getgitinfo />
<condition property="filter.uptodate">
<and>
<available file="${filter.sentinel}" />
diff --git a/dev/core/src/com/google/gwt/dev/About.java b/dev/core/src/com/google/gwt/dev/About.java
index bf758bd..52a3e20 100644
--- a/dev/core/src/com/google/gwt/dev/About.java
+++ b/dev/core/src/com/google/gwt/dev/About.java
@@ -27,7 +27,7 @@
* Tag used for text replacement of the SVN version (split up to avoid
* replacing it here).
*/
- private static final String GWT_SVNREV_TAG = "@GWT_" + "SVNREV@";
+ private static final String GWT_GITREV_TAG = "@GWT_" + "GITREV@";
/**
* Tag used for text replacement of the GWT version (split up to avoid
@@ -36,7 +36,7 @@
private static final String GWT_VERSION_TAG = "@GWT_" + "VERSION@";
private static final String gwtName = "Google Web Toolkit";
- private static final String gwtSvnRev;
+ private static final String gwtGitRev;
private static final GwtVersion gwtVersion;
static {
@@ -49,12 +49,12 @@
}
String tmp;
- tmp = props.getProperty("gwt.svnrev");
+ tmp = props.getProperty("gwt.gitrev");
// Check for null or sentinel value
- if (tmp == null || tmp.equals(GWT_SVNREV_TAG)) {
- gwtSvnRev = "unknown";
+ if (tmp == null || tmp.equals(GWT_GITREV_TAG)) {
+ gwtGitRev = "unknown";
} else {
- gwtSvnRev = tmp;
+ gwtGitRev = tmp;
}
tmp = props.getProperty("gwt.version");
@@ -74,13 +74,24 @@
}
/**
- * Returns the Subversion repository revision number.
+ * Deprecated as GWT is no longer hosted in Subversion, see {@link #getGwtGitRev}.
*
* @return the subversion revision or 'unknown' if the value couldn't be
* determined at build time.
+ * @deprecated See {@link #getGwtGitRev()}.
*/
public static String getGwtSvnRev() {
- return gwtSvnRev;
+ return gwtGitRev;
+ }
+
+ /**
+ * Returns the Git repository commit id.
+ *
+ * @return the Git commit id or 'unknown' if the value couldn't be
+ * determined at build time.
+ */
+ public static String getGwtGitRev() {
+ return gwtGitRev;
}
/**
diff --git a/dev/core/src/com/google/gwt/dev/About.properties b/dev/core/src/com/google/gwt/dev/About.properties
index 46ce966..a12018a 100644
--- a/dev/core/src/com/google/gwt/dev/About.properties
+++ b/dev/core/src/com/google/gwt/dev/About.properties
@@ -1,2 +1,2 @@
gwt.version=@GWT_VERSION@
-gwt.svnrev=@GWT_SVNREV@
\ No newline at end of file
+gwt.gitrev=@GWT_GITREV@
diff --git a/distro-source/common.ant.xml b/distro-source/common.ant.xml
index 7bad06e..b4e4730 100755
--- a/distro-source/common.ant.xml
+++ b/distro-source/common.ant.xml
@@ -16,7 +16,7 @@
</patternset>
<target name="filter" description="Filters distro files for versioning">
- <gwt.getsvninfo />
+ <gwt.getgitinfo />
<condition property="filter.uptodate">
<and>
<available file="${filter.sentinel}" />