This is an automated email from the ASF dual-hosted git repository. sjaranowski pushed a commit to branch MPLUGIN-499 in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit f80f8a85cec04a72c768b30bf1dec12d11a1a66e Author: Slawomir Jaranowski <s.jaranow...@gmail.com> AuthorDate: Mon Dec 25 23:30:58 2023 +0100 [MPLUGIN-499] Add deprecate description in parameters table --- .../src/it/plugin-report-annotations/verify.bsh | 55 ---------------------- .../verify.groovy | 11 ++--- .../src/it/plugin-report/verify.groovy | 7 ++- .../maven/plugin/plugin/report/GoalRenderer.java | 11 +++-- .../src/main/resources/plugin-report.properties | 4 +- .../src/main/resources/plugin-report_de.properties | 4 +- .../src/main/resources/plugin-report_fr.properties | 4 +- .../src/main/resources/plugin-report_sv.properties | 4 +- 8 files changed, 27 insertions(+), 73 deletions(-) diff --git a/maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.bsh b/maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.bsh deleted file mode 100644 index e884269e..00000000 --- a/maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.bsh +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.io.*; -import java.util.*; -import java.util.regex.*; - -try -{ - File siteDir = new File( basedir, "target/site" ); - System.out.println( "Checking for existence of site directory: " + siteDir ); - if ( !siteDir.isDirectory() ) - { - System.out.println( "FAILED!" ); - return false; - } - - String[] expectedFiles = { - "noop-mojo.html", - "report-mojo.html", - }; - for ( String path : expectedFiles ) - { - File file = new File( siteDir, path ); - System.out.println( "Checking for existence of doc file: " + file ); - if ( !file.isFile() || file.length() <= 0 ) - { - System.out.println( "FAILED!" ); - return false; - } - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.groovy similarity index 74% copy from maven-plugin-report-plugin/src/it/plugin-report/verify.groovy copy to maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.groovy index 2f24cb8a..d9ea1b78 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report-annotations/verify.groovy @@ -29,10 +29,9 @@ assert !pluginInfo.text.contains('Disk Space') assert pluginInfo.text.contains('1.8') assert pluginInfo.text.contains('3.2.5') -assert new File( basedir, 'target/site/de/noop-mojo.html' ).isFile() -assert new File( basedir, 'target/site/de/report-mojo.html' ).isFile() -assert new File( basedir, 'target/site/de/plugin-info.html' ).isFile() +def noopMojo = new File( basedir, 'target/site/noop-mojo.html' ) +assert noopMojo.isFile() + +// deprecated in table and details +assert noopMojo.text.count('<div><strong>Deprecated:</strong> Just testing.</div><br />') == 2 -assert new File( basedir, 'target/site/fr/noop-mojo.html' ).isFile() -assert new File( basedir, 'target/site/fr/report-mojo.html' ).isFile() -assert new File( basedir, 'target/site/fr/plugin-info.html' ).isFile() diff --git a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy index 2f24cb8a..90ab19ac 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy @@ -17,7 +17,6 @@ * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).isFile() assert new File( basedir, 'target/site/report-mojo.html' ).isFile() def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) @@ -36,3 +35,9 @@ assert new File( basedir, 'target/site/de/plugin-info.html' ).isFile() assert new File( basedir, 'target/site/fr/noop-mojo.html' ).isFile() assert new File( basedir, 'target/site/fr/report-mojo.html' ).isFile() assert new File( basedir, 'target/site/fr/plugin-info.html' ).isFile() + +def noopMojo = new File( basedir, 'target/site/noop-mojo.html' ) +assert noopMojo.isFile() + +// deprecated in table and details +assert noopMojo.text.count('<div><strong>Deprecated:</strong> Just testing.</div><br />') == 2 diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java index eac6c0c7..93993dae 100644 --- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java +++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java @@ -275,9 +275,13 @@ public class GoalRenderer extends AbstractPluginReportRenderer { String description; String context = "Parameter " + parameter.getName() + " in goal " + descriptor.getGoal(); if (StringUtils.isNotEmpty(parameter.getDeprecated())) { - String deprecated = getXhtmlWithValidatedLinks(parameter.getDescription(), context); - description = format("parameter.deprecated", deprecated); - } else if (StringUtils.isNotEmpty(parameter.getDescription())) { + String deprecated = getXhtmlWithValidatedLinks(parameter.getDeprecated(), context); + sink.division(); + sink.rawText(format("parameter.deprecated", deprecated)); + sink.division_(); + sink.lineBreak(); + } + if (StringUtils.isNotEmpty(parameter.getDescription())) { description = getXhtmlWithValidatedLinks(parameter.getDescription(), context); } else { description = getI18nString("nodescription"); @@ -309,6 +313,7 @@ public class GoalRenderer extends AbstractPluginReportRenderer { String deprecated = getXhtmlWithValidatedLinks(parameter.getDeprecated(), context); sink.rawText(format("parameter.deprecated", deprecated)); sink.division_(); + sink.lineBreak(); } sink.division(); diff --git a/maven-plugin-report-plugin/src/main/resources/plugin-report.properties b/maven-plugin-report-plugin/src/main/resources/plugin-report.properties index 9dd84a92..80997195 100644 --- a/maven-plugin-report-plugin/src/main/resources/plugin-report.properties +++ b/maven-plugin-report-plugin/src/main/resources/plugin-report.properties @@ -28,7 +28,7 @@ report.plugin.goals.column.isMavenReport=Report? report.plugin.goals.column.description=Description report.plugin.goal.nodescription=No description. -report.plugin.goal.deprecated=Deprecated. +report.plugin.goal.deprecated=Deprecated report.plugin.goal.notice.prefix=Note report.plugin.goal.notice.isMavenReport=This goal should be used as a Maven report. report.plugin.goal.fullname=Full name @@ -63,7 +63,7 @@ report.plugin.goal.parameter.name=<{0}> report.plugin.goal.parameter.defaultValue=Default report.plugin.goal.parameter.property=User Property report.plugin.goal.parameter.alias=Alias -report.plugin.goal.parameter.deprecated=<strong>Deprecated.</strong> {0} +report.plugin.goal.parameter.deprecated=<strong>Deprecated:</strong> {0} report.plugin.goal.parameter.type=Type report.plugin.goal.parameter.required=Required report.plugin.goal.parameter.expression=Expression diff --git a/maven-plugin-report-plugin/src/main/resources/plugin-report_de.properties b/maven-plugin-report-plugin/src/main/resources/plugin-report_de.properties index 879ad417..d2b301f1 100644 --- a/maven-plugin-report-plugin/src/main/resources/plugin-report_de.properties +++ b/maven-plugin-report-plugin/src/main/resources/plugin-report_de.properties @@ -27,8 +27,8 @@ report.plugin.goals.column.goal=Goal report.plugin.goals.column.isMavenReport=Bericht? report.plugin.goals.column.description=Beschreibung report.plugin.goal.nodescription=Keine Beschreibung. -report.plugin.goal.deprecated=Missbilligt. - +report.plugin.goal.deprecated=Missbilligt +report.plugin.goal.parameter.deprecated=<strong>Missbilligt:</strong> {0} report.plugin.goal.yes=Ja report.plugin.goal.no=Nein diff --git a/maven-plugin-report-plugin/src/main/resources/plugin-report_fr.properties b/maven-plugin-report-plugin/src/main/resources/plugin-report_fr.properties index eccc2d2f..0c64cba2 100644 --- a/maven-plugin-report-plugin/src/main/resources/plugin-report_fr.properties +++ b/maven-plugin-report-plugin/src/main/resources/plugin-report_fr.properties @@ -27,8 +27,8 @@ report.plugin.goals.column.goal=Goal report.plugin.goals.column.isMavenReport=Rapport? report.plugin.goals.column.description=Description report.plugin.goal.nodescription=Pas de description. -report.plugin.goal.deprecated=Obsol\u00E8te. - +report.plugin.goal.deprecated=Obsol\u00E8te +report.plugin.goal.parameter.deprecated=<strong>Obsol\u00E8te :</strong> {0} report.plugin.goal.yes=Oui report.plugin.goal.no=Non diff --git a/maven-plugin-report-plugin/src/main/resources/plugin-report_sv.properties b/maven-plugin-report-plugin/src/main/resources/plugin-report_sv.properties index 08709667..d178123a 100644 --- a/maven-plugin-report-plugin/src/main/resources/plugin-report_sv.properties +++ b/maven-plugin-report-plugin/src/main/resources/plugin-report_sv.properties @@ -27,8 +27,8 @@ report.plugin.goals.column.goal=M\u00E5l report.plugin.goals.column.isMavenReport=Rapport? report.plugin.goals.column.description=Beskrivning report.plugin.goal.nodescription=Ingen beskrivning. -report.plugin.goal.deprecated=F\u00F6r\u00E5ldrat. - +report.plugin.goal.deprecated=F\u00F6r\u00E5ldrat +report.plugin.goal.parameter.deprecated=<strong>F\u00F6r\u00E5ldrat:</strong> {0} report.plugin.goal.yes=Ja report.plugin.goal.no=Nej