Browse Source

Move text manipulation tasks into new package

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270477 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
3a4ce7972b
14 changed files with 76 additions and 70 deletions
  1. +2
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Filter.java
  2. +10
    -10
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java
  3. +17
    -17
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  4. +5
    -4
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/FixCRLF.java
  5. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/NestedString.java
  6. +2
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Replace.java
  7. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Replacefilter.java
  8. +2
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Filter.java
  9. +10
    -10
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java
  10. +17
    -17
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  11. +5
    -4
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/FixCRLF.java
  12. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/NestedString.java
  13. +2
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/Replace.java
  14. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/Replacefilter.java

+ 2
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Filter.java View File

@@ -21,7 +21,8 @@ import org.apache.tools.ant.Task;
* @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a>
* @author <A href="gholam@xtra.co.nz">Michael McCallum</A>
*/
public class Filter extends Task
public class Filter
extends Task
{
private File filtersFile;



+ 10
- 10
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java View File

@@ -94,12 +94,12 @@ class VAJWorkspaceScanner extends DirectoryScanner
*/
public void addDefaultExcludes()
{
int excludesLength = excludes == null ? 0 : excludes.length;
int excludesLength = getExcludes() == null ? 0 : getExcludes().length;
String[] newExcludes;
newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ];
if( excludesLength > 0 )
{
System.arraycopy( excludes, 0, newExcludes, 0, excludesLength );
System.arraycopy( getExcludes(), 0, newExcludes, 0, excludesLength );
}
for( int i = 0; i < DEFAULTEXCLUDES.length; i++ )
{
@@ -107,7 +107,7 @@ class VAJWorkspaceScanner extends DirectoryScanner
replace( '/', File.separatorChar ).
replace( '\\', File.separatorChar );
}
excludes = newExcludes;
setExcludes( newExcludes );
}

