One of the big changes for 1.6 will be the ComponentHelper, and the creation of tasks and types just before their use. In ant1.5 some of the tasks were created before use, but an attempt to create the task was made when the task was read. If a task definition
was available, then the task would be created at parse time. If not - it'll be created before use.
In addition, all core and optional tasks were instantiated ( Class.forName ) at startup. That resulted in 2-3 seconds wasted in creation of tasks we'll never use. Most of the time was actually spent processing stack traces for the optional tasks with missing dependencies.
There are few benefits of doing Class.forName() just before executing:
* we only create the tasks that we need. 2-3 seconds out of each build may look very little.
* with help from the classloader task, we can push jars into the loader ( like junit.jar) and then optional tasks would work even if their deps are not in ant/lib
The ComponentHelper provides 2 hook mechanisms: you can replace the default helper by setting ant.componentHelper reference ( preferably before calling ant), and you can chain a custom helper. This can be done from withing a normal ant task.
The hooks allow arbitrary "antlibs" to be hooked into ant.
What's missing:
* pass the namespace to the task, so antlibs can use it
* implement a default antlib using the namespace as a java package.
So far I've seen no major backward compatibility problems - gump seems happy
and all projects I use build without problems ( well, many times they don't - but not because of ant ).
Technical stuff
Saturday, January 11, 2003
Ant: delayed task creation
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2003
(44)
-
▼
January
(23)
- Authorization and security
- Kde3.1 on RedHat 8
- Java security
- Tahoe
- JMX-enable a bean in 3 easy steps
- TLD listeners and context initialization
- int[] versus Integer or IntHolder
- Weblog and wiki
- Load balancing in jk
- Configurable TagPool in 50
- It's already done - nntp/rss gateway
- Using context params or JNDI for configuration
- SingleThreadedModel may be usefull
- Precompile the JSPs
- Classloader fun with JDK1.4
- More JMX in tomcat5
- Extension points in tomcat5
- UserDatabase needs changes
- Ser2xml
- Starting to "blog"
- Ant: delayed task creation
- import in ant
- JMX support in ThreadPool
-
▼
January
(23)
No comments:
Post a Comment