Browse Source

Rename basedir to dir and make it default to basedir if not specified

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272116 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
ded098d539
2 changed files with 10 additions and 11 deletions
  1. +2
    -2
      docs/manual/CoreTasks/changelog.html
  2. +8
    -9
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java

+ 2
- 2
docs/manual/CoreTasks/changelog.html View File

@@ -19,9 +19,9 @@
<td align="center" valign="top"><b>Required</b></td> <td align="center" valign="top"><b>Required</b></td>
</tr> </tr>
<tr> <tr>
<td valign="top">basedir</td>
<td valign="top">dir</td>
<td valign="top">the directory from which to run &quot;cvs log&quot;.</td> <td valign="top">the directory from which to run &quot;cvs log&quot;.</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">No, will default to projects basedir</td>
</tr> </tr>
<tr> <tr>
<td valign="top">destfile</td> <td valign="top">destfile</td>


+ 8
- 9
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java View File

@@ -113,7 +113,7 @@ public class ChangeLogTask
private Vector m_cvsUsers = new Vector(); private Vector m_cvsUsers = new Vector();


/** Input dir */ /** Input dir */
private File m_basedir;
private File m_dir;


/** Output file */ /** Output file */
private File m_destfile; private File m_destfile;
@@ -138,9 +138,9 @@ public class ChangeLogTask
/** /**
* Set the base dir for cvs. * Set the base dir for cvs.
*/ */
public void setBasedir( final File basedir )
public void setDir( final File dir )
{ {
m_basedir = basedir;
m_dir = dir;
} }


/** /**
@@ -261,7 +261,7 @@ public class ChangeLogTask
final RedirectingStreamHandler handler = final RedirectingStreamHandler handler =
new RedirectingStreamHandler( parser ); new RedirectingStreamHandler( parser );
final Execute exe = new Execute( handler ); final Execute exe = new Execute( handler );
exe.setWorkingDirectory( m_basedir );
exe.setWorkingDirectory( m_dir );
exe.setCommandline( command.getCommandline() ); exe.setCommandline( command.getCommandline() );
exe.setAntRun( getProject() ); exe.setAntRun( getProject() );
try try
@@ -290,19 +290,18 @@ public class ChangeLogTask
private void validate() private void validate()
throws BuildException throws BuildException
{ {
if( null == m_basedir )
if( null == m_dir )
{ {
final String message = "Basedir must be set.";
throw new BuildException( message );
m_dir = getProject().getBaseDir();
} }
if( null == m_destfile ) if( null == m_destfile )
{ {
final String message = "Destfile must be set."; final String message = "Destfile must be set.";
throw new BuildException( message ); throw new BuildException( message );
} }
if( !m_basedir.exists() )
if( !m_dir.exists() )
{ {
final String message = "Cannot find base dir " + m_basedir.getAbsolutePath();
final String message = "Cannot find base dir " + m_dir.getAbsolutePath();
throw new BuildException( message ); throw new BuildException( message );
} }
if( null != m_usersFile && !m_usersFile.exists() ) if( null != m_usersFile && !m_usersFile.exists() )


Loading…
Cancel
Save