You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tdk-dev@turbine.apache.org by jv...@apache.org on 2001/10/20 21:17:05 UTC
cvs commit: jakarta-turbine-tdk/src/tdk/apps/2 build.xml
jvanzyl 01/10/20 12:17:05
Modified: src/tdk/apps/2 build.xml
Log:
- adding target to fully qualify import statements. this target will
-> copy the java sources into a tmp directory
-> compile with debugging info
-> replace the import statement set in each each source file
with a sorted list of fully qualified imports
-> move the sources with the fully qualified import statements
into the place of the original sources
this is the first step in migrating a 2.x app toward a 3.x
application.
Revision Changes Path
1.28 +55 -1 jakarta-turbine-tdk/src/tdk/apps/2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/2/build.xml,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- build.xml 2001/10/09 22:41:41 1.27
+++ build.xml 2001/10/20 19:17:05 1.28
@@ -473,7 +473,61 @@
<classpath refid="classpath"/>
</javac>
</target>
-
+
+ <!-- ================================================================ -->
+ <!-- S C R U B I M P O R T S -->
+ <!-- ================================================================ -->
+
+ <target name="scrub-imports">
+ <taskdef
+ name="scrub"
+ classname="org.apache.tools.ant.taskdefs.optional.importscrubber.ImportScrubberTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
+ <property name="tmp.dir" value="tmp"/>
+
+ <!-- Make sure our tmp directory doesn't exist before we start -->
+ <delete dir="${tmp.dir}"/>
+
+ <!-- Copy our source files into the temporary directory -->
+ <copy todir="${tmp.dir}">
+ <fileset dir="${src.dir}/java"/>
+ </copy>
+
+ <!--
+ Note that I compile the code with debug info first. This
+ prevents the compiler from removing class references
+ (i.e., by inlining static finals and such).
+ -->
+
+ <javac
+ deprecation="false"
+ debug="true"
+ optimize="false"
+ srcdir="${tmp.dir}"
+ destdir="${tmp.dir}">
+ <classpath refid="classpath"/>
+ </javac>
+
+ <!-- Fully qualify the imports -->
+ <scrub
+ root="${tmp.dir}"
+ format="nobreaks"
+ recurse="true"
+ />
+
+ <!-- Get rid of the class files in our tmp directory -->
+ <delete>
+ <fileset dir="${tmp.dir}" includes="**/*.class"/>
+ </delete>
+
+ <copy todir="${src.dir}/java" overwrite="true">
+ <fileset dir="${tmp.dir}"/>
+ </copy>
+
+ </target>
+
<!-- ================================================================ -->
<!-- C L E A N -->
<!-- ================================================================ -->
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-tdk-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-tdk-dev-help@jakarta.apache.org