adammurdoch 02/02/12 18:47:37
Modified: proposal/myrmidon/docs index.html
proposal/myrmidon/src/java/org/apache/myrmidon/components/builder
DefaultProject.java DefaultProjectBuilder.java
proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/model
Project.java
proposal/myrmidon/src/xdocs index.xml
Log:
A project may now have a name attribute.
Revision Changes Path
1.2 +20 -0 jakarta-ant/proposal/myrmidon/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/docs/index.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- index.html 11 Feb 2002 08:24:01 -0000 1.1
+++ index.html 13 Feb 2002 02:47:36 -0000 1.2
@@ -304,6 +304,26 @@
<td bgcolor="#a0ddf0" colspan="" rowspan=""
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ name
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ The project name.
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ The name of the project file, with the extension removed.
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
basedir
</font>
</td>
1.3 +24 -4
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProject.java
Index: DefaultProject.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProject.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultProject.java 7 Feb 2002 13:02:19 -0000 1.2
+++ DefaultProject.java 13 Feb 2002 02:47:36 -0000 1.3
@@ -20,7 +20,7 @@
* Default project implementation.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/02/07 13:02:19 $
+ * @version $Revision: 1.3 $ $Date: 2002/02/13 02:47:36 $
*/
public class DefaultProject
implements Project
@@ -46,6 +46,25 @@
///The base directory of project
private File m_baseDirectory;
+ ///The project name
+ private String m_name;
+
+ /**
+ * Returns the project name.
+ */
+ public String getProjectName()
+ {
+ return m_name;
+ }
+
+ /**
+ * Sets the project name.
+ */
+ public void setProjectName( String name )
+ {
+ m_name = name;
+ }
+
/**
* Get the imports for project.
*
@@ -111,7 +130,7 @@
/**
* Retrieve a target by name.
*
- * @param name the name of target
+ * @param targetName the name of target
* @return the Target or null if no target exists with name
*/
public final Target getTarget( final String targetName )
@@ -151,14 +170,15 @@
/**
* Retrieve base directory of project.
- *
- * @return the projects base directory
*/
public final void setBaseDirectory( final File baseDirectory )
{
m_baseDirectory = baseDirectory;
}
+ /**
+ * Adds a type library import to the project.
+ */
public final void addTypeLib( final TypeLib typeLib )
{
m_imports.add( typeLib );
1.30 +4 -1
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
Index: DefaultProjectBuilder.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- DefaultProjectBuilder.java 12 Feb 2002 10:24:27 -0000 1.29
+++ DefaultProjectBuilder.java 13 Feb 2002 02:47:36 -0000 1.30
@@ -34,7 +34,7 @@
* Default implementation to construct project from a build file.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.29 $ $Date: 2002/02/12 10:24:27 $
+ * @version $Revision: 1.30 $ $Date: 2002/02/13 02:47:36 $
*/
public class DefaultProjectBuilder
extends AbstractLogEnabled
@@ -128,6 +128,8 @@
}
//get project-level attributes
+ final String projectName = configuration.getAttribute( "name",
+
FileUtil.removeExtension(file.getName()) );
final String baseDirectoryName = configuration.getAttribute(
"basedir", null );
final String defaultTarget = configuration.getAttribute( "default",
"main" );
final Version version = getVersion( configuration );
@@ -156,6 +158,7 @@
//create project and ...
final DefaultProject project = new DefaultProject();
+ project.setProjectName( projectName );
project.setDefaultTargetName( defaultTarget );
project.setBaseDirectory( baseDirectory );
1.7 +11 -6
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/model/Project.java
Index: Project.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/model/Project.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Project.java 7 Feb 2002 13:01:20 -0000 1.6
+++ Project.java 13 Feb 2002 02:47:36 -0000 1.7
@@ -14,11 +14,8 @@
* Abstraction used to interact with projects.
* Implementations may choose to structure it anyway they choose.
*
- * TODO: Determine if projects should carry their own name. Breaks IOC but
- * Can be useful as project files embed own name (or should that be
description).
- *
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.6 $ $Date: 2002/02/07 13:01:20 $
+ * @version $Revision: 1.7 $ $Date: 2002/02/13 02:47:36 $
*/
public interface Project
extends Component
@@ -35,6 +32,14 @@
//String TARGET = "myrmidon.target.name";
/**
+ * Returns the project name.
+ *
+ * TODO: Determine if projects should carry their own name. Breaks IOC
but
+ * Can be useful as project files embed own name (or should that be
description).
+ */
+ String getProjectName();
+
+ /**
* Get the imports for project.
*
* @return the imports
@@ -42,14 +47,14 @@
TypeLib[] getTypeLibs();
/**
- * Get names of projects referred to by this project.
+ * Get names of projects referenced by this project.
*
* @return the names
*/
String[] getProjectNames();
/**
- * Retrieve project reffered to by this project.
+ * Retrieve project referenced by this project.
*
* @param name the project name
* @return the Project or null if none by that name
1.2 +5 -0 jakarta-ant/proposal/myrmidon/src/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/xdocs/index.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- index.xml 11 Feb 2002 08:24:01 -0000 1.1
+++ index.xml 13 Feb 2002 02:47:37 -0000 1.2
@@ -175,6 +175,11 @@
<table>
<tr><th>Attribute</th><th>Description</th><th>Default Value</th></tr>
<tr>
+ <td>name</td>
+ <td>The project name.</td>
+ <td>The name of the project file, with the extension removed.</td>
+ </tr>
+ <tr>
<td>basedir</td>
<td>The base directory for the project.</td>
<td>The directory containing the project file.</td>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>