You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/06/16 10:32:47 UTC
cvs commit: avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/tools/ant MetaTask.java
mcconnell 2003/06/16 01:32:47
Modified: merlin/meta-tools/src/java/org/apache/avalon/meta/tools/ant
MetaTask.java
Log:
Add support for selection of the file type used during the generation process.
Revision Changes Path
1.5 +29 -2 avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/tools/ant/MetaTask.java
Index: MetaTask.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/tools/ant/MetaTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MetaTask.java 8 May 2003 03:02:40 -0000 1.4
+++ MetaTask.java 16 Jun 2003 08:32:47 -0000 1.5
@@ -120,6 +120,11 @@
private int m_format;
/**
+ * The preferred postfix value.
+ */
+ private String m_postfix = ".xinfo";
+
+ /**
* Variable that indicates whether the output
* will be generated only when the source file is
* newer than the destination file.
@@ -158,6 +163,28 @@
}
/**
+ * Set the file type to be used for meta info type
+ * documents. May be one of "xinfo" or "xtype".
+ *
+ * @param force the flag for forcing output
+ */
+ public void setPostfox( String postfix )
+ {
+ if( postfix.equalsIgnoreCase( "xtype" )
+ || postfix.equalsIgnoreCase( "xinfo" ) )
+ {
+ m_postfix = "." + postfix;
+ }
+ else
+ {
+ final String error =
+ "Illegal postfix value: " + postfix + ". "
+ + "Recognized values include 'xinfo' and 'xtype'.";
+ throw new BuildException( error );
+ }
+ }
+
+ /**
* Execute generator task.
* @exception BuildException if a build error occurs
*/
@@ -438,7 +465,7 @@
}
else
{
- filename += ".xtype";
+ filename += m_postfix;
}
return new File( m_destDir, filename ).getCanonicalFile();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org