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: dev/core/build.xml
===================================================================
--- dev/core/build.xml (revision 3606)
+++ dev/core/build.xml (working copy)
@@ -57,14 +57,6 @@
<property name="filter.pattern" value="com/google/gwt/dev/About.properties" />
- <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}" >
- <fileset dir="src" includes="${filter.pattern}" />
- </gwt.revfilter>
- <touch file="${src.filtered}/gwt.version-${gwt.version}" />
- </target>
-
<target name="build" depends="build.alldeps.jar" description="Compiles this project">
<!--
There are classes missing from dev/core that are necessary
@@ -77,17 +69,14 @@
<gwt.javac srcdir="src-dummy" destdir="${javac.out-dummy}" />
<!-- Files with hardcoded version information must be filtered -->
+ <!-- We used to play with some touch filenames to be sure the filter values changed,
+ but with svn-version branding, the logging and testing seems costlier than just
+ re-doing the work each time.... -->
<property name="src.filtered" location="${project.build}/src-filtered" />
- <condition property="filter.uptodate">
- <and>
- <available file="${src.filtered}/gwt.version-${gwt.version}" />
- <uptodate>
- <srcfiles dir="src" includes="${filter.pattern}" />
- <globmapper from="*" to="${src.filtered}/*" />
- </uptodate>
- </and>
- </condition>
- <antcall target="-filter.src" />
+ <delete dir="${src.filtered}" failonerror="false" />
+ <gwt.revfilter todir="${src.filtered}" >
+ <fileset dir="src" includes="${filter.pattern}" />
+ </gwt.revfilter>
<mkdir dir="${javac.out}" />
<gwt.javac srcdir="super" excludes="com/google/gwt/dev/jjs/intrinsic/"/>
@@ -103,7 +92,8 @@
</gwt.javac>
<copy todir="${javac.out}">
<fileset dir="src" includes="**/*.properties"/>
- </copy>
+ <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 3613)
+++ 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.