Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 62764 invoked from network); 8 Sep 2003 15:33:38 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Sep 2003 15:33:38 -0000 Received: (qmail 49915 invoked by uid 500); 8 Sep 2003 15:32:53 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 49844 invoked by uid 500); 8 Sep 2003 15:32:52 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 49717 invoked by uid 500); 8 Sep 2003 15:32:50 -0000 Received: (qmail 49693 invoked from network); 8 Sep 2003 15:32:49 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 8 Sep 2003 15:32:49 -0000 Received: (qmail 82832 invoked by uid 1539); 8 Sep 2003 13:43:32 -0000 Date: 8 Sep 2003 13:43:32 -0000 Message-ID: <20030908134332.82831.qmail@minotaur.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/docs ant_task_guidelines.html X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N peterreilly 2003/09/08 06:43:32 Modified: docs ant_task_guidelines.html Log: attempt to remove java 1.1 requirement from guildline add reference to check.xml Revision Changes Path 1.12 +26 -17 ant/docs/ant_task_guidelines.html Index: ant_task_guidelines.html =================================================================== RCS file: /home/cvs/ant/docs/ant_task_guidelines.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ant_task_guidelines.html 4 Jun 2003 12:18:55 -0000 1.11 +++ ant_task_guidelines.html 8 Sep 2003 13:43:32 -0000 1.12 @@ -26,7 +26,7 @@

Use built in helper classes

-Ant includes helper tasks to simplify mauch of your work. Be warned that +Ant includes helper tasks to simplify much of your work. Be warned that these helper classes will look very different in ant2.0 from these 1.x versions. However it is still better to use them than roll your own, for development, maintenance and code size reasons. @@ -82,6 +82,10 @@ spaces, lots of others aren't -spaces have more consistency across editors and platforms. Some IDEs (JEdit) can highlight tabs, to stop you accidentally inserting them +

+There is an ant build file check.xml in the main ant directory with runs + checkstyle over + ant's source code.

Attributes and elements

Use the Ant introspection based mapping of attributes into Java datatypes, @@ -176,33 +180,38 @@ they can, because their needless work can trickle through the entire build, test and deploy process. -

Support Java 1.1 through Java 1.4

+

Support Java 1.2 through Java 1.4

-Ant is designed to support Java1.1: to build on it, to run on it. Sometimes -functionality of tasks have to degrade in that environment -<touch> -is a case in point- this is usually due to library limitations; +Ant1.5 and lower was designed to support Java1.1. Ant1.6 and higher +is designed to support Java1.2: to build on it, to run on it. Sometimes +functionality of tasks have to degrade in that environment +- this is usually due to library limitations; such behaviour change must always be noted in the documentation.

-What is problematic is code which is dependent on Java1.2 features --Collections, Reader and Writer classes, extra methods in older classes. +What is problematic is code which is dependent on Java1.3 features +-java.lang.reflect.Proxy, or Java1.4 features - java.io.nio for example. +Be also aware of extra +methods in older classes - like StringBuffer#append(StringBuffer). These can not be used directly by any code and still be able to compile -and run on a Java 1.1 system. So please stick to the older collection -classes, and the older IO classes. If a new method in an existing class +and run on a Java 1.2 system. +If a new method in an existing class is to be used, it must be used via reflection and the NoSuchMethodException handled somehow.

-What if code simply does not work on Java1.1? It can happen. It will +What if code simply does not work on Java1.2? It can happen. It will probably be OK to have the task as an optional task, with compilation -restricted to Java1.2 or later through build.xml modifications. +restricted to Java1.3 or later through build.xml modifications. Better still, use reflection to link to the classes at run time.

Java 1.4 adds a new optional change to the language itself, the assert keyword, which is only enabled if the compiler is told -to compile 1.4 version source. Clearly with the 1.1 compatibility requirement, +to compile 1.4 version source. Clearly with the 1.2 compatibility requirement, Ant tasks can not use this keyword. They also need to move away from using the JUnit assert() method and call assertTrue() instead. - +

+Java 1.5 will (perhaps) add a new keyword - enum, one should avoid +this for future compatibility.

Refactor

@@ -256,8 +265,8 @@

-Remember also that Ant 1.x is designed to compile and run on Java1.1, so -you should test on Java 1.1 as well as any later version which you use. +Remember also that Ant 1.x is designed to compile and run on Java1.2, so +you should test on Java 1.2 as well as any later version which you use. You can download an old SDK from Sun for this purpose.

Finally, run a full build test before and after you start @@ -427,7 +436,7 @@

Checklist before submitting a patch

  • Added code complies with style guidelines -
  • Code compiles and runs on Java1.1 +
  • Code compiles and runs on Java1.2
  • New member variables are private, and provide public accessor methods if access is actually needed.
  • Existing test cases succeed. @@ -446,7 +455,7 @@
  • Java file begins with Apache copyright and license statement.
  • Task does not depend on GPL or LGPL code.
  • Source code complies with style guidelines -
  • Code compiles and runs on Java1.1 +
  • Code compiles and runs on Java1.2
  • Member variables are private, and provide public accessor methods if access is actually needed.
  • Maybe Task has failonerror attribute to control failure behaviour --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org