You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2002/11/30 18:18:26 UTC

cvs commit: jakarta-turbine-maven/src/java/org/apache/maven MavenUtils.java

jvanzyl     2002/11/30 09:18:26

  Modified:    src/java/org/apache/maven MavenUtils.java
  Log:
  refactoring
  
  Revision  Changes    Path
  1.70      +31 -4     jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- MavenUtils.java	24 Nov 2002 23:41:12 -0000	1.69
  +++ MavenUtils.java	30 Nov 2002 17:18:25 -0000	1.70
  @@ -585,8 +585,8 @@
           return result;
       }
   
  -    /**
  -     * Process properties in dominant order.
  +   /**
  +     * Create a jelly context given a descriptor directory.
        *
        * @param descriptorDirectory The directory from which to pull the standard maven
        * properties files from.
  @@ -595,6 +595,22 @@
        */
       public static MavenJellyContext createContext( File descriptorDirectory )
       {
  +        return createContext( descriptorDirectory, null );
  +    }
  +
  +    /**
  +     * Create a jelly context given a descriptor directory and parent
  +     * jelly context.
  +     *
  +     * @param descriptorDirectory The directory from which to pull the standard maven
  +     * properties files from.
  +     * @param parentContext The parent jelly context.
  +     * @return The generated maven based on the contents of the standard maven
  +     * properties files.
  +     */
  +    public static MavenJellyContext createContext( File descriptorDirectory,
  +                                                   MavenJellyContext parentContext )
  +    {
           // System properties
           Properties systemProperties = System.getProperties();
   
  @@ -633,7 +649,18 @@
               driverProperties
           } );
   
  -        MavenJellyContext context = new MavenJellyContext();
  +        MavenJellyContext context;
  +
  +        if ( parentContext != null )
  +        {
  +            context = new MavenJellyContext( parentContext );
  +            context.setInherit( true );
  +        }
  +        else
  +        {
  +            context = new MavenJellyContext();
  +        }
  +
           MavenUtils.integrateMapInContext( result, context );
   
           return context;