Ignore:
Timestamp:
2008-09-19T13:50:50+12:00 (16 years ago)
Author:
oranfry
Message:

fixed winpath option to rsr and made the test framwork better, plus merged test.xml and build.xml

Location:
other-projects/trunk/anttasks
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/anttasks

    • Property svn:ignore
      •  

        old new  
        11classes
        22lib
         3test
        34
  • other-projects/trunk/anttasks/src/org/greenstone/anttasks/RegexSearchReplace.java

    r17303 r17349  
    130130                String oldLine = line;
    131131                if ( pattern != null ) {
    132                     line = line.replaceAll((String)pattern, (String)replacement);
     132                    String rp = replacement;
     133                    if ( winPath ) {
     134                        rp = rp.replaceAll("\\\\","\\\\\\\\");
     135                    }
     136                    line = line.replaceAll((String)pattern, (String)rp);
    133137                } else {
    134138                    for ( int i=0; i<jobs.size(); i++ ) {
    135139                        String rp = ((RegexSearchReplaceJob)(jobs.get(i))).getReplacement();
    136                         if ( winPath ) {
     140                        if ( ((RegexSearchReplaceJob)(jobs.get(i))).getWinPath() ) {
    137141                            rp = rp.replaceAll("\\\\","\\\\\\\\");
    138142                        }
     
    211215    public void setReplacement(String replacement) {
    212216        replacement = replacement.replaceAll( "\\\\", "\\\\\\\\" );
    213         if ( winPath ) {
    214             replacement = replacement.replaceAll("\\\\","\\\\\\\\");
    215         }
    216217        this.replacement = replacement;
    217218    }
  • other-projects/trunk/anttasks/src/org/greenstone/anttasks/RegexSearchReplaceJob.java

    r17295 r17349  
    22public class RegexSearchReplaceJob extends org.apache.tools.ant.types.DataType {
    33
    4     public String pattern = null;
    5     public String replacement = null;
     4    String pattern = null;
     5    String replacement = null;
     6    boolean winPath = false;
    67
    78    public void setPattern(String pattern) {
     
    1415    }
    1516
     17    public void setWinPath( boolean winPath ) {
     18        this.winPath = winPath;
     19    }
     20
    1621    public String getPattern() {
    1722        return pattern;
     
    2025        return replacement;
    2126    }
     27    public boolean getWinPath() {
     28        return winPath;
     29    }
    2230
    2331}
Note: See TracChangeset for help on using the changeset viewer.