jvanzyl     2002/07/10 20:58:06

  Modified:    src/java/org/apache/maven/app Maven.java
  Log:
  o Push the name of the project file into the jelly context so that we
    can use it in plugins. This is currently being used in the xdoc
    plugin where XPath is performed on the project descriptor which was
    first assumed to be project.xml, but since we have added the option
    (-p) to specify an arbitrary project file we need to start accounting
    for this.
  
  Revision  Changes    Path
  1.59      +25 -1     jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- Maven.java        10 Jul 2002 10:51:57 -0000      1.58
  +++ Maven.java        11 Jul 2002 03:58:06 -0000      1.59
  @@ -174,6 +174,9 @@
       /** ${basedir}/project.xml file. */
       private File projectFile;
   
  +    /** Project file name like project.xml or project-b5.xml */
  +    private String projectFileName;
  +
       /** ${basedir}/build.maven file (or null). */
       private File projectBuildFile;
   
  @@ -245,6 +248,24 @@
           return this.projectFile;
       }
   
  +    /** Set the project descriptor file name.
  +     *
  +     *  @param projectFile The project descriptor file name.
  +     */
  +    public void setProjectFileName(String projectFileName)
  +    {
  +        this.projectFileName = projectFileName;
  +    }
  +
  +    /** Retrieve the project descriptor file name.
  +     *
  +     *  @return The project descriptor file name.
  +     */
  +    public String getProjectFileName()
  +    {
  +        return this.projectFileName;
  +    }
  +
       /** Set the project-specific build file.
        *
        *  @see #hasProjectBuildFile
  @@ -535,6 +556,8 @@
               this.jellyContext.setVariable("maven.project.buildFile.url",
                                             getProjectBuildFile().toURL());
           }
  +        
  +        this.jellyContext.setVariable("projectFileName", getProjectFileName());
       }
   
       /** Initialize the core <code>jeez</code> Jelly tag library.
  @@ -1035,7 +1058,8 @@
   
           if ( this.cli.hasOption('p'))
           {
  -            setProjectFile(new File(cli.getOptionValue('p')));
  +            setProjectFileName(cli.getOptionValue('p'));
  +            setProjectFile(new File(getProjectFileName()));
           }
           else
           {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to