You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dan Diephouse <da...@envoisolutions.com> on 2003/05/05 08:54:44 UTC

[Attributes] Release and Maven Plugin

Hi all,

I'm using commons-attributes in some of my projects and I'd like to make 
it easier for people who are using those projects to use commons-attributes.

So, I guess my first question is, are there plans for a release of 
commons-attributes (whether alpha, beta, whatever)?  I think there 
should be support for excludes/includes in the ant task before there is 
one.  Is there anything else stopping some kind of release?  If that is 
the only thing stopping a alpha/beta release I will put a patch together 
in the next day or two.

Second, I have a maven plugin for it which just calls the ant task, 
nothing too fantastic. In your maven.xml you need to put a preGoal in 
for java:compile that does an <attainGoal name="attributes:compile"> so 
the attributes get compiled.  I would think if there was an attributes 
release I could get it in Maven cvs before b10. Otherwise, it could go 
in the commons-attributes cvs if you're interested.

The plugin is here:
http://junktoast.com/attributes-plugin.tar.gz


- Dan


-- 
Dan Diephouse
http://junktoast.com
"Everyone knows that Custer died at the Battle of
Little Big Horn. What this book presupposes is....
maybe he didn't?" -- Eli Cash, Royal Tenenbaums



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


Re: [Attributes] Release and Maven Plugin

Posted by Martin van den Bemt <ml...@mvdb.net>.
Btw next commit will be style changes (lot of tabs,etc) and some cvs
admin, to enable keyword substition and updating licensing.

Mvgr,
Martin
On Thu, 2003-05-22 at 01:16, Dan Diephouse wrote:
> Thanks Martin.
> 
> Here's a new patch that fixes a test failure.  I didn't notice it 
> earlier because the ignore test failure property was set.
> 
> - Dan
> 
> Martin van den Bemt wrote:
> 
> > I am going to have a look at this (didn't zap the mail after all) and
> > apply the patch tomorrow night. 
> > 
> > Mvgr,
> > Martin
> > 
> > On Wed, 2003-05-21 at 19:35, Dan Diephouse wrote:
> > 
> >>Well, I finally got around to fixing the commons-attributes ant task. 
> >>Here's a patch.  I hope there are still attributes developers around who 
> >>will apply this! :)
> 
> ----
> 

> Index: src/java/org/apache/commons/attributes/task/AttributesCompiler.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/java/org/apache/commons/attributes/task/AttributesCompiler.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesCompiler.java
> --- src/java/org/apache/commons/attributes/task/AttributesCompiler.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/java/org/apache/commons/attributes/task/AttributesCompiler.java	21 May 2003 23:15:19 -0000
> @@ -67,9 +67,9 @@
>  import java.io.*;
>  import java.util.Properties;
>  
> -import org.apache.tools.ant.Task;
>  import org.apache.tools.ant.BuildException;
>  import org.apache.tools.ant.DirectoryScanner;
> +import org.apache.tools.ant.taskdefs.MatchingTask;
>  
>  /**
>   * <p><code>AttributesCompilerOld</code> is an Ant Task which
> @@ -80,12 +80,12 @@
>   * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
>   * @version $Revision: $
>   */
> -public class AttributesCompiler extends Task {
> +public class AttributesCompiler extends MatchingTask {
>  
>  	private File src;
>  	private File dest;
>  	private AttributesBuilder builder = new AttributesBuilder();
> -
> +    
>  	public void setSrc(File src) {
>  		this.src = src;
>  	}
> @@ -111,9 +111,7 @@
>  	}
>  
>  	private String[] getJavaFiles() {
> -		DirectoryScanner scanner = new DirectoryScanner();
> -		scanner.setBasedir(src);
> -		scanner.setIncludes(new String[]{"**/*.java"});
> +        DirectoryScanner scanner = getDirectoryScanner(src);
>  		scanner.scan();
>  		return scanner.getIncludedFiles();
>  	}
> Index: src/test/org/apache/commons/attributes/AttributesTest.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes/AttributesTest.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesTest.java
> --- src/test/org/apache/commons/attributes/AttributesTest.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/test/org/apache/commons/attributes/AttributesTest.java	21 May 2003 23:15:19 -0000
> @@ -75,6 +75,7 @@
>  import org.apache.commons.attributes.impl.DefaultAttributeFinder;
>  import org.apache.commons.attributes.task.AttributesCompiler;
>  import org.apache.commons.attributes.task.TagSet;
> +import org.apache.tools.ant.Project;
>  
>  /**
>   * Test case for using the Attributes facade with the default implementation.
> @@ -114,7 +115,7 @@
>  		DefaultAttributeFinder.removeSearchPath(searchPath);
>          Attributes.setAttributeFinder(null);
>          
> -        Thread.sleep(20000);
> +        //Thread.sleep(20000);
>  	}
>  
>      public static class TestAttributesLoader implements AttributeFinder {
> @@ -201,7 +202,10 @@
>  	public void testAttributes()
>  		throws IOException, NoSuchMethodException, NoSuchFieldException {
>  		AttributesCompiler attributesCompiler = new AttributesCompiler();
> -		attributesCompiler.setSrc(new File("src" + File.separator + "test"));
> +        attributesCompiler.setSrc(new File("src" + File.separator + "test"));
> +        attributesCompiler.setIncludes("**/*.java");
> +        attributesCompiler.setExcludes("");
> +        attributesCompiler.setProject( new Project() );
>  		attributesCompiler.setDest(targetDir);
>  		attributesCompiler.execute();
>  
> 
> ----
> 

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



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


Re: [Attributes] Release and Maven Plugin

Posted by Dan Diephouse <da...@envoisolutions.com>.
Thanks a lot!
- Dan

Martin van den Bemt wrote:
> Hi Dan,
> 
> Patch applied (sorry that it was a bit later, but had to stay overinight
> in a hotel..)
> Thanx :)
> 
> Mvgr,
> Martin
> 



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