/**
@@ -125,10 +125,10 @@ class VAJWorkspaceScanner extends DirectoryScanner
for( int i = 0; i < projects.length; i++ )
{
Project project = projects[ i ];
for( int j = 0; j < includes.length && !allProjectsMatch; j++ )
for( int j = 0; j < getIncludes().length && !allProjectsMatch; j++ )
{
StringTokenizer tok =
new StringTokenizer( includes[ j ], File.separator );
new StringTokenizer( getIncludes()[ j ], File.separator );
String projectNamePattern = tok.nextToken();
if( projectNamePattern.equals( "**" ) )
{
@@ -162,15 +162,15 @@ class VAJWorkspaceScanner extends DirectoryScanner
*/
public void scan()
{
if( includes == null )
if( getIncludes() == null )
{
// No includes supplied, so set it to 'matches all'
includes = new String[ 1 ];
includes[ 0 ] = "**";
setIncludes( new String[ 1 ] );
getIncludes()[ 0 ] = "**";
}
if( excludes == null )
if( getExcludes() == null )
{
excludes = new String[ 0 ];
setExcludes( new String[ 0 ] );
}

// only scan projects which are included in at least one include pattern


+ 17
- 17
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -962,23 +962,23 @@ public class FTP

public void scan()
{
if( includes == null )
if( getIncludes() == null )
{
// No includes supplied, so set it to 'matches all'
includes = new String[ 1 ];
includes[ 0 ] = "**";
setIncludes( new String[ 1 ] );
getIncludes()[ 0 ] = "**";
}
if( excludes == null )
if( getExcludes() == null )
{
excludes = new String[ 0 ];
setExcludes( new String[ 0 ] );
}

filesIncluded = new ArrayList();
filesNotIncluded = new ArrayList();
filesExcluded = new ArrayList();
dirsIncluded = new ArrayList();
dirsNotIncluded = new ArrayList();
dirsExcluded = new ArrayList();
setFilesIncluded( new ArrayList() );
setFilesNotIncluded( new ArrayList() );
setFilesExcluded( new ArrayList() );
setDirsIncluded( new ArrayList() );
setDirsNotIncluded( new ArrayList() );
setDirsExcluded( new ArrayList() );

try
{
@@ -1020,7 +1020,7 @@ public class FTP
{
if( !isExcluded( name ) )
{
dirsIncluded.add( name );
getDirsIncluded().add( name );
if( fast )
{
scandir( name, vpath + name + File.separator, fast );
@@ -1028,12 +1028,12 @@ public class FTP
}
else
{
dirsExcluded.add( name );
getDirsExcluded().add( name );
}
}
else
{
dirsNotIncluded.add( name );
getDirsNotIncluded().add( name );
if( fast && couldHoldIncluded( name ) )
{
scandir( name, vpath + name + File.separator, fast );
@@ -1053,16 +1053,16 @@ public class FTP
{
if( !isExcluded( name ) )
{
filesIncluded.add( name );
getFilesIncluded().add( name );
}
else
{
filesExcluded.add( name );
getFilesExcluded().add( name );
}
}
else
{
filesNotIncluded.add( name );
getFilesNotIncluded().add( name );
}
}
}


proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java → proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/FixCRLF.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.util.FileUtils;

@@ -70,9 +71,9 @@ import org.apache.tools.ant.util.FileUtils;
* @version $Revision$ $Name$
*/

public class FixCRLF extends MatchingTask
public class FixCRLF
extends MatchingTask
{

private final static int UNDEF = -1;
private final static int NOTJAVA = 0;
private final static int LOOKING = 1;
@@ -125,7 +126,7 @@ public class FixCRLF extends MatchingTask
public FixCRLF()
{
tabs = ASIS;
if( System.getProperty( "path.separator" ).equals( ":" ) )
if( File.pathSeparator.equals( ":" ) )
{
ctrlz = REMOVE;
if( System.getProperty( "os.name" ).indexOf( "Mac" ) > -1 )

proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/NestedString.java → proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/NestedString.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

public class NestedString
{

proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Replace.java → proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Replace.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Properties;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.avalon.excalibur.util.StringUtil;

/**

proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Replacefilter.java → proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Replacefilter.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import org.apache.myrmidon.api.TaskException;


+ 2
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Filter.java View File

@@ -21,7 +21,8 @@ import org.apache.tools.ant.Task;
* @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a>
* @author <A href="gholam@xtra.co.nz">Michael McCallum</A>
*/
public class Filter extends Task
public class Filter
extends Task
{
private File filtersFile;



+ 10
- 10
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java View File

@@ -94,12 +94,12 @@ class VAJWorkspaceScanner extends DirectoryScanner
*/
public void addDefaultExcludes()
{
int excludesLength = excludes == null ? 0 : excludes.length;
int excludesLength = getExcludes() == null ? 0 : getExcludes().length;
String[] newExcludes;
newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ];
if( excludesLength > 0 )
{
System.arraycopy( excludes, 0, newExcludes, 0, excludesLength );
System.arraycopy( getExcludes(), 0, newExcludes, 0, excludesLength );
}
for( int i = 0; i < DEFAULTEXCLUDES.length; i++ )
{
@@ -107,7 +107,7 @@ class VAJWorkspaceScanner extends DirectoryScanner
replace( '/', File.separatorChar ).
replace( '\\', File.separatorChar );
}
excludes = newExcludes;
setExcludes( newExcludes );
}

/**
@@ -125,10 +125,10 @@ class VAJWorkspaceScanner extends DirectoryScanner
for( int i = 0; i < projects.length; i++ )
{
Project project = projects[ i ];
for( int j = 0; j < includes.length && !allProjectsMatch; j++ )
for( int j = 0; j < getIncludes().length && !allProjectsMatch; j++ )
{
StringTokenizer tok =
new StringTokenizer( includes[ j ], File.separator );
new StringTokenizer( getIncludes()[ j ], File.separator );
String projectNamePattern = tok.nextToken();
if( projectNamePattern.equals( "**" ) )
{
@@ -162,15 +162,15 @@ class VAJWorkspaceScanner extends DirectoryScanner
*/
public void scan()
{
if( includes == null )
if( getIncludes() == null )
{
// No includes supplied, so set it to 'matches all'
includes = new String[ 1 ];
includes[ 0 ] = "**";
setIncludes( new String[ 1 ] );
getIncludes()[ 0 ] = "**";
}
if( excludes == null )
if( getExcludes() == null )
{
excludes = new String[ 0 ];
setExcludes( new String[ 0 ] );
}

// only scan projects which are included in at least one include pattern


+ 17
- 17
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -962,23 +962,23 @@ public class FTP

public void scan()
{
if( includes == null )
if( getIncludes() == null )
{
// No includes supplied, so set it to 'matches all'
includes = new String[ 1 ];
includes[ 0 ] = "**";
setIncludes( new String[ 1 ] );
getIncludes()[ 0 ] = "**";
}
if( excludes == null )
if( getExcludes() == null )
{
excludes = new String[ 0 ];
setExcludes( new String[ 0 ] );
}

filesIncluded = new ArrayList();
filesNotIncluded = new ArrayList();
filesExcluded = new ArrayList();
dirsIncluded = new ArrayList();
dirsNotIncluded = new ArrayList();
dirsExcluded = new ArrayList();
setFilesIncluded( new ArrayList() );
setFilesNotIncluded( new ArrayList() );
setFilesExcluded( new ArrayList() );
setDirsIncluded( new ArrayList() );
setDirsNotIncluded( new ArrayList() );
setDirsExcluded( new ArrayList() );

try
{
@@ -1020,7 +1020,7 @@ public class FTP
{
if( !isExcluded( name ) )
{
dirsIncluded.add( name );
getDirsIncluded().add( name );
if( fast )
{
scandir( name, vpath + name + File.separator, fast );
@@ -1028,12 +1028,12 @@ public class FTP
}
else
{
dirsExcluded.add( name );
getDirsExcluded().add( name );
}
}
else
{
dirsNotIncluded.add( name );
getDirsNotIncluded().add( name );
if( fast && couldHoldIncluded( name ) )
{
scandir( name, vpath + name + File.separator, fast );
@@ -1053,16 +1053,16 @@ public class FTP
{
if( !isExcluded( name ) )
{
filesIncluded.add( name );
getFilesIncluded().add( name );
}
else
{
filesExcluded.add( name );
getFilesExcluded().add( name );
}
}
else
{
filesNotIncluded.add( name );
getFilesNotIncluded().add( name );
}
}
}


proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FixCRLF.java → proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/FixCRLF.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.util.FileUtils;

@@ -70,9 +71,9 @@ import org.apache.tools.ant.util.FileUtils;
* @version $Revision$ $Name$
*/

public class FixCRLF extends MatchingTask
public class FixCRLF
extends MatchingTask
{

private final static int UNDEF = -1;
private final static int NOTJAVA = 0;
private final static int LOOKING = 1;
@@ -125,7 +126,7 @@ public class FixCRLF extends MatchingTask
public FixCRLF()
{
tabs = ASIS;
if( System.getProperty( "path.separator" ).equals( ":" ) )
if( File.pathSeparator.equals( ":" ) )
{
ctrlz = REMOVE;
if( System.getProperty( "os.name" ).indexOf( "Mac" ) > -1 )

proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/NestedString.java → proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/NestedString.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

public class NestedString
{

proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replace.java → proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/Replace.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Properties;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.avalon.excalibur.util.StringUtil;

/**

proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replacefilter.java → proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/text/Replacefilter.java View File

@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.taskdefs;
package org.apache.tools.ant.taskdefs.text;

import org.apache.myrmidon.api.TaskException;


Loading…
Cancel
Save