maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r473221 - in /maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/plugin/ src/main/java/org/apache...
Date Fri, 10 Nov 2006 07:24:16 GMT
Author: brett
Date: Thu Nov  9 23:24:15 2006
New Revision: 473221

URL: http://svn.apache.org/viewvc?view=rev&rev=473221
Log:
[MNG-2552] Contribution of an NDoc Plugin for CSharp Code
Submitted by: James Carpenter

Added:
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/   (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml   (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
  (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
  (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
  (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
  (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt   (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt   (with props)
    maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml   (with props)

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Nov  9 23:24:15 2006
@@ -0,0 +1,4 @@
+*.iml
+*.ipr
+*.iws
+target

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml (added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml Thu Nov  9 23:24:15 2006
@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-ndoc-plugin</artifactId>
+  <version>1.0.3</version>
+  <packaging>maven-plugin</packaging>
+  <name>Maven NDoc Report Plugin</name>
+  <prerequisites>
+    <maven>2.0.4</maven>
+  </prerequisites>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-idea-plugin</artifactId>
+          <configuration>
+            <downloadSources>true</downloadSources>
+            <downloadSourcesFilters>
+              <sources>org.apache.maven.reporting</sources>
+              <!--<sources>org.apache.maven.plugins</sources>-->
+              <sources>org.apache.maven.doxia</sources>
+              <sources>org.codehaus.plexus</sources>
+            </downloadSourcesFilters>
+            <downloadJavadocs>true</downloadJavadocs>
+            <downloadJavadocsFilters>
+              <javadoc>org.apache.maven.reporting</javadoc>
+              <!--<javadoc>org.apache.maven.plugins</javadoc>-->
+              <javadoc>org.apache.maven.doxia</javadoc>
+              <javadoc>org.codehaus.plexus</javadoc>
+            </downloadJavadocsFilters>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.reporting</groupId>
+      <artifactId>maven-reporting-api</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.reporting</groupId>
+      <artifactId>maven-reporting-impl</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-csharp-helper-plugin</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
(added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
Thu Nov  9 23:24:15 2006
@@ -0,0 +1,350 @@
+package org.apache.maven.plugin.ndoc;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.siterenderer.Renderer;
+import org.apache.maven.plugin.csharp.helper.PackagingHelper;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.codehaus.plexus.util.cli.WriterStreamConsumer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+public abstract class AbstractNDocReport
+    extends AbstractMavenReport
+{
+    /**
+     * Typically the assembly is automatically detected by looking for :
+     * ${project.build.outputDirectory}/${project.build.finalName}.dll
+     * and
+     * ${project.build.outputDirectory}/${project.build.finalName}.exe
+     * <p/>
+     * If neither of these is appropriate, the user should provide a value.
+     *
+     * @parameter
+     */
+    private File assembly;
+
+    /**
+     * @parameter expression="${project.build.outputDirectory}"
+     * @required
+     * @readonly
+     */
+    private File buildOutputDirectory;
+
+    /**
+     * @parameter expression="${project.build.finalName}"
+     * @required
+     * @readonly
+     */
+    private String buildFinalName;
+
+    /**
+     * @parameter expression="${component.org.apache.maven.doxia.siterenderer.Renderer}"
+     * @required
+     * @readonly
+     */
+    private Renderer siteRenderer;
+
+    /**
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter default-value="MSDN"
+     */
+    private String documentor;
+
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean verbose;
+
+    /**
+     * @parameter expression="${basedir}"
+     * @required
+     * @readonly
+     */
+    private File basedir;
+
+    /**
+     * @parameter expression="${ndocCommand}"
+     * @required
+     */
+    private File executable;
+
+    protected abstract File getAssembly();
+
+    protected abstract File getXmlDoc();
+
+    protected abstract File getNamespaceSummaries();
+
+    protected abstract File getWorkDirectory();
+
+    protected abstract File getOutputDirectoryAsFile();
+
+//    public boolean canGenerateReport()
+//    {
+//        //File xmlFile = new File( xmlPath );
+//        //return xmlFile.exists();
+//    }
+
+    private File cachedMainAssembly;
+
+    protected File getMainAssembly()
+    {
+        if ( this.cachedMainAssembly == null )
+        {
+            if ( this.assembly != null )
+            {
+                this.cachedMainAssembly = this.assembly;
+            }
+
+            File exeAssembly = new File( this.buildOutputDirectory, this.buildFinalName +
".exe" );
+            if ( exeAssembly.exists() )
+            {
+                this.cachedMainAssembly = exeAssembly;
+            }
+
+            File libAssembly = new File( this.buildOutputDirectory, this.buildFinalName +
".dll" );
+            this.cachedMainAssembly = libAssembly;
+        }
+        return this.cachedMainAssembly;
+    }
+
+    public boolean canGenerateReport()
+    {
+        return !this.getProject().getPackaging().equals( "pom" );
+    }
+
+    protected Renderer getSiteRenderer()
+    {
+        return siteRenderer;
+    }
+
+    protected MavenProject getProject()
+    {
+        return project;
+    }
+
+    protected String getOutputDirectory()
+    {
+        return this.getOutputDirectoryAsFile().getAbsoluteFile().toString();
+    }
+
+    protected ResourceBundle getBundle( Locale locale )
+    {
+        return ResourceBundle.getBundle( "ndoc-report", locale, this.getClass().getClassLoader()
);
+    }
+
+    protected void validateConfiguration()
+        throws MavenReportException
+    {
+        // valid assembly
+        if ( !this.getAssembly().exists() || !this.getAssembly().isFile() )
+        {
+            throw new MavenReportException( "Invalid ndoc-maven-plugin configuration: invalid
assembly file '" +
+                this.getAssembly().getAbsolutePath() + "'." );
+        }
+
+        // valid xmldoc
+        if ( !this.getXmlDoc().exists() || !this.getXmlDoc().isFile() )
+        {
+            throw new MavenReportException( "Invalid ndoc-maven-plugin configuration: invalid
XML doc file '" +
+                this.getXmlDoc().getAbsolutePath() + "'." );
+        }
+
+        // valid namespace summary file
+        if ( this.getNamespaceSummaries() != null )
+        {
+            if ( !this.getNamespaceSummaries().exists() || !this.getNamespaceSummaries().isFile()
)
+            {
+                throw new MavenReportException(
+                    "Invalid ndoc-maven-plugin configuration: invalid namespace summaries
file '" +
+                        this.getNamespaceSummaries().getAbsolutePath() + "'." );
+            }
+        }
+    }
+
+    private String[] buildCommandArguments()
+    {
+        List args = new ArrayList();
+
+        args.add( this.getAssembly().getAbsolutePath() + "," + this.getXmlDoc().getAbsolutePath()
);
+
+        if ( this.getNamespaceSummaries() != null )
+        {
+            args.add( "-namespacesummaries=" + this.getNamespaceSummaries().getAbsolutePath()
);
+        }
+
+        args.add( "-documentor=" + documentor );
+
+        if ( verbose )
+        {
+            args.add( "-verbose" );
+        }
+
+        if ( documentor.equals( "MSDN" ) )
+        {
+            args.add( "-OutputDirectory=" + this.getOutputDirectoryAsFile().getAbsolutePath()
);
+        }
+
+        if ( this.getWorkDirectory().exists() )
+        {
+
+            args.add( "-referencepath=" + this.getWorkDirectory().getAbsolutePath() );
+        }
+
+        String[] ret = new String[args.size()];
+        args.toArray( ret );
+
+        return ret;
+    }
+
+    protected void copyDependencies( List artifacts )
+        throws MavenReportException
+    {
+
+        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+        {
+
+            Artifact a = (Artifact) i.next();
+
+            if ( !a.getFile().exists() )
+            {
+                throw new MavenReportException( "Artifact file:" + a.getFile() + " does not
exist, path provided:" +
+                    a.getFile().getAbsolutePath() );
+            }
+
+            //TODO: Not sure if its ok to skip system dependencies.
+            //TODO: Need to filter by scope better (only compile scope for main, and test
scope for test, etc.
+            //only copy non-syetem deps to directory (system deps you get for free.. :-)
+            if ( !a.getFile().isDirectory() && ( !a.getScope().equals( Artifact.SCOPE_SYSTEM
) ) )
+            {
+                //if reference is a non csharp (could be java for an integration test, then
ignore it.
+                if ( PackagingHelper.isDotnetPackaging( a.getType() ) )
+                {
+                    try
+                    {
+                        FileUtils.copyFileToDirectory( a.getFile(), this.getWorkDirectory()
);
+                    }
+                    catch ( IOException e )
+                    {
+                        throw new MavenReportException( "Encountered problems copying a dependency",
e );
+                    }
+                }
+            }
+        }
+    }
+
+    public boolean isExternalReport()
+    {
+        return false;
+    }
+
+    protected void executeNDocCommand( Locale locale )
+        throws MavenReportException
+    {
+
+        this.getOutputDirectoryAsFile().mkdirs();
+
+        Commandline cli = new Commandline();
+        cli.setWorkingDirectory( basedir.getAbsolutePath() );
+        cli.setExecutable( executable.getAbsolutePath() );
+        cli.addArguments( buildCommandArguments() );
+
+        Writer stringWriter = new StringWriter();
+        StreamConsumer out = new WriterStreamConsumer( stringWriter );
+        StreamConsumer err = new WriterStreamConsumer( stringWriter );
+
+        try
+        {
+            getLog().info( "About to make NDoc command line call:" + cli.toString() );
+
+            int returnCode = CommandLineUtils.executeCommandLine( cli, out, err );
+
+            getLog().info( "NDoc output:" );
+            getLog().info( stringWriter.toString() );
+
+            if ( returnCode != 0 )
+            {
+                throw new MavenReportException( "Failed to generate NDoc documentation."
);
+            }
+
+        }
+        catch ( CommandLineException ex )
+        {
+            throw new MavenReportException( "Error while executing NDoc.", ex );
+        }
+    }
+
+    protected void writeRedirectToSink( Locale locale, String baseurl )
+    {
+        this.getLog().debug( "writting redirect to sink" );
+        Sink sink = this.getSink();
+
+        sink.text( getBundle( locale ).getString( "report.ndoc.linkintro" ) );
+
+        sink.list();
+
+        File htmlIndexFile = new File( this.getOutputDirectoryAsFile(), "/index.html" );
+        this.getLog().debug( "htmlIndexFile:" + htmlIndexFile );
+        if ( htmlIndexFile.exists() )
+        {
+            sink.listItem();
+            sink.link( baseurl + "/index.html" );
+            sink.text( getBundle( locale ).getString( "report.ndoc.htmllinkname" ) );
+            //sink.text("Html based NDoc content");
+            sink.link_();
+            sink.listItem_();
+        }
+
+        File msHelpFile = new File( this.getOutputDirectoryAsFile(), "/Documentation.chm"
);
+        this.getLog().debug( "msHelpFile:" + msHelpFile );
+        if ( msHelpFile.exists() )
+        {
+            sink.listItem();
+            sink.link( baseurl + "/Documentation.chm" );
+            sink.text( getBundle( locale ).getString( "report.ndoc.mshelplinkname" ) );
+            //sink.text("MS Help based NDoc content");
+            sink.link_();
+            sink.listItem_();
+        }
+
+        sink.list_();
+        this.getSink().close();
+    }
+}

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/AbstractNDocReport.java
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
(added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
Thu Nov  9 23:24:15 2006
@@ -0,0 +1,96 @@
+package org.apache.maven.plugin.ndoc;
+
+import org.apache.maven.reporting.MavenReportException;
+
+import java.io.File;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Goal which creates an NDoc report for the main sources.
+ *
+ * @author <a href="mailto:james.le.carpenter@jpmorgan.com">James Carpenter</a>
+ * @goal report
+ * @execute phase="process-classes"
+ * @requiresDependencyResolution compile
+ */
+public class NDocReportMojo
+    extends AbstractNDocReport
+{
+    /**
+     * Directory where reports will go.
+     *
+     * @parameter expression="${project.reporting.outputDirectory}/ndoc"
+     * @required
+     * @readonly
+     */
+    private File outputDirectory;
+
+    /**
+     * @parameter expression="${project.build.outputDirectory}/${project.build.finalName}.xml"
+     */
+    private File xmlDoc;
+
+    /**
+     * @parameter expression="${project.build.directory}/csharp-workarea/maven-ndoc-plugin/dependencies"
+     */
+    private File workDirectory;
+
+    /**
+     * @parameter
+     */
+    private File namespaceSummaries;
+
+    protected File getAssembly()
+    {
+        return this.getMainAssembly();
+    }
+
+    protected File getXmlDoc()
+    {
+        return this.xmlDoc;
+    }
+
+    protected File getNamespaceSummaries()
+    {
+        return this.namespaceSummaries;
+    }
+
+    protected File getWorkDirectory()
+    {
+        return this.workDirectory;
+    }
+
+    protected File getOutputDirectoryAsFile()
+    {
+        return this.outputDirectory;
+    }
+
+    public String getOutputName()
+    {
+        //return "ndoc/index";
+        return "ndoc-report";
+    }
+
+    public String getName( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.ndoc.name" );
+    }
+
+    public String getDescription( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.ndoc.description" );
+    }
+
+
+    protected void executeReport( Locale locale )
+        throws MavenReportException
+    {
+        this.validateConfiguration();
+        List compileDependencyArtifacts = this.getProject().getCompileArtifacts();
+        //List compileDependencyArtifacts = this.getProject().getCompileDependencies();
+        this.copyDependencies( compileDependencyArtifacts );
+        this.executeNDocCommand( locale );
+        this.writeRedirectToSink( locale, "ndoc" );
+    }
+}

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocReportMojo.java
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
(added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
Thu Nov  9 23:24:15 2006
@@ -0,0 +1,123 @@
+package org.apache.maven.plugin.ndoc;
+
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Goal which creates an NDoc report for the test sources.
+ *
+ * @author <a href="mailto:james.le.carpenter@jpmorgan.com">James Carpenter</a>
+ * @goal test-report
+ * @execute phase="test-compile"
+ * @requiresDependencyResolution test
+ */
+public class NDocTestReportMojo
+    extends AbstractNDocReport
+{
+    /**
+     * @parameter expression="${project.build.testOutputDirectory}/unit-tests.dll"
+     */
+    private File testAssembly;
+
+    /**
+     * Directory where reports will go.
+     *
+     * @parameter expression="${project.reporting.outputDirectory}/test-ndoc"
+     * @required
+     * @readonly
+     */
+    private File testOutputDirectory;
+
+    //TODO: The below expression smells wrong.  The bug is in the AbstractCompilerMojo which
fails to
+    //use different values for the outputFileName based on whether the main or test source
is being compiled.
+    /**
+     * @parameter expression="${project.build.testOutputDirectory}/${project.build.finalName}.xml"
+     */
+    private File testXmlDoc;
+
+    /**
+     * @parameter expression="${project.build.directory}/csharp-workarea/maven-ndoc-plugin/test-dependencies"
+     */
+    private File testWorkDirectory;
+
+    /**
+     * @parameter
+     */
+    private File testNamespaceSummaries;
+
+    protected File getAssembly()
+    {
+        return this.testAssembly;
+    }
+
+    protected File getXmlDoc()
+    {
+        return this.testXmlDoc;
+    }
+
+    protected File getNamespaceSummaries()
+    {
+        return this.testNamespaceSummaries;
+    }
+
+    protected File getWorkDirectory()
+    {
+        return this.testWorkDirectory;
+    }
+
+    protected File getOutputDirectoryAsFile()
+    {
+        return this.testOutputDirectory;
+    }
+
+    public String getOutputName()
+    {
+        //return "test-ndoc/index";
+        return "ndoc-test-report";
+    }
+
+    public String getName( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.ndoc.test.name" );
+    }
+
+    public String getDescription( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.ndoc.test.description" );
+    }
+
+    protected void executeReport( Locale locale )
+        throws MavenReportException
+    {
+        this.validateConfiguration();
+        List testDependencyArtifacts = this.getProject().getTestArtifacts();
+        this.copyDependencies( testDependencyArtifacts );
+
+        //test code may require main src artifact
+        try
+        {
+            File mainAssemblyFile = this.getMainAssembly();
+            if ( mainAssemblyFile.exists() )
+            {
+                FileUtils.copyFileToDirectory( this.getMainAssembly(), this.getWorkDirectory()
);
+            }
+            else
+            {
+                this.getLog().warn(
+                    "The main assembly doesn't exist.  This may cause problems for the ndoc
test-report" );
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new MavenReportException( "Encountered problems copying main assembly file",
e );
+        }
+
+        this.executeNDocCommand( locale );
+        this.writeRedirectToSink( locale, "test-ndoc" );
+    }
+}

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/java/org/apache/maven/plugin/ndoc/NDocTestReportMojo.java
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
(added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
Thu Nov  9 23:24:15 2006
@@ -0,0 +1,8 @@
+report.ndoc.name=NDoc Report
+report.ndoc.description=NDoc of the project source
+report.ndoc.test.name=NDoc Test Report
+report.ndoc.test.description=NDoc of the project test source
+report.ndoc.htmllinkname=Html format
+report.ndoc.mshelplinkname=MS Help format
+report.ndoc.linkintro=The NDoc generated report in various formats can be found by following
the links below.
+#report.ndoc.header=NDoc Report

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/main/resources/ndoc-report.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt (added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt Thu Nov  9
23:24:15 2006
@@ -0,0 +1,12 @@
+ ------
+ Introduction
+ ------
+ James Carpenter
+ ------
+ Aug 31, 2006
+ ------
+
+
+Maven 2 NDoc Plugin
+
+  This plugin wraps the {{{ndoc}http://ndoc.sourceforge.net}} command line tool.  To the
extent the command line options do not change between ndoc versions you should be able to
use any version of ndoc.  The plugin has only been tested with NDoc 1.3.

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt (added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt Thu Nov  9
23:24:15 2006
@@ -0,0 +1,75 @@
+ ------
+ Usage
+ ------
+ James Carpenter
+ ------
+ Aug 31, 2006
+ ------
+
+Install NDoc
+
+  If you have not already done so, you will need to go to {{http://ndoc.sourceforge.net}}
and download the most recent copy of NDoc.  NDoc provides the usual windows installer.  Just
execute the installer and note where NDoc has been installed.
+
+ Note: The plugin is known to work with NDoc version 1.3.  To the extent the command line
options do not change between ndoc versions you should be able to use any version of NDoc
you like.
+
+Configuration
+
+* settings.xml Configuration
+
+ The ndoc plugin looks for the ndocCommand property.  This will typically be placed into
one of your active profiles within settings.xml.  The value of the ndocCommand property should
point to the NDocConsole.exe executable on your workstation. An example snipt of settings.xml
is shown below:
+
++---------------------------------
+<properties>
+	<!--various other properties such as dotnet.home are likely found here as well-->
+        <ndocCommand>C:/Program Files/NDoc 1.3/bin/net/1.1/NDocConsole.exe</ndocCommand>
+</properties>
++----------------------------------
+
+* pom.xml Configuration
+
+ As with any report plugin you will need to register the ndoc plugin in your pom (or parent
pom).  An example is shown below.
+
++----------------------------------
+<reporting>
+   <plugins>
+      <!--various other report plugins here -->
+      <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-ndoc-plugin</artifactId>
+         <version>1.0.0</version>
+         <configuration>
+            <documentor>MSDN</documentor>
+         </configuration>
+         <reportSets>
+            <reportSet>
+               <id>mainAndTestDocs</id>
+               <reports>
+                  <report>report</report>
+                  <report>test-report</report>
+               </reports>
+            </reportSet>
+         </reportSets>
+      </plugin>
+   </plugins>
+</reporting>
++----------------------------------
+
+Executing Reports
+
+* Execution during Site Generation
+
+ The ndoc reports will be generated along with every other report whenever "mvn site:site"
is run.
+
+* Manually run a Report
+
+ As with most other reports you can execute the report or test-report without using the site
plugin.
+
+*--------------------*----------------------------------------------------------+
+|<<Report>>          |<<mvn command line>>                      
               |
+*--------------------*----------------------------------------------------------+
+|ndoc for main source|mvn org.apache.maven.plugins:maven-ndoc-plugin:report     |
+*--------------------*----------------------------------------------------------+
+|ndoc for test source|mvn org.apache.maven.plugins:maven-ndoc-plugin:test-report|
+*--------------------*----------------------------------------------------------+
+
+

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/apt/usage.apt
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml?view=auto&rev=473221
==============================================================================
--- maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml (added)
+++ maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml Thu Nov  9 23:24:15
2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<project name="Maven NDoc Report Plugin">
+  <body>
+    <menu name="Overview">
+      <item name="Introduction" href="index.html"/>
+      <item name="Usage" href="usage.html"/>
+    </menu>
+  </body>
+</project>

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/csharp/maven-csharp/maven-ndoc-plugin/src/site/site.xml
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message