cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r415995 - in /cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main: java/org/apache/maven/plugin/eclipse/ java/org/apache/maven/plugin/eclipse/writers/ resources/org/apache/maven/plugin/eclipse/
Date Wed, 21 Jun 2006 14:31:31 GMT
Author: reinhard
Date: Wed Jun 21 07:31:30 2006
New Revision: 415995

URL: http://svn.apache.org/viewvc?rev=415995&view=rev
Log:
delete lib dir in the case of an PDE project too

Modified:
    cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
    cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
    cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties

Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java?rev=415995&r1=415994&r2=415995&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
(original)
+++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java
Wed Jun 21 07:31:30 2006
@@ -63,6 +63,11 @@
     private static final String FILE_FACET_CORE_XML = ".settings/org.eclipse.wst.common.project.facet.core.xml";
//$NON-NLS-1$
 
     /**
+     * Directory name that contains the OSGi libs within the project
+     */
+    private static final String LIB_DIR = "lib"; //$NON-NLS-1$    
+    
+    /**
      * Packaging for the current project.
      * @parameter expression="${project.packaging}"
      * @required
@@ -74,6 +79,13 @@
      * @parameter expression="${basedir}"
      */
     private File basedir;
+    
+    /**
+     * Is it an PDE project?
+     * 
+     * @parameter expression="${eclipse.pde}" default-value="false"
+     */
+    private boolean pde;        
 
     /**
      * @see org.apache.maven.plugin.AbstractMojo#execute()
@@ -101,6 +113,11 @@
         {
             delete( settingsDir );
         }
+        
+        if ( pde ) 
+        {
+            delete ( new File( basedir, LIB_DIR ) );
+        }
     }
 
     /**
@@ -112,8 +129,14 @@
     private void delete( File f )
         throws MojoExecutionException
     {
-        getLog().info( Messages.getString( "EclipseCleanMojo.deleting", f.getName() ) );
//$NON-NLS-1$
-
+        if ( f.isDirectory() ) 
+        {
+            getLog().info( Messages.getString( "EclipseCleanMojo.deletingDirectory", f.getName()
) ); //$NON-NLS-1$
+        } else 
+        {
+            getLog().info( Messages.getString( "EclipseCleanMojo.deletingFile", f.getName()
) ); //$NON-NLS-1$
+        }
+        
         if ( f.exists() )
         {
             if ( !f.delete() )

Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java?rev=415995&r1=415994&r2=415995&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
(original)
+++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java
Wed Jun 21 07:31:30 2006
@@ -91,6 +91,11 @@
      * File name that stores project classpath settings.
      */
     private static final String FILE_DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$
+    
+    /**
+     * Directory name that contains the OSGi libs within the project
+     */
+    private static final String LIB_DIR = "lib"; //$NON-NLS-1$
 
     public EclipseClasspathWriter( Log log, File eclipseProjectDir, MavenProject project,
IdeDependency[] deps )
     {
@@ -228,10 +233,10 @@
                 }                
                 else if ( !dep.isOSGiBundle() && rcp ) // && !dep.isTestDependency()
&& !dep.isProvided() )
                 {
-	                String libs = "lib";
 	                try {
-	                	File libsDir = new File(libs);
-	                	if(!libsDir.exists()) {
+	                	File libsDir = new File(LIB_DIR);
+	                	if(!libsDir.exists()) 
+                        {
 	                		libsDir.mkdirs();
 	                	}
 						FileUtils.copyFileToDirectory(dep.getFile(), libsDir);
@@ -239,9 +244,10 @@
 					} 
 	                catch (IOException e) 
 	                {
-						throw new MojoExecutionException("Can't copy artifact '" + dep.getArtifactId() + "'");
+						throw new MojoExecutionException(Messages.getString( "EclipsePlugin.cantcopyartifact",

+                            dep.getArtifactId() ));
 					}
-	                path = libs + "/" + dep.getFile().getName();
+	                path = LIB_DIR + "/" + dep.getFile().getName();
 	                kind = "lib";
                 } 
                 else 

Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties?rev=415995&r1=415994&r2=415995&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties
(original)
+++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties
Wed Jun 21 07:31:30 2006
@@ -18,6 +18,7 @@
 EclipsePlugin.wtpversion=Adding support for WTP version {0}.
 EclipsePlugin.missingjrecontainer=You did specify a list of classpath containers without
the base org.eclipse.jdt.launching.JRE_CONTAINER.\n       If you specify custom classpath
containers you should also add org.eclipse.jdt.launching.JRE_CONTAINER to the list
 EclipsePlugin.deprecatedpar=Plugin parameter "{0}" is deprecated, please use "{1}"
+EclipsePlugin.cantcopyartifact=Can''t copy artifact "{0}".
 
 EclipseSettingsWriter.wrotesettings=Wrote settings to {0}
 EclipseSettingsWriter.cannotcreatesettings=Cannot create settings file
@@ -29,6 +30,7 @@
 
 EclipseProjectWriter.notafile=Not adding a file link to {0}; it is not a file
 
-EclipseCleanMojo.deleting=Deleting {0} file...
+EclipseCleanMojo.deletingFile=Deleting file: {0}
+EclipseCleanMojo.deletingDirectory=Deleting directory: {0}
 EclipseCleanMojo.failedtodelete=Failed to delete {0} file: {0}
 EclipseCleanMojo.nofilefound=No {0} file found



Mime
View raw message