You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/11/27 18:44:33 UTC

[GitHub] [maven-reporting-impl] hboutemy opened a new pull request, #13: [MSHARED-1168] support markup output

hboutemy opened a new pull request, #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13

   https://issues.apache.org/jira/browse/MSHARED-1168


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] hboutemy commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by "hboutemy (via GitHub)" <gi...@apache.org>.
hboutemy commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1091293652


##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -159,6 +165,14 @@
     /** The current report output directory to use */
     private File reportOutputDirectory;
 
+    /**
+     * The output format: null by default, to represent a site, but can be configured to a Doxia sink.
+     */
+    @Parameter( property = "output.format" )

Review Comment:
   I don't know if we should call it `reporting.format` instead...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] asfgit merged pull request #13: [MSHARED-1168] support markup output

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit merged PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] hboutemy commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by GitBox <gi...@apache.org>.
hboutemy commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1045257544


##########
pom.xml:
##########
@@ -131,6 +132,17 @@
       <artifactId>doxia-site-renderer</artifactId>
       <version>${doxiaSitetoolsVersion}</version>
     </dependency>
+    <!-- Doxia markup rendering -->
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-apt</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-xdoc</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>

Review Comment:
   sadly no



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] michael-o commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1092097811


##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -159,6 +165,14 @@
     /** The current report output directory to use */
     private File reportOutputDirectory;
 
+    /**
+     * The output format: null by default, to represent a site, but can be configured to a Doxia sink.
+     */
+    @Parameter( property = "output.format" )

Review Comment:
   `reporting.ouputFormat` since input format is implied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] michael-o commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1033951738


##########
pom.xml:
##########
@@ -131,6 +132,17 @@
       <artifactId>doxia-site-renderer</artifactId>
       <version>${doxiaSitetoolsVersion}</version>
     </dependency>
+    <!-- Doxia markup rendering -->
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-apt</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-xdoc</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>

Review Comment:
   Aren't these sufficient at runtime?



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -163,6 +177,61 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "rendering to " + outputFormat + " markup" );

Review Comment:
   Rendering...



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -163,6 +177,61 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "rendering to " + outputFormat + " markup" );
+
+        if ( !isExternalReport() )
+        {
+            try
+            {
+                sinkFactory = container.lookup( SinkFactory.class, outputFormat );
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+            }
+            catch ( ComponentLookupException cle )
+            {
+                throw new MojoExecutionException(
+                    "Cannot find SinkFactory for Doxia output format: " + outputFormat, cle );
+            }
+            catch ( IOException ioe )
+            {
+                throw new MojoExecutionException( "Cannot create sink to " + outputDirectory, ioe );

Review Comment:
   sink for 



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -383,7 +452,10 @@ protected Skin getSkin()
      */
     protected void closeReport()
     {
-        getSink().close();
+        if ( getSink() != null )

Review Comment:
   When can the sink be `null`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] michael-o commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1092099380


##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -174,6 +188,62 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "Rendering to " + outputFormat + " markup" );
+
+        if ( !isExternalReport() )
+        {
+            try
+            {
+                sinkFactory = container.lookup( SinkFactory.class, outputFormat );
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+            }
+            catch ( ComponentLookupException cle )
+            {
+                throw new MojoExecutionException(
+                    "Cannot find SinkFactory for Doxia output format: " + outputFormat, cle );
+            }
+            catch ( IOException ioe )
+            {
+                throw new MojoExecutionException( "Cannot create sink to "
+                    + new File( outputDirectory, getOutputName() + '.' + outputFormat ), ioe );
+            }
+        }
+
+        try
+        {
+            Locale locale = Locale.getDefault();
+            generate( sink, sinkFactory, locale );

Review Comment:
   Attention: This needs to be rebased.



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -174,6 +188,62 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "Rendering to " + outputFormat + " markup" );
+
+        if ( !isExternalReport() )
+        {
+            try
+            {
+                sinkFactory = container.lookup( SinkFactory.class, outputFormat );
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+            }
+            catch ( ComponentLookupException cle )
+            {
+                throw new MojoExecutionException(
+                    "Cannot find SinkFactory for Doxia output format: " + outputFormat, cle );
+            }
+            catch ( IOException ioe )
+            {
+                throw new MojoExecutionException( "Cannot create sink to "
+                    + new File( outputDirectory, getOutputName() + '.' + outputFormat ), ioe );

Review Comment:
   Output format does not necessarily correspond to the output extension.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] michael-o commented on pull request #13: [MSHARED-1168] support markup output

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#issuecomment-1421368338

   @hboutemy Can you address the outstanding discussions? I'd like to release within a week or so.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] hboutemy commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by "hboutemy (via GitHub)" <gi...@apache.org>.
hboutemy commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1091293066


##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -163,6 +177,61 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "rendering to " + outputFormat + " markup" );
+
+        if ( !isExternalReport() )
+        {
+            try
+            {
+                sinkFactory = container.lookup( SinkFactory.class, outputFormat );
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+            }
+            catch ( ComponentLookupException cle )
+            {
+                throw new MojoExecutionException(
+                    "Cannot find SinkFactory for Doxia output format: " + outputFormat, cle );
+            }
+            catch ( IOException ioe )
+            {
+                throw new MojoExecutionException( "Cannot create sink to " + outputDirectory, ioe );

Review Comment:
   no, sink to a file in a directory, not for a report



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-reporting-impl] hboutemy commented on a diff in pull request #13: [MSHARED-1168] support markup output

Posted by GitBox <gi...@apache.org>.
hboutemy commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1045257458


##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -383,7 +452,10 @@ protected Skin getSkin()
      */
     protected void closeReport()
     {
-        getSink().close();
+        if ( getSink() != null )

Review Comment:
   just remove this test and you'll see :)
   honestly, perhaps it's just unit-test, not real world, adding the code was easier than going more in depth...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org