No, I didn't test the timing impact, and certainly not over several cycles.
Yeah, I didn't realize it'd have the trickle-down... I thought user was an
independent compile, and didn't think about the samples at all.

Sigh.

Re-done with sentinels restored and expanded for svnrev.  Note that the
svnrev value might contain characters illegal in Windows filenames, so
there's an extra hop for that... also, we need to break the svninfo-getting
bits out from gwt.revfilter, because we need that info to know what
sentinels to look for to decide whether or not to filter.  Finally, the
about.{txt,html} were never sentinel-protected, which I think might make
them wrong (in that an old version could be generated, a svn up performed,
and the new one not generated) and certainly adds some time, so I
sentinel'ed them along the same pattern.





On Thu, Sep 4, 2008 at 1:25 PM, Scott Blum <[EMAIL PROTECTED]> wrote:

> Freeland, did you actually try this out?  You're killing the desk-rebuild
> experience here, because when you force gwt-dev to rebuild every time, that
> trickles down into a rebuild of user, samples, the whole nine yards.
>
> Adding gwt.svnrev into the name of the sentinel file would be a much better
> alternative.
>
> On Thu, Sep 4, 2008 at 3:19 AM, Freeland Abbott <
> [EMAIL PROTECTED]> wrote:
>
>> That's as good a cause for a -1 as any, I suppose... attached no longer
>> uses non-static "this" in static context, and also untangles (by removal)
>> the creation of a sentinel file to gate the filtering.  I believe the
>> sentinel exists so that a change in gwt.version will cause the extant file
>> to be considered out-of-date regardless of timestamp, but we'd now need
>> another one for change in gwt.svnrev, and it seems the original test (much
>> less the expanded one!) is probably more expensive than just refiltering
>> each time!
>>
>> On Wed, Sep 3, 2008 at 2:24 PM, Scott Blum <[EMAIL PROTECTED]> wrote:
>>
>>> 'Fraid I'm going to have to give this a -1 on account of not compiling.
>>> :)
>>>
>>> On Wed, Sep 3, 2008 at 12:23 PM, Freeland Abbott <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>> Rajeev noted that my initializer in About.java is an instance
>>>> initializer, not (as intended) a static one.  Things appear to work anyway
>>>> because they pull from about.txt and .html, but programmatic access would 
>>>> be
>>>> uninitialized....
>>>>
>>>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Index: common.ant.xml
===================================================================
--- common.ant.xml	(revision 3622)
+++ common.ant.xml	(working copy)
@@ -199,10 +199,10 @@
     </sequential>
   </macrodef>
 
-  <macrodef name="gwt.revfilter" description="Filters files for versioning">
-    <attribute name="todir" description="Destination for the filtered copy"/>
-    <element name="src.fileset" implicit="true" 
-      description="Source for the filtered copy"/>
+  <macrodef name="gwt.svninfo" description="Identifies the SVN info of a workspace">
+    <attribute name="propsvnrev" description="Property name to get SVN revision info"/>
+    <attribute name="propsvnfile" 
+        description="Propety name to get SVN revision, as filename"/>
     <sequential>
       <exec outputproperty="svn.info" executable="svn" 
           failifexecutionfails="false" logError="true">
@@ -225,18 +225,36 @@
         replace="\1"
         defaultValue="unknown"
         casesensitive="false" />
-      <property name="gwt.svnrev" 
+      <property name="@{propsvnrev}" 
         value="[EMAIL PROTECTED]"/>
+      <!-- Windows NTFS and FAT don't like ':' or '@', and we need a sentinel file to test
+           for out-of-dateness, so this is a filename-acceptable equivalent to svnrev -->
+      <propertyregex property="@{propsvnfile}"
+        input="${gwt.svnrev}"
+        regexp="[:@]"
+        replace="-"
+        defaultValue="${gwt.svnrev}"/>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="gwt.revfilter" description="Filters files for versioning">
+    <attribute name="todir" description="Destination for the filtered copy"/>
+    <attribute name="gwtversion" description="GWT version number" />
+    <attribute name="svninfo" description="SVN branch and version info" />
+    
+    <element name="src.fileset" implicit="true" 
+      description="Source for the filtered copy"/>
+    <sequential>
       <!-- These files must be filtered for versioning -->
       <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_VERSION" value="@{gwtversion}" />
+          <filter token="GWT_SVNREV" value="@{svninfo}" />
         </filterset>
       </copy>
-      <echo message="Branding as GWT version ${gwt.version}, SVN rev ${gwt.svnrev}"/>
+      <echo message="Branding as GWT version @{gwtversion}, SVN rev @{svninfo}"/>
     </sequential>
   </macrodef>
 
Index: dev/common.ant.xml
===================================================================
--- dev/common.ant.xml	(revision 3622)
+++ dev/common.ant.xml	(working copy)
@@ -19,8 +19,14 @@
   <target name="build" depends="compile" description="Build and package this project">
     <mkdir dir="${gwt.build.lib}" />
     <gwt.jar>
