Author: limpbizkit
Date: Wed Feb 18 18:56:27 2009
New Revision: 850
Added:
trunk/lib/build/munge.jar (contents, props changed)
Modified:
trunk/build.xml
trunk/src/com/google/inject/Binder.java
Log:
Initial support for building an AOP-free copy of the Guice source tree from
the standard source tree.
The new build.xml creates a complete copy of the entire source tree in
build/no_aop, stripping the lines between these tags:
/*if[AOP]*/
/*end[AOP]*/
Currently I'm only removing Binder#removeInterceptor(), but in a follow-up
CL I'll fix it so that all bytecode-generation code is stripped out. I'll
probably refactor the standard code so this can be done with minimal impact.
With this strategy we produce a full Guice source tree, which we can then
use to run testcases on, do builds, etc. The entire approach is similar to
the one we used with Glazed Lists to erase generics.
The stripping builds on Tom Ball's Munge.java program, with a few
alterations:
- we're a bit more careful about handling /* in end-of-line comments and
Strings
- I wrote an Ant task called MungeTask that supports munging an entire
fileset
http://weblogs.java.net/blog/tball/archive/2006/09/munge_swings_se.html
Modified: trunk/build.xml
==============================================================================
--- trunk/build.xml (original)
+++ trunk/build.xml Wed Feb 18 18:56:27 2009
@@ -115,6 +115,16 @@
</javadoc>
</target>
+ <target name="no_aop"
+ description="Create a copy of the Guice source that doesn't do
bytecode generation.">
+ <taskdef name="munge" classname="MungeTask"
classpath="lib/build/munge.jar"/>
+ <mkdir dir="build/no_aop"/>
+ <munge todir="build/no_aop">
+ <fileset dir="." excludes="build/**/*"/>
+ <arg value="-DNO_AOP" />
+ </munge>
+ </target>
+
<target name="clean.all"
depends="clean"
description="Remove generated files.">
Added: trunk/lib/build/munge.jar
==============================================================================
Binary file. No diff available.
Modified: trunk/src/com/google/inject/Binder.java
==============================================================================
--- trunk/src/com/google/inject/Binder.java (original)
+++ trunk/src/com/google/inject/Binder.java Wed Feb 18 18:56:27 2009
@@ -19,7 +19,6 @@
import com.google.inject.binder.AnnotatedBindingBuilder;
import com.google.inject.binder.AnnotatedConstantBindingBuilder;
import com.google.inject.binder.LinkedBindingBuilder;
-import com.google.inject.PrivateBinder;
import com.google.inject.matcher.Matcher;
import com.google.inject.spi.Message;
import com.google.inject.spi.TypeConverter;
@@ -188,6 +187,7 @@
*/
public interface Binder {
+ /*if[AOP]*/
/**
* Binds a method interceptor to methods matched by class and method
* matchers.
@@ -200,6 +200,7 @@
*/
void bindInterceptor(Matcher<? super Class<?>> classMatcher,
Matcher<? super Method> methodMatcher, MethodInterceptor...
interceptors);
+ /*end[AOP]*/
/**
* Binds a scope to an annotation.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---