maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/verifier ProjectVerifier.java
Date Wed, 04 Dec 2002 23:37:19 GMT
jvanzyl     2002/12/04 15:37:19

  Modified:    src/java/org/apache/maven CreateDependencyClasspath.java
               src/java/org/apache/maven/jelly MavenJellyContext.java
               src/java/org/apache/maven/verifier ProjectVerifier.java
  Log:
  o more cleanups and use of the context and accessors.
  
  Revision  Changes    Path
  1.23      +8 -22     jakarta-turbine-maven/src/java/org/apache/maven/CreateDependencyClasspath.java
  
  Index: CreateDependencyClasspath.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/CreateDependencyClasspath.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CreateDependencyClasspath.java	4 Dec 2002 07:01:15 -0000	1.22
  +++ CreateDependencyClasspath.java	4 Dec 2002 23:37:19 -0000	1.23
  @@ -131,20 +131,9 @@
       {
           try
           {
  -            Object b = getContext().getVariable( MavenConstants.JAR_OVERRIDE );
  -            boolean mavenJarOverride = ( ( b != null )
  -                                         &&
  -                                         ( b instanceof Boolean )
  -                                         &&
  -                                         ( ( (Boolean) b ).booleanValue() ) );
  -
  -            String mavenRepoLocal =
  -                (String) getContext().getVariable( MavenConstants.REPO_LOCAL );
  -
  -            org.apache.tools.ant.Project antProject = (org.apache.tools.ant.Project)
  -                getContext().getVariable( MavenConstants.MAVEN_ANT_PROJECT );
  -
  -            Path classpath = new Path( antProject );
  +            boolean mavenJarOverride = getContext().getMavenJarOverride().booleanValue();
  +            String mavenRepoLocal = getContext().getMavenRepoLocal();
  +            Path classpath = new Path( getContext().getAntProject() );
   
               for ( Iterator i = getContext().getProject().getDependencies().iterator();
i.hasNext(); )
               {
  @@ -156,10 +145,8 @@
                       continue;
                   }
   
  -                String mavenJarProperty = (String)
  -                    getContext().getVariable( MavenConstants.JAR_OVERRIDE_PROPERTY + d.getId()
);
  -
  -                Path path = new Path( antProject );
  +                String mavenJarProperty = getContext().getMavenJarOverride( d.getId() );
  +                Path path = new Path( getContext().getAntProject() );
   
                   if ( mavenJarOverride
                         &&
  @@ -180,13 +167,12 @@
                   }
   
                   classpath.append( path );
  -
                   getContext().getProject().setDependencyPath( d.getId(), path.toString()
);
               }
   
  -            if ( refid != null )
  +            if ( getRefid() != null )
               {
  -                antProject.addReference( refid, classpath );
  +                getContext().getAntProject().addReference( getRefid(), classpath );
               }
   
           }
  
  
  
  1.15      +35 -11    jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java
  
  Index: MavenJellyContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MavenJellyContext.java	4 Dec 2002 07:01:15 -0000	1.14
  +++ MavenJellyContext.java	4 Dec 2002 23:37:19 -0000	1.15
  @@ -283,19 +283,13 @@
       public Boolean getBoolean( String propValue )
       {
           if ( "true".equalsIgnoreCase( propValue )
  -            || "on".equalsIgnoreCase( propValue )
  -            || "1".equals( propValue ) )
  +             || "on".equalsIgnoreCase( propValue )
  +             || "1".equals( propValue ) )
           {
               return Boolean.TRUE;
           }
  -        else if ( "false".equalsIgnoreCase( propValue )
  -            || "off".equalsIgnoreCase( propValue )
  -            || "0".equals( propValue ) )
  -        {
  -            return Boolean.FALSE;
  -        }
   
  -        return null;
  +        return Boolean.FALSE;
       }
   
       // ----------------------------------------------------------------------
  @@ -641,7 +635,7 @@
           setVariable( MavenConstants.REPO_REMOTE_ENABLED, remoteRepositoryEnabled );
       }
   
  -    /**
  +   /**
        * Set flag indicating if the remote repository is enabled for use.
        *
        * @return Remote repository usage flag.
  @@ -649,6 +643,36 @@
       public Boolean getRemoteRepositoryEnabled()
       {
           return getBoolean( MavenConstants.REPO_REMOTE_ENABLED );
  +    }
  +
  +   /**
  +     * Set the flag indicating the use of the JAR overriding facility.
  +     *
  +     * @param mavenJarOverride Maven jar override flag.
  +     */
  +    public void setMavenJarOverride( Boolean mavenJarOverride )
  +    {
  +        setVariable( MavenConstants.JAR_OVERRIDE, mavenJarOverride );
  +    }
  +
  +    /**
  +     * Get the flag indicating the use of the JAR overriding facility.
  +     *
  +     * @return Maven jar override flag.
  +     */
  +    public Boolean getMavenJarOverride()
  +    {
  +        return getBoolean( MavenConstants.JAR_OVERRIDE );
  +    }
  +
  +    /**
  +     * Get the maven jar override value for a particular dependency.
  +     *
  +     * @return Maven jar override value for a particular dependency.
  +     */
  +    public String getMavenJarOverride( String id )
  +    {
  +        return (String) getVariable( MavenConstants.JAR_OVERRIDE_PROPERTY + id );
       }
   
       /**
  
  
  
  1.11      +3 -3      jakarta-turbine-maven/src/java/org/apache/maven/verifier/ProjectVerifier.java
  
  Index: ProjectVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/verifier/ProjectVerifier.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProjectVerifier.java	4 Dec 2002 07:01:15 -0000	1.10
  +++ ProjectVerifier.java	4 Dec 2002 23:37:19 -0000	1.11
  @@ -189,9 +189,9 @@
       private void verifyDependencies()
           throws Exception
       {
  -        Boolean remoteRepoEnabled = getContext().getRemoteRepositoryEnabled();
  +        boolean remoteRepoEnabled = getContext().getRemoteRepositoryEnabled().booleanValue();
   
  -        if ( remoteRepoEnabled != null && remoteRepoEnabled.booleanValue() == false
)
  +        if ( remoteRepoEnabled == false )
           {
               log.info( getMessage( "remote.repository.disabled.warning" ) );
           }
  
  
  

Mime
View raw message