Removed:
trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/ASDocMojo.java
trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/ASDocReportMojo.java
Modified:
trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/AbstractASDocMojo.java
trunk/maven-flex2-plugin/pom.xml
trunk/maven-flex2-plugin/src/it/maven-flex2-actionscript2-test/pom.xml
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/ASDocMojo.java
Log:
add some logic for doing a site report.
Modified: trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/AbstractASDocMojo.java
==============================================================================
---
trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/AbstractASDocMojo.java (original)
+++
trunk/maven-asdoc-plugin/src/main/java/net/israfil/mojo/reporting/asdoc/AbstractASDocMojo.java
Tue Jan 8 22:59:48 2008
@@ -33,13 +33,9 @@
*/
package net.israfil.mojo.reporting.asdoc;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
@@ -51,7 +47,7 @@
*
*
*/
-public class AbstractASDocMojo {
+public class AbstractASDocMojo extends AbstractMojo {
/**
* The Maven Project Object
@@ -62,77 +58,13 @@
*/
protected MavenProject project;
- /**
- * Specifies a documentation resources directory to be
- * included in the api documents (i.e. descriptions, images...).
- *
- * @parameter expression="${basedir}/src/main/asdoc"
- */
- private String asdocDirectory;
-
- /**
- * Set an additional parameter(s) on the command line. This value
should include quotes as necessary for
- * parameters that include spaces.
- *
- * @parameter expression="${additionalparam}"
- */
- private Properties additionalparam;
-
- /**
- * Used for resolving artifacts
- *
- * @component
- */
- private ArtifactResolver resolver;
-
- /**
- * Factory for creating artifact objects
- *
- * @component
- */
- private ArtifactFactory factory;
-
- /**
- * The local repository where the artifacts are located
- *
- * @parameter expression="${localRepository}"
- */
- private ArtifactRepository localRepository;
-
- /**
- * The remote repositories where artifacts are located
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- */
- private List remoteRepositories;
+ public void execute() throws MojoExecutionException,
MojoFailureException {
- /**
- * The projects in the reactor for aggregation report.
- *
- * @parameter expression="${reactorProjects}"
- * @readonly
- */
- private List reactorProjects;
+ //VMARGS="-Xmx1024m -Dsun.io.useCanonCaches=false -Xbootclasspath/p:$FLEX_HOME/asdoc/lib/xalan.jar"
- /**
- * Whether to build an aggregated report at the root, or build
individual reports.
- *
- * @parameter expression="${aggregate}" default-value="false"
- */
- protected boolean aggregate;
+ //java $VMARGS -classpath "$FLEX_HOME/lib/asdoc.jar"
flex2.tools.ASDoc +flexlib="$FLEX_HOME/frameworks" $*
+
- /**
- * Used to resolve artifacts of aggregated modules
- *
- * @component
- */
- private ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * Set this to 'true' to debug Javadoc plugin. With
this, 'options' and 'files' files are provided.
- *
- * @parameter expression="${debug}" default-value="false"
- */
- private boolean debug;
-
+ }
+
}
Modified: trunk/maven-flex2-plugin/pom.xml
==============================================================================
--- trunk/maven-flex2-plugin/pom.xml (original)
+++ trunk/maven-flex2-plugin/pom.xml Tue Jan 8 22:59:48 2008
@@ -55,7 +55,7 @@
<file>${basedir}/target/${build.finalName}.jar</file>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
- <version>it-${project.version}</version>
+ <version>it-testing</version>
<packaging>maven-plugin</packaging>
<pomFile>${basedir}/pom.xml</pomFile>
</configuration>
@@ -66,6 +66,12 @@
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<debug>true</debug>
+ <goals>
+ <goal>package</goal>
+ <!--
+ <goal>net.israfil.mojo:maven-flex2-plugin:testing:asdoc</goal>
+ -->
+ </goals>
<projectsDirectory>src/it</projectsDirectory>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
@@ -73,7 +79,7 @@
<testProperties>
<property>
<name>provided.version</name>
- <value>${project.version}</value>
+ <value>testing</value>
</property>
</testProperties>
</configuration>
@@ -136,6 +142,11 @@
<artifactId>maven-project</artifactId>
<version>${maven.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-impl</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
Modified: trunk/maven-flex2-plugin/src/it/maven-flex2-actionscript2-test/pom.xml
==============================================================================
---
trunk/maven-flex2-plugin/src/it/maven-flex2-actionscript2-test/pom.xml (original)
+++
trunk/maven-flex2-plugin/src/it/maven-flex2-actionscript2-test/pom.xml
Tue Jan 8 22:59:48 2008
@@ -21,12 +21,14 @@
<javaOpt>-Xmx512m</javaOpt>
</javaOpts>
</configuration>
+ <!--
<executions>
<execution>
<goals><goal>asdoc</goal></goals>
<phase>package</phase>
</execution>
</executions>
+ -->
</plugin>
</plugins>
</build>
Modified: trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/ASDocMojo.java
==============================================================================
---
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/ASDocMojo.java (original)
+++
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/ASDocMojo.java
Tue Jan 8 22:59:48 2008
@@ -36,9 +36,16 @@
import java.io.File;
import java.io.IOException;
import java.util.List;
+import java.util.Locale;
+
+import javax.swing.Renderer;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.reporting.MavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.doxia.sink.Sink;
+import org.codehaus.plexus.util.StringUtils;
/**
@@ -51,16 +58,104 @@
* @requiresDependencyResolution
* @requiresProject
*/
-public class ASDocMojo extends AbstractFlexMojo {
+public class ASDocMojo extends AbstractFlexMojo implements MavenReport {
+
+ /**
+ * Generates the site report
+ *
+ * @component
+ */
+ private Renderer siteRenderer;
+
+ /**
+ * Specifies the destination directory where javadoc saves the
generated HTML files.
+ *
+ * @parameter expression="${project.reporting.outputDirectory}/apidocs"
+ * @required
+ */
+ private File reportOutputDirectory;
+
+ /**
+ * The name of the destination directory.
+ *
+ * @parameter expression="${destDir}" default-value="apidocs"
+ */
+ private String destDir;
- /**
+ /**
* The location of the asdoc templates to be used in generating documentation
*
* @parameter expression="${asdoc.templates}" default-value="${flex.home}/asdoc/templates"
* @required
*/
protected File asdocTemplates;
-
+
+ /**
+ * Report name
+ *
+ * @parameter default-value="ASDocs"
+ * @required
+ */
+ private String name;
+
+ /**
+ * Report description
+ *
+ * @parameter default-value="ASDoc Actionscript API Documentation"
+ * @required
+ */
+ private String description;
+
+ public boolean canGenerateReport() {
+ // TODO: Make this do aggregate reports of all sub-projects.
+ // See: JavadocReport
+ return true;
+ }
+
+ public String getCategoryName() {
+ return CATEGORY_PROJECT_REPORTS;
+ }
+
+ public String getDescription( Locale locale ) {
+ return description;
+ }
+
+ public String getName(Locale locale) {
+ return name;
+ }
+
+ public String getOutputName() {
+ return destDir + "/index";
+ }
+
+ public File getReportOutputDirectory() {
+ return reportOutputDirectory;
+ }
+
+ public boolean isExternalReport() {
+ return true;
+ }
+
+ /**
+ * Method to set the directory where the generated reports will be
put. As
+ * with Javadoc, make sure that the resulting path ends with ${destdir}
+ *
+ * @param reportOutputDirectory the directory file to be set
+ */
+ public void setReportOutputDirectory( File reportOutputDirectory ) {
+ if ( ( reportOutputDirectory != null ) &&
( !reportOutputDirectory.getAbsolutePath().endsWith( destDir ) ) ){
+ this.reportOutputDirectory = new File(
reportOutputDirectory, destDir );
+ } else {
+ this.reportOutputDirectory = reportOutputDirectory;
+ }
+ }
+
+ public void generate(Sink sink, Locale locale) throws
MavenReportException {
+ // TODO Auto-generated method stub
+
+ }
+
+
protected String getCompilerClass() { return "flex2.tools.ASDoc"; }
protected String getExecutableJar() { return "asdoc.jar"; }
@@ -97,7 +192,7 @@
// define output folder.
parameters.add("-output");
- File asdocOutput = new File(outputDirectory,"asdoc");
+ File asdocOutput = reportOutputDirectory;
try {
parameters.add(asdocOutput.getCanonicalPath());
} catch (IOException e) {
@@ -112,6 +207,8 @@
}
+
+
/*
asdoc -source-path C:\flex\frameworks\source