Author: fgiust Date: Sun Nov 26 01:45:26 2006 New Revision: 479320 URL: http://svn.apache.org/viewvc?view=rev&rev=479320 Log: updating expected test results for testcase #3 and add comparison of content in .externalToolBuilders dir. The output looks correct, but testcases have not been updated when the handling of external resources with the use of an external builder has been added. Test project #4 and #9 still fail.
Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/Maven_Ant_Builder.launch Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.project Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java?view=diff&rev=479320&r1=479319&r2=479320 ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java Sun Nov 26 01:45:26 2006 @@ -20,12 +20,10 @@ import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; -import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.TreeMap; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.BuildCommand; @@ -169,9 +167,8 @@ if ( byOutputDirs == null ) { // ArrayList<EclipseSourceDir> - byOutputDir.put( - dir.getOutput() == null ? defaultOutput : dir.getOutput(), - byOutputDirs = new ArrayList() ); + byOutputDir.put( dir.getOutput() == null ? defaultOutput : dir.getOutput(), + byOutputDirs = new ArrayList() ); } byOutputDirs.add( dir ); } @@ -184,21 +181,25 @@ + dir.getOutput() + "; default output=" + defaultOutput ); boolean isSpecial = false; - + // handle resource with nested output folders if ( dir.isResource() ) { // Check if the output is a subdirectory of the default output, // and if the default output has any sources that copy there. - if ( dir.getOutput() != null && !dir.getOutput().equals( defaultOutput ) - && dir.getOutput().startsWith( defaultOutput ) && byOutputDir.get( defaultOutput ) != null - && !( (List) byOutputDir.get( defaultOutput ) ).isEmpty() ) + if ( dir.getOutput() != null // resource output dir is set + && !dir.getOutput().equals( defaultOutput ) // output dir is not default target/classes + && dir.getOutput().startsWith( defaultOutput ) // ... but is nested + && byOutputDir.get( defaultOutput ) != null // ??? + && !( (List) byOutputDir.get( defaultOutput ) ).isEmpty() // ??? + ) { // do not specify as source since the output will be nested. Instead, mark // it as a todo, and handle it with a custom build.xml file later. - log.debug( "Marking as special to prevent output folder nesting: " + dir.getPath() + " (output=" + dir.getOutput() +")"); + log.debug( "Marking as special to prevent output folder nesting: " + dir.getPath() + " (output=" + + dir.getOutput() + ")" ); isSpecial = true; specialSources.add( dir ); @@ -245,9 +246,8 @@ try { - FileWriter buildXmlWriter = new FileWriter( new File( - config.getEclipseProjectDirectory(), - "maven-eclipse.xml" ) ); + FileWriter buildXmlWriter = new FileWriter( new File( config.getEclipseProjectDirectory(), + "maven-eclipse.xml" ) ); PrettyPrintXMLWriter buildXmlPrinter = new PrettyPrintXMLWriter( buildXmlWriter ); buildXmlPrinter.startElement( "project" ); @@ -267,7 +267,7 @@ // TODO: merge source dirs on output path+filtering to reduce // <copy> tags for speed. EclipseSourceDir dir = (EclipseSourceDir) it.next(); - buildXmlPrinter.startElement( "copy"); + buildXmlPrinter.startElement( "copy" ); buildXmlPrinter.addAttribute( "todir", dir.getOutput() ); buildXmlPrinter.addAttribute( "filtering", "" + dir.isFiltering() ); @@ -300,16 +300,16 @@ log.info( "Creating external launcher file" ); // now create the launcher - new EclipseAntExternalLaunchConfigurationWriter().init( log, config, "Maven_Ant_Builder.launch", "maven-eclipse.xml").write(); + new EclipseAntExternalLaunchConfigurationWriter().init( log, config, "Maven_Ant_Builder.launch", + "maven-eclipse.xml" ).write(); // finally add it to the project writer. - config.getBuildCommands().add( - new BuildCommand( - "org.eclipse.ui.externaltools.ExternalToolBuilder", - "LaunchConfigHandle", - "<project>/" + EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS - + "Maven_Ant_Builder.launch" ) ); + config.getBuildCommands() + .add( + new BuildCommand( "org.eclipse.ui.externaltools.ExternalToolBuilder", "LaunchConfigHandle", + "<project>/" + EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS + + "Maven_Ant_Builder.launch" ) ); } // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java?view=diff&rev=479320&r1=479319&r2=479320 ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java Sun Nov 26 01:45:26 2006 @@ -236,6 +236,7 @@ compareDirectoryContent( basedir, projectOutputDir, "" ); compareDirectoryContent( basedir, projectOutputDir, ".settings/" ); + compareDirectoryContent( basedir, projectOutputDir, ".externalToolBuilders/" ); compareDirectoryContent( basedir, projectOutputDir, "META-INF/" ); } Added: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/Maven_Ant_Builder.launch URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/Maven_Ant_Builder.launch?view=auto&rev=479320 ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/Maven_Ant_Builder.launch (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.externalToolBuilders/Maven_Ant_Builder.launch Sun Nov 26 01:45:26 2006 @@ -0,0 +1,24 @@ +<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> + <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> + <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/> + <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> + <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> + <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="maven-eclipse-plugin-test-project-3"/> + <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/> + <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/maven-eclipse.xml"/> + <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/> + <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/> + <booleanAttribute key="org.eclipse.debug.core.capture_output" value="false"/> + <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version='1.0'?><launchConfigurationWorkingSet editPageId='org.eclipse.ui.resourceWorkingSetPage' factoryID='org.eclipse.ui.internal.WorkingSetFactory' label='workingSet' name='workingSet'><item factoryID='org.eclipse.ui.internal.model.ResourceFactory' path='maven-eclipse-plugin-test-project-3' type='4'/></launchConfigurationWorkingSet>}"/> + <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/> + <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/> + <booleanAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON" value="false"/> + <booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/> + <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> + <listEntry value="1"/> + </listAttribute> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> + <listEntry value="/maven-eclipse-plugin-test-project-3/maven-eclipse.xml"/> + </listAttribute> +</launchConfiguration> \ No newline at end of file Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.project URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.project?view=diff&rev=479320&r1=479319&r2=479320 ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.project (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-03/expected/.project Sun Nov 26 01:45:26 2006 @@ -7,8 +7,17 @@ <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> </buildCommand> + <buildCommand> + <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> + <arguments> + <dictionary> + <key>LaunchConfigHandle</key> + <value><project>/.externalToolBuilders/Maven_Ant_Builder.launch</value> + </dictionary> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> -</projectDescription> +</projectDescription> \ No newline at end of file