On Jan 3, 2009, at 1:34 AM, Adam Murdoch wrote:
Hi,
I have just added a 'project-reports' plugin, which adds the task,
property and dependency report tasks to the project. Currently,
these tasks don't do anything different to the equivalent command-
line options, except that they write their output to a file. The
plan is to make them generate HTML reports and make them more
comprehensive.
My problem is that this plugin needs a convention property which
defines the project-wide reports directory. This convention property
is also needed by the java plugin (for the junit report), and will
be needed by any other plugins we add reports to. Currently, this
property is on the java plugin convention. The project-reports
plugin cannot assume that this is present for the project, as the
java plugin may not be used.
I'm thinking of extracting a generic base plugin from the java
plugin, which both the project-reports and java plugins would extend
(in the same way the war/groovy/maven/osgi plugins extends the java
plugin). This plugin would define a small number of properties:
- reportsDir
- archiveTypes
- archivesBaseName
- distsDir
And a small number of tasks:
- clean
- init
- dists
- reports
- upload
ie the plugin would define the skeleton for a build which produces
distributions and reports, which all the other plugins can build on.
Thoughts?
I think extracting a base plugin from the Java plugin makes a lot of
sense. Clean and init are obvious candidates for this. The other tasks/
properties need to be put in there because of the current state of the
java plugin. It might turn out to be a good generic pattern. Or we
might refactor it later, if we extract functionality from the java
plugin to other plugins.
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email