- Update JDT compiler to version 3.5.1
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 10 Feb 2010 00:50:40 +0000 (00:50 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 10 Feb 2010 00:50:40 +0000 (00:50 +0000)
- Use JDT Core Batch Compiler download instead of JDT SDK download. It lessens the download size from 40 MB down to 1.6 MB.
- Implement support for two alternative download locations of a file.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@908300 13f79535-47bb-0310-9956-ffa450edef68

build.properties.default
build.xml

index cc47516..9f8fc25 100644 (file)
@@ -67,10 +67,13 @@ wsdl4j-lib.loc=http://repo1.maven.org/maven2/wsdl4j/wsdl4j/${wsdl4j-lib.version}
 wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar
 
 # ----- Eclipse JDT, version 3.2 or later -----
-jdt.home=${base.path}/eclipse/plugins
-jdt.lib=${jdt.home}
-jdt.jar=${jdt.lib}/org.eclipse.jdt.core_3.4.4.v_894_R34x.jar
-jdt.loc=http://archive.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-JDT-SDK-3.4.2.zip
+jdt.version=3.5.1
+jdt.release=R-3.5.1-200909170800
+jdt.home=${base.path}/ecj-${jdt.version}
+jdt.jar=${jdt.home}/ecj-${jdt.version}.jar
+# The download will be moved to the archive area eventually. We are taking care of that in advance.
+jdt.loc.1=http://archive.eclipse.org/eclipse/downloads/drops/${jdt.release}/ecj-${jdt.version}.jar
+jdt.loc.2=http://download.eclipse.org/eclipse/downloads/drops/${jdt.release}/ecj-${jdt.version}.jar
 
 # ----- Tomcat native library -----
 tomcat-native.version=1.1.19
index 35ec7ff..fd20af6 100644 (file)
--- a/build.xml
+++ b/build.xml
 
   <patternset id="files.jasper-jdt">
     <include name="org/eclipse/jdt/core/compiler/**"/>
+    <include name="org/eclipse/jdt/core/JDTCompilerAdapter*"/>
+    <include name="org/eclipse/jdt/internal/antadapter/**"/>
     <include name="org/eclipse/jdt/internal/compiler/**"/>
-    <include name="org/eclipse/jdt/internal/core/util/CommentRecorder*"/>
   </patternset>
 
   <patternset id="files.tomcat-dbcp">
@@ -1657,10 +1658,11 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
     </antcall>
 
     <!-- Download src and build Jasper JDT bundle -->
-    <antcall target="downloadzip">
-      <param name="sourcefile" value="${jdt.loc}"/>
+    <antcall target="downloadfile-2">
+      <param name="sourcefile.1" value="${jdt.loc.1}"/>
+      <param name="sourcefile.2" value="${jdt.loc.2}"/>
       <param name="destfile" value="${jdt.jar}"/>
-      <param name="destdir" value="${base.path}"/>
+      <param name="destdir" value="${jdt.home}"/>
     </antcall>
     <mkdir dir="${jasper-jdt.home}"/>
     <condition property="no.build.jasper-jdt">
@@ -1817,6 +1819,37 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
     <get src="${sourcefile}" dest="${destfile}" />
   </target>
 
+  <target name="downloadfile-2" unless="exist" depends="testexist">
+    <!-- Download the file from the two alternative locations -->
+    <mkdir dir="${destdir}" />
+
+    <antcall target="trydownload">
+      <param name="sourcefile" value="${sourcefile.1}" />
+    </antcall>
+
+    <antcall target="trydownload">
+      <param name="sourcefile" value="${sourcefile.2}" />
+    </antcall>
+
+    <available file="${destfile}" property="exist"/>
+    <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
+  </target>
+
+  <target name="trydownload.check" depends="setproxy">
+    <condition property="trydownload.run">
+      <and>
+        <not>
+          <available file="${destfile}" />
+        </not>
+        <http url="${sourcefile}" />
+      </and>
+    </condition>
+  </target>
+
+  <target name="trydownload" if="trydownload.run" depends="trydownload.check">
+    <!-- Downloads a file if not yet downloaded and the source URL is available -->
+    <get src="${sourcefile}" dest="${destfile}" />
+  </target>
 
   <!-- ======================= Macros, Taskdefs etc ======================== -->