maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r1138212 - in /maven/sandbox/trunk/mae/mae-components/mae-project-tools/src: main/java/org/apache/maven/mae/project/session/ test/java/org/apache/maven/mae/project/testutil/
Date Tue, 21 Jun 2011 22:16:37 GMT
Author: jdcasey
Date: Tue Jun 21 22:16:36 2011
New Revision: 1138212

URL: http://svn.apache.org/viewvc?rev=1138212&view=rev
Log:
simplify the construction options for the simple project tools session, and remove the (unused)
getWorkdir() method.

Modified:
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/test/java/org/apache/maven/mae/project/testutil/TestFixture.java

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java?rev=1138212&r1=1138211&r2=1138212&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
Tue Jun 21 22:16:36 2011
@@ -52,8 +52,6 @@ public interface ProjectToolsSession
 
     ProjectToolsSession setProjectBuildingRequest( final ProjectBuildingRequest projectBuildingRequest
);
 
-    File getWorkdir();
-
     RepositorySystemSession getRepositorySystemSession();
 
     ProjectToolsSession setRepositorySystemSession( final RepositorySystemSession repositorySystemSession
);

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java?rev=1138212&r1=1138211&r2=1138212&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
Tue Jun 21 22:16:36 2011
@@ -43,10 +43,6 @@ public class SimpleProjectToolsSession
     implements ProjectToolsSession
 {
 
-    private final File workdir;
-
-    private final Repository[] resolveRepositories;
-
     private transient List<ArtifactRepository> remoteArtifactRepositories;
 
     private transient List<RemoteRepository> remoteRepositories;
@@ -57,7 +53,9 @@ public class SimpleProjectToolsSession
 
     private transient LinkedHashMap<String, MavenProject> reactorProjects = new LinkedHashMap<String,
MavenProject>();
 
-    private final File localRepositoryDirectory;
+    private Repository[] resolveRepositories;
+
+    private File localRepositoryDirectory;
 
     private MavenExecutionRequest executionRequest;
 
@@ -70,18 +68,9 @@ public class SimpleProjectToolsSession
     private DependencyFilter filter;
 
     private transient Map<Class<?>, Object> states = new HashMap<Class<?>,
Object>();
-
-    public SimpleProjectToolsSession( final File workdir, final Repository... resolveRepositories
)
+    
+    public SimpleProjectToolsSession()
     {
-        this( workdir, new File( workdir, "local-repository" ), resolveRepositories );
-    }
-
-    public SimpleProjectToolsSession( final File workdir, final File localRepositoryDirectory,
-                                      final Repository... resolveRepositories )
-    {
-        this.workdir = workdir;
-        this.localRepositoryDirectory = localRepositoryDirectory;
-        this.resolveRepositories = resolveRepositories;
     }
 
     /**
@@ -179,17 +168,6 @@ public class SimpleProjectToolsSession
     /**
      * {@inheritDoc}
      * 
-     * @see org.apache.maven.mae.project.session.ProjectToolsSession#getWorkdir()
-     */
-    @Override
-    public File getWorkdir()
-    {
-        return workdir;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
      * @see org.apache.maven.mae.project.session.ProjectToolsSession#getRepositorySystemSession()
      */
     @Override
@@ -304,7 +282,10 @@ public class SimpleProjectToolsSession
     @Override
     public ProjectToolsSession copy()
     {
-        final SimpleProjectToolsSession copy = new SimpleProjectToolsSession( workdir, resolveRepositories
);
+        final SimpleProjectToolsSession copy = new SimpleProjectToolsSession();
+        copy.resolveRepositories = resolveRepositories;
+        
+        copy.localRepositoryDirectory = localRepositoryDirectory;
 
         copy.projectBuildingRequest =
             projectBuildingRequest == null ? null : new DefaultProjectBuildingRequest( projectBuildingRequest
);
@@ -483,4 +464,14 @@ public class SimpleProjectToolsSession
         return state == null ? null : type.cast( state );
     }
 
+    public void setResolveRepositories( Repository...resolveRepositories )
+    {
+        this.resolveRepositories = resolveRepositories;
+    }
+
+    public void setLocalRepositoryDirectory( File localRepositoryDirectory )
+    {
+        this.localRepositoryDirectory = localRepositoryDirectory;
+    }
+
 }

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/test/java/org/apache/maven/mae/project/testutil/TestFixture.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/test/java/org/apache/maven/mae/project/testutil/TestFixture.java?rev=1138212&r1=1138211&r2=1138212&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/test/java/org/apache/maven/mae/project/testutil/TestFixture.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/test/java/org/apache/maven/mae/project/testutil/TestFixture.java
Tue Jun 21 22:16:36 2011
@@ -243,11 +243,7 @@ public final class TestFixture
     public ProjectToolsSession newSession( final MavenProject... projects )
         throws IOException
     {
-        final File workdir = File.createTempFile( "test-meadin.", ".work" );
-        workdir.delete();
-        workdir.mkdirs();
-
-        final ProjectToolsSession session = new SimpleProjectToolsSession( workdir, localRepoDir,
rawRemoteRepo );
+        final ProjectToolsSession session = new SimpleProjectToolsSession( localRepoDir,
rawRemoteRepo );
 
         session.setRemoteArtifactRepositories( Collections.singletonList( remoteRepository
) );
 



Mime
View raw message