ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject <javac.preset>
Date Thu, 28 Oct 2004 12:40:40 GMT
Hi,

can anybody please refresh my memory why we are setting the source
attribute on javac only conditionally?

I've changed build.xml (see below) to always use the source attribute
and it compiles fine with JDK 1.2 to 1.5.

Stefan

Index: build.xml
===================================================================
RCS file: /home/cvs/ant/build.xml,v
retrieving revision 1.437
diff -u -r1.437 build.xml
--- build.xml	28 Oct 2004 09:38:24 -0000	1.437
+++ build.xml	28 Oct 2004 12:33:25 -0000
@@ -376,28 +376,6 @@
 
   <!--
        ===================================================================
-         Set up a preset def for javac depending on
-         the java version
-       ===================================================================
-  -->
-
-  <target name="javac.preset" depends="javac.preset.1.5+,javac.preset.1.5-"/>
-  <target name="javac.preset.1.5+" depends="check_for_optional_packages"
-          if="jdk1.5+">
-    <presetdef name="javac.preset">
-      <javac source="${javac.source}"/>
-    </presetdef>
-  </target>
-  <target name="javac.preset.1.5-" depends="check_for_optional_packages"
-          unless="jdk1.5+">
-    <presetdef name="javac.preset">
-      <javac/>
-    </presetdef>
-  </target>
-
-
-  <!--
-       ===================================================================
          Check to see what optional dependencies are available
        ===================================================================
   -->
@@ -642,17 +620,18 @@
        ===================================================================
   -->
   <target name="build"
-          depends="prepare, check_for_optional_packages, javac.preset"
+          depends="prepare, check_for_optional_packages"
           description="--> compiles the source code">
     <mkdir dir="${build.dir}"/>
     <mkdir dir="${build.classes}"/>
     <mkdir dir="${build.lib}"/>
 
-    <javac.preset srcdir="${java.dir}"
+    <javac srcdir="${java.dir}"
            destdir="${build.classes}"
            debug="${debug}"
            deprecation="${deprecation}"
            target="${javac.target}"
+           source="${javac.source}"
            optimize="${optimize}" >
       <classpath refid="classpath"/>
 
@@ -701,7 +680,7 @@
           </or>
         </not>
       </selector>
-    </javac.preset>
+    </javac>
 
     <copy todir="${build.classes}">
       <fileset dir="${java.dir}">
@@ -1406,15 +1385,16 @@
   <target name="compile-tests" depends="build" if="junit.present">
     <mkdir dir="${build.tests}"/>
 
-    <javac.preset srcdir="${tests.dir}"
+    <javac srcdir="${tests.dir}"
            destdir="${build.tests}"
            debug="${debug}"
            target="${javac.target}"
+           source="${javac.source}"
            deprecation="${deprecation}" >
       <classpath refid="tests-classpath"/>
 
       <selector refid="conditional-patterns"/>
-    </javac.preset>
+    </javac>
 
     <!-- Used by AntlibTest.testAntlibResource: -->
     <jar jarfile="${build.tests}/org/apache/tools/ant/taskdefs/test2-antlib.jar">

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message