Changeset 16927


Ignore:
Timestamp:
2008-08-21T11:01:04+12:00 (16 years ago)
Author:
oranfry
Message:

changes to a few custom tasks

Location:
release-kits/shared/ant-tasks/orans
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release-kits/shared/ant-tasks/orans/GetFreePath.java

    r16914 r16927  
    1919     */
    2020    public static void main( String[] args ) {
    21 
    2221        GetFreePath gfp = new GetFreePath();
    2322        gfp.setPath( new File(args[0]) );
    2423        gfp.setProperty( args[1] );
    2524        gfp.execute();
    26 
    2725    }
    2826
     
    4644        //set the found path in the project
    4745        Project pr = getProject();
    48         if ( pr != null ) {
    49             pr.setProperty( "property", returnPath.getPath() );
     46        if ( pr != null && pr.getProperty(property) == null ) {
     47            pr.setProperty( property, returnPath.getPath() );
    5048        }
    5149        System.out.println(returnPath.getPath());
  • release-kits/shared/ant-tasks/orans/RegexSearchReplace.java

    r16535 r16927  
    1010    private String pattern = null;
    1111    private String replacement = null;
     12    private boolean winPath = false;
    1213   
    1314
     
    3637        }
    3738
    38         if (replacement == null) {
     39        if ( replacement == null ) {
    3940            throw new BuildException( "Error - No replacement specified !!" );
    4041        }
    4142
     43        if ( winPath ) {
     44            replacement = replacement.replaceAll("\\\\","\\\\\\\\");
     45        }
     46       
    4247        System.out.println( "File: " + file );
    4348        System.out.println( "Pattern: " + pattern );
     
    148153   
    149154    public void setFile(File file) {
    150             this.file = file;
     155        this.file = file;
    151156    }
    152157
    153158    public void setPattern(String pattern) {
    154             this.pattern = pattern;
     159        this.pattern = pattern;
    155160    }
    156161
    157162    public void setReplacement(String replacement) {
    158             this.replacement = replacement.replaceAll( "\\\\", "\\\\\\\\" );
     163        this.replacement = replacement.replaceAll( "\\\\", "\\\\\\\\" );
     164    }
     165
     166    public void setWinPath( boolean isWinPath ) {
     167        this.winPath = isWinPath;
    159168    }
    160169
Note: See TracChangeset for help on using the changeset viewer.