-      <fileset dir="src" excludes="**/package.html" />
-      <fileset dir="${gwt.core.root}/src" excludes="**/package.html" />
+      <fileset dir="src">
+        <exclude name="**/package.html"/>
+        <exclude name="com/google/gwt/dev/About.properties"/>
+      </fileset>
+      <fileset dir="${gwt.core.root}/src">
+        <exclude name="**/package.html"/>
+        <exclude name="com/google/gwt/dev/About.properties"/>
+      </fileset>
       <fileset dir="${gwt.core.root}/super" excludes="**/package.html" />
       <fileset dir="${javac.out}" />
       <fileset dir="${gwt.core.build}/bin" />
Index: dev/core/build.xml
===================================================================
--- dev/core/build.xml	(revision 3622)
+++ dev/core/build.xml	(working copy)
@@ -59,10 +59,11 @@
 
   <target name="-filter.src" description="Creates filtered copies of source files" unless="filter.uptodate">
     <delete dir="${src.filtered}" failonerror="false" />
-    <gwt.revfilter todir="${src.filtered}" >
+    <gwt.revfilter todir="${src.filtered}" gwtversion="${gwt.version}" svninfo="${gwt.svnrev}">
       <fileset dir="src" includes="${filter.pattern}" />
     </gwt.revfilter>
     <touch file="${src.filtered}/gwt.version-${gwt.version}" />
+    <touch file="${src.filtered}/gwt.svnrev-${gwt.svnrev.filename}" />
   </target>
 
   <target name="build" depends="build.alldeps.jar" description="Compiles this project">
@@ -78,9 +79,11 @@
 
     <!-- Files with hardcoded version information must be filtered -->
     <property name="src.filtered" location="${project.build}/src-filtered" />
+    <gwt.svninfo propsvnrev="gwt.svnrev" propsvnfile="gwt.svnrev.filename" />
     <condition property="filter.uptodate">
       <and>
         <available file="${src.filtered}/gwt.version-${gwt.version}" />
+        <available file="${src.filtered}/gwt.svnrev-${gwt.svnrev.filename}" />
         <uptodate>
           <srcfiles dir="src" includes="${filter.pattern}" />
           <globmapper from="*" to="${src.filtered}/*" />
@@ -102,8 +105,9 @@
       </classpath>
     </gwt.javac>
     <copy todir="${javac.out}">
-      <fileset dir="src" includes="**/*.properties"/>
-                </copy>
+      <fileset dir="src" includes="**/*.properties" excludes="${filter.pattern}"/>
+      <fileset dir="${src.filtered}" includes="**/*.properties"/>
+    </copy>
   </target>
 
   <target name="checkstyle" description="Static analysis of source">
Index: dev/core/src/com/google/gwt/dev/About.java
===================================================================
--- dev/core/src/com/google/gwt/dev/About.java	(revision 3622)
+++ dev/core/src/com/google/gwt/dev/About.java	(working copy)
@@ -32,13 +32,10 @@
 
   public static String GWT_VERSION;
 
-  {
-    Class<? extends About> myClass = this.getClass();
-    String propsPath = myClass.getName().replace('.', '/').concat(".properties");
+  static {
     Properties props = new Properties();
     try {
-      InputStream instream = myClass.getClassLoader().getResourceAsStream(
-          propsPath);
+      InputStream instream = About.class.getResourceAsStream("About.properties");
       props.load(instream);
     } catch (IOException iox) {
       // okay... we use default values, then.
Index: distro-source/common.ant.xml
===================================================================
--- distro-source/common.ant.xml	(revision 3622)
+++ distro-source/common.ant.xml	(working copy)
@@ -17,9 +17,28 @@
   </patternset>
 
   <target name="filter" description="Filters distro files for versioning">
-    <gwt.revfilter todir="${project.build}" >
+    <gwt.svninfo propsvnrev="gwt.svnrev" propsvnfile="gwt.svnrev.filename"/>
+    <echo message="Tests in ${project.build}"/>
+    <condition property="filter.uptodate">
+      <and>
+        <available file="${project.build}/gwt.version-${gwt.version}" />
+        <available file="${project.build}/gwt.svnrev-${gwt.svnrev.filename}" />
+        <uptodate>
+          <srcfiles dir="../core/src" />
+          <globmapper from="*" to="${project.build}/*" />
+        </uptodate>
+      </and>
+    </condition>
+    <antcall target="-filter.src" />
+  </target>
+ 
+  <target name="-filter.src" unless="filter.uptodate">
+    <gwt.revfilter todir="${project.build}" 
+        gwtversion="${gwt.version}" svninfo="${gwt.svnrev}" >
       <fileset dir="../core/src" />
     </gwt.revfilter>
+    <touch file="${project.build}/gwt.version-${gwt.version}" />
+    <touch file="${project.build}/gwt.svnrev-${gwt.svnrev.filename}" />
   </target>
 
   <target name="clean" description="Cleans this project's intermediate and output files">

Reply via email to