Re: [Attributes] Release and Maven Plugin

Posted by Martin van den Bemt <ml...@mvdb.net>.
Hi Dan,

Patch applied (sorry that it was a bit later, but had to stay overinight
in a hotel..)
Thanx :)

Mvgr,
Martin

On Thu, 2003-05-22 at 01:16, Dan Diephouse wrote:
> Thanks Martin.
> 
> Here's a new patch that fixes a test failure.  I didn't notice it 
> earlier because the ignore test failure property was set.
> 
> - Dan
> 
> Martin van den Bemt wrote:
> 
> > I am going to have a look at this (didn't zap the mail after all) and
> > apply the patch tomorrow night. 
> > 
> > Mvgr,
> > Martin
> > 
> > On Wed, 2003-05-21 at 19:35, Dan Diephouse wrote:
> > 
> >>Well, I finally got around to fixing the commons-attributes ant task. 
> >>Here's a patch.  I hope there are still attributes developers around who 
> >>will apply this! :)
> 
> ----
> 

> Index: src/java/org/apache/commons/attributes/task/AttributesCompiler.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/java/org/apache/commons/attributes/task/AttributesCompiler.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesCompiler.java
> --- src/java/org/apache/commons/attributes/task/AttributesCompiler.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/java/org/apache/commons/attributes/task/AttributesCompiler.java	21 May 2003 23:15:19 -0000
> @@ -67,9 +67,9 @@
>  import java.io.*;
>  import java.util.Properties;
>  
> -import org.apache.tools.ant.Task;
>  import org.apache.tools.ant.BuildException;
>  import org.apache.tools.ant.DirectoryScanner;
> +import org.apache.tools.ant.taskdefs.MatchingTask;
>  
>  /**
>   * <p><code>AttributesCompilerOld</code> is an Ant Task which
> @@ -80,12 +80,12 @@
>   * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
>   * @version $Revision: $
>   */
> -public class AttributesCompiler extends Task {
> +public class AttributesCompiler extends MatchingTask {
>  
>  	private File src;
>  	private File dest;
>  	private AttributesBuilder builder = new AttributesBuilder();
> -
> +    
>  	public void setSrc(File src) {
>  		this.src = src;
>  	}
> @@ -111,9 +111,7 @@
>  	}
>  
>  	private String[] getJavaFiles() {
> -		DirectoryScanner scanner = new DirectoryScanner();
> -		scanner.setBasedir(src);
> -		scanner.setIncludes(new String[]{"**/*.java"});
> +        DirectoryScanner scanner = getDirectoryScanner(src);
>  		scanner.scan();
>  		return scanner.getIncludedFiles();
>  	}
> Index: src/test/org/apache/commons/attributes/AttributesTest.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes/AttributesTest.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesTest.java
> --- src/test/org/apache/commons/attributes/AttributesTest.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/test/org/apache/commons/attributes/AttributesTest.java	21 May 2003 23:15:19 -0000
> @@ -75,6 +75,7 @@
>  import org.apache.commons.attributes.impl.DefaultAttributeFinder;
>  import org.apache.commons.attributes.task.AttributesCompiler;
>  import org.apache.commons.attributes.task.TagSet;
> +import org.apache.tools.ant.Project;
>  
>  /**
>   * Test case for using the Attributes facade with the default implementation.
> @@ -114,7 +115,7 @@
>  		DefaultAttributeFinder.removeSearchPath(searchPath);
>          Attributes.setAttributeFinder(null);
>          
> -        Thread.sleep(20000);
> +        //Thread.sleep(20000);
>  	}
>  
>      public static class TestAttributesLoader implements AttributeFinder {
> @@ -201,7 +202,10 @@
>  	public void testAttributes()
>  		throws IOException, NoSuchMethodException, NoSuchFieldException {
>  		AttributesCompiler attributesCompiler = new AttributesCompiler();
> -		attributesCompiler.setSrc(new File("src" + File.separator + "test"));
> +        attributesCompiler.setSrc(new File("src" + File.separator + "test"));
> +        attributesCompiler.setIncludes("**/*.java");
> +        attributesCompiler.setExcludes("");
> +        attributesCompiler.setProject( new Project() );
>  		attributesCompiler.setDest(targetDir);
>  		attributesCompiler.execute();
>  
> 
> ----
> 

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



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


Re: [Attributes] Release and Maven Plugin

Posted by Dan Diephouse <da...@envoisolutions.com>.
Thanks Martin.

Here's a new patch that fixes a test failure.  I didn't notice it 
earlier because the ignore test failure property was set.

- Dan

Martin van den Bemt wrote:

> I am going to have a look at this (didn't zap the mail after all) and
> apply the patch tomorrow night. 
> 
> Mvgr,
> Martin
> 
> On Wed, 2003-05-21 at 19:35, Dan Diephouse wrote:
> 
>>Well, I finally got around to fixing the commons-attributes ant task. 
>>Here's a patch.  I hope there are still attributes developers around who 
>>will apply this! :)


Re: [Attributes] Release and Maven Plugin

Posted by Martin van den Bemt <ml...@mvdb.net>.
I am going to have a look at this (didn't zap the mail after all) and
apply the patch tomorrow night. 

Mvgr,
Martin

On Wed, 2003-05-21 at 19:35, Dan Diephouse wrote:
> Well, I finally got around to fixing the commons-attributes ant task. 
> Here's a patch.  I hope there are still attributes developers around who 
> will apply this! :)
> 
> Basically this patch just makes AttributesCompiler extend MatchingTask 
> so it has automatic support for includes and excludes.  Now my maven.xml 
> file looks something like so:
> 
> <taskdef name="attr" 
> classname="org.apache.commons.attributes.task.AttributesCompiler" 
> classpathref="attributes-classpath"/>
> 	
>      <attr
>        src="${pom.build.sourceDirectory}"
>        dest="${basedir}/target/classes">
>          <include name="${maven.attributes.src.includes}"/>
>          <exclude name="${maven.attributes.src.excludes}"/>
>      </attr>
> 
> Also, why is there a Thread.sleep(20000) in the AttributesTest?
> 
> - Dan
> 
> Dan Diephouse wrote:
> > Hi all,
> > 
> > I'm using commons-attributes in some of my projects and I'd like to make 
> > it easier for people who are using those projects to use 
> > commons-attributes.
> > 
> > So, I guess my first question is, are there plans for a release of 
> > commons-attributes (whether alpha, beta, whatever)?  I think there 
> > should be support for excludes/includes in the ant task before there is 
> > one.  Is there anything else stopping some kind of release?  If that is 
> > the only thing stopping a alpha/beta release I will put a patch together 
> > in the next day or two.
> > 
> > Second, I have a maven plugin for it which just calls the ant task, 
> > nothing too fantastic. In your maven.xml you need to put a preGoal in 
> > for java:compile that does an <attainGoal name="attributes:compile"> so 
> > the attributes get compiled.  I would think if there was an attributes 
> > release I could get it in Maven cvs before b10. Otherwise, it could go 
> > in the commons-attributes cvs if you're interested.
> > 
> > The plugin is here:
> > http://junktoast.com/attributes-plugin.tar.gz
> > 
> > 
> > - Dan
> > 
> > 
> 
> ----
> 

> Index: src/java/org/apache/commons/attributes/task/AttributesCompiler.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/java/org/apache/commons/attributes/task/AttributesCompiler.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesCompiler.java
> --- src/java/org/apache/commons/attributes/task/AttributesCompiler.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/java/org/apache/commons/attributes/task/AttributesCompiler.java	21 May 2003 17:34:58 -0000
> @@ -67,9 +67,9 @@
>  import java.io.*;
>  import java.util.Properties;
>  
> -import org.apache.tools.ant.Task;
>  import org.apache.tools.ant.BuildException;
>  import org.apache.tools.ant.DirectoryScanner;
> +import org.apache.tools.ant.taskdefs.MatchingTask;
>  
>  /**
>   * <p><code>AttributesCompilerOld</code> is an Ant Task which
> @@ -80,7 +80,7 @@
>   * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
>   * @version $Revision: $
>   */
> -public class AttributesCompiler extends Task {
> +public class AttributesCompiler extends MatchingTask {
>  
>  	private File src;
>  	private File dest;
> @@ -111,9 +111,7 @@
>  	}
>  
>  	private String[] getJavaFiles() {
> -		DirectoryScanner scanner = new DirectoryScanner();
> -		scanner.setBasedir(src);
> -		scanner.setIncludes(new String[]{"**/*.java"});
> +		DirectoryScanner scanner = this.getDirectoryScanner(src);
>  		scanner.scan();
>  		return scanner.getIncludedFiles();
>  	}
> Index: src/test/org/apache/commons/attributes/AttributesTest.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes/AttributesTest.java,v
> retrieving revision 1.3
> diff -u -r1.3 AttributesTest.java
> --- src/test/org/apache/commons/attributes/AttributesTest.java	18 Dec 2002 19:00:39 -0000	1.3
> +++ src/test/org/apache/commons/attributes/AttributesTest.java	21 May 2003 17:34:59 -0000
> @@ -201,6 +201,7 @@
>  	public void testAttributes()
>  		throws IOException, NoSuchMethodException, NoSuchFieldException {
>  		AttributesCompiler attributesCompiler = new AttributesCompiler();
> +        attributesCompiler.setIncludes("**/*.java");
>  		attributesCompiler.setSrc(new File("src" + File.separator + "test"));
>  		attributesCompiler.setDest(targetDir);
>  		attributesCompiler.execute();
> 
> ----
> 

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



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


Re: [Attributes] Release and Maven Plugin

Posted by Dan Diephouse <da...@envoisolutions.com>.
Well, I finally got around to fixing the commons-attributes ant task. 
Here's a patch.  I hope there are still attributes developers around who 
will apply this! :)

Basically this patch just makes AttributesCompiler extend MatchingTask 
so it has automatic support for includes and excludes.  Now my maven.xml 
file looks something like so:

<taskdef name="attr" 
classname="org.apache.commons.attributes.task.AttributesCompiler" 
classpathref="attributes-classpath"/>
	
     <attr
       src="${pom.build.sourceDirectory}"
       dest="${basedir}/target/classes">
         <include name="${maven.attributes.src.includes}"/>
         <exclude name="${maven.attributes.src.excludes}"/>
     </attr>

Also, why is there a Thread.sleep(20000) in the AttributesTest?

- Dan

Dan Diephouse wrote:
> Hi all,
> 
> I'm using commons-attributes in some of my projects and I'd like to make 
> it easier for people who are using those projects to use 
> commons-attributes.
> 
> So, I guess my first question is, are there plans for a release of 
> commons-attributes (whether alpha, beta, whatever)?  I think there 
> should be support for excludes/includes in the ant task before there is 
> one.  Is there anything else stopping some kind of release?  If that is 
> the only thing stopping a alpha/beta release I will put a patch together 
> in the next day or two.
> 
> Second, I have a maven plugin for it which just calls the ant task, 
> nothing too fantastic. In your maven.xml you need to put a preGoal in 
> for java:compile that does an <attainGoal name="attributes:compile"> so 
> the attributes get compiled.  I would think if there was an attributes 
> release I could get it in Maven cvs before b10. Otherwise, it could go 
> in the commons-attributes cvs if you're interested.
> 
> The plugin is here:
> http://junktoast.com/attributes-plugin.tar.gz
> 
> 
> - Dan
> 
>