ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/helper ProjectHelper2.java
Date Wed, 27 Apr 2005 16:34:51 GMT
Matt Benson wrote:

>Which part sounds reasonable?  Defaulting to the
>current directory or documenting that URL sources are
>not available to the top-level project?
>  
>
I think defaulting to current directory.

Peter

>-Matt
>
>--- Peter Reilly <peterreilly@apache.org> wrote:
>  
>
>>Yes,
>>that sounds reasonable.
>>
>>Peter
>>
>>Matt Benson wrote:
>>
>>    
>>
>>>--- Peter Reilly <peterreilly@apache.org> wrote:
>>> 
>>>
>>>      
>>>
>>>>For imports, the base dir is the initial build
>>>>        
>>>>
>>file.
>>    
>>
>>>>The import task uses files for other things, for
>>>>example
>>>>to import a new file,
>>>>however I think that it may be usefull to allow
>>>>people
>>>>to play with urls - (it will need to be done at
>>>>        
>>>>
>>some
>>    
>>
>>>>stage)
>>>>so taking away the check would I think be good.
>>>>
>>>>Peter
>>>>   
>>>>
>>>>        
>>>>
>>>With what you have committed, however, one might
>>>      
>>>
>>think
>>    
>>
>>>that third-party code could use a URL at the top
>>>level.    More than once this has been proposed
>>>      
>>>
>>with
>>    
>>
>>>the idea that the user's current directory context
>>>would be the default basedir in such a case.  The
>>>current version of PH2 throws an NPE on default
>>>basedir for a top-level URL source; the attached
>>>      
>>>
>>patch
>>    
>>
>>>sets basedir as described above.  If instead we
>>>      
>>>
>>want
>>    
>>
>>>only to allow URLs on imports we should verify the
>>>"level" of the URL as it is encountered rather than
>>>      
>>>
>>a
>>    
>>
>>>random NPE (I'm sure that comes as a surprise to no
>>>one).
>>>
>>>-Matt
>>>
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.com 
>>>
>>>      
>>>
>>------------------------------------------------------------------------
>>    
>>
>>>Index:
>>>      
>>>
>src/main/org/apache/tools/ant/helper/ProjectHelper2.java
>  
>
>>===================================================================
>>    
>>
>>>RCS file:
>>>      
>>>
>/home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v
>  
>
>>>retrieving revision 1.54
>>>diff -u -r1.54 ProjectHelper2.java
>>>---
>>>      
>>>
>src/main/org/apache/tools/ant/helper/ProjectHelper2.java
>  
>
>>26 Apr 2005 11:55:18 -0000	1.54
>>    
>>
>>>+++
>>>      
>>>
>src/main/org/apache/tools/ant/helper/ProjectHelper2.java
>  
>
>>26 Apr 2005 15:30:17 -0000
>>    
>>
>>>@@ -689,18 +689,13 @@
>>>            } else {
>>>                // Default for baseDir is the
>>>      
>>>
>>location of the build file.
>>    
>>
>>>                if (baseDir == null) {
>>>-                   
>>>      
>>>
>project.setBasedir(context.getBuildFileParent().getAbsolutePath());
>  
>
>>>-                } else {
>>>-                    // check whether the user has
>>>      
>>>
>>specified an absolute path
>>    
>>
>>>-                    if ((new
>>>      
>>>
>>File(baseDir)).isAbsolute()) {
>>    
>>
>>>-                       
>>>      
>>>
>>project.setBasedir(baseDir);
>>    
>>
>>>-                    } else {
>>>-                       
>>>      
>>>
>>project.setBaseDir(FILE_UTILS.resolveFile(
>>    
>>
>>>-                                              
>>>      
>>>
>>context.getBuildFileParent(), baseDir));
>>    
>>
>>>-                    }
>>>+                    File parent =
>>>      
>>>
>>context.getBuildFileParent();
>>    
>>
>>>+                    baseDir = parent == null ? "."
>>>      
>>>
>>: parent.getPath();
>>    
>>
>>>                }
>>>+                // ensure the basedir is an
>>>      
>>>
>>absolute path
>>    
>>
>>>+               
>>>      
>>>
>>project.setBaseDir(FILE_UTILS.resolveFile(
>>    
>>
>>>+                                      
>>>      
>>>
>>context.getBuildFileParent(), baseDir));
>>    
>>
>>>            }
>>>-
>>>            project.addTarget("",
>>>      
>>>
>>context.getImplicitTarget());
>>    
>>
>>>           
>>>      
>>>
>context.setCurrentTarget(context.getImplicitTarget());
>  
>
>>>        }
>>>
>>> 
>>>
>>>      
>>>
>>------------------------------------------------------------------------
>>    
>>
>>---------------------------------------------------------------------
>>    
>>
>>>To unsubscribe, e-mail:
>>>      
>>>
>>dev-unsubscribe@ant.apache.org
>>    
>>
>>>For additional commands, e-mail:
>>>      
>>>
>>dev-help@ant.apache.org
>>    
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>dev-unsubscribe@ant.apache.org
>>For additional commands, e-mail:
>>dev-help@ant.apache.org
>>
>>
>>    
>>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message