jvanzyl     2002/06/05 20:57:56

  Modified:    src/java/org/apache/maven/jelly MavenInitTag.java
  Log:
  Adding some hacks for bob to look at.
  
  Revision  Changes    Path
  1.3       +29 -12    
jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenInitTag.java
  
  Index: MavenInitTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenInitTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MavenInitTag.java 5 Jun 2002 15:06:45 -0000       1.2
  +++ MavenInitTag.java 6 Jun 2002 03:57:56 -0000       1.3
  @@ -132,20 +132,37 @@
           project.addBuildListener( logger );
           
           project.init();
  -
  -        File mavenBuildFile = new File( getDir(),
  -                                        "build-maven.xml" );
  -        
  +                    
           Class.forName( "javax.xml.parsers.SAXParserFactory" );
  -                
  -        ProjectHelper.configureProject( project,
  -                                        mavenBuildFile );
  -
  -        project.setUserProperty("ant.file" , mavenBuildFile.getAbsolutePath() );
   
  -        context.registerTagLibrary( "jelly:ant", new AntTagLibrary(project) );
  +        File mavenBuildFile = new File( getDir(),"build.xml" );
   
  -        context.setVariable( "ant-project",
  -                             project );
  +        if (mavenBuildFile.exists() == false)
  +        {
  +            mavenBuildFile = new File ( getDir(), "build-maven.xml" );
  +            
  +            if (mavenBuildFile.exists() == false)
  +            {
  +                context.setVariable( "buildfile-present", Boolean.FALSE);
  +            }
  +            else
  +            {
  +                context.setVariable( "buildfile-present", Boolean.TRUE);
  +                ProjectHelper.configureProject( project, mavenBuildFile );
  +                project.setUserProperty("ant.file" , 
mavenBuildFile.getAbsolutePath() );
  +                context.registerTagLibrary( "jelly:ant", new AntTagLibrary(project) 
);
  +                context.setVariable( "ant-project", project );
  +            }
  +        }
  +    
  +        Properties buildProperties = new Properties();
  +        buildProperties.load( new FileInputStream(
  +                              new File(System.getProperty("user.home"),
  +                              "build.properties")));
  +    
  +        String mavenHome = buildProperties.getProperty("maven.home");
  +        System.out.println(">>>>>>>> " + mavenHome);
  +        context.setVariable( "mavenHome", mavenHome);
  +        getBody().run(context, output);
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to