From 39261ec689e14025a051c447e11792a444a78b6f Mon Sep 17 00:00:00 2001 From: Eugene Platonov Date: Fri, 5 Jan 2024 18:58:23 -0500 Subject: [PATCH] Fix javadoc generation --- .github/workflows/ci.yml | 2 + pom.xml | 23 +++++----- .../org/scoverage/plugin/ScalaVersion.java | 42 +++++++++++++++++++ 3 files changed, 55 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eee4c224..a29a09a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,3 +26,5 @@ jobs: run: mvn --version - name: Build run: mvn -ntp -B clean verify + - name: Generate site + run: mvn -ntp -B clean site -P publicsite diff --git a/pom.xml b/pom.xml index 8e39b0d4..8e6a46d8 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,8 @@ under the License. 3.9.6 3.10.2 + 3.1.1 + 1.11.1 2.0.11 2.13 @@ -147,13 +149,13 @@ under the License. org.apache.maven.reporting maven-reporting-api - 3.1.1 + ${maven-reporting-api.version} org.apache.maven.doxia doxia-site-renderer - 1.11.1 + ${doxia.version} @@ -264,10 +266,9 @@ under the License. org.scoverage.plugin https://docs.oracle.com/javase/11/docs/api/ - https://maven.apache.org/ref/${maven.version}/maven-plugin-api/apidocs/ - https://maven.apache.org/ref/${maven.version}/maven-project/apidocs/ - https://maven.apache.org/ref/${maven.version}/maven-reporting/maven-reporting-api/apidocs/ - https://maven.apache.org/doxia/doxia/apidocs/ + https://maven.apache.org/ref/${maven.version}/apidocs/ + https://maven.apache.org/shared-archives/maven-reporting-api-${maven-reporting-api.version}/apidocs/ + https://maven.apache.org/doxia/components/doxia-archives/doxia-${doxia.version}/apidocs/ true @@ -580,6 +581,10 @@ under the License. + + org.apache.maven.plugins + maven-plugin-report-plugin + org.apache.maven.plugins maven-javadoc-plugin @@ -591,10 +596,6 @@ under the License. - - org.apache.maven.plugins - maven-plugin-report-plugin - @@ -749,13 +750,11 @@ under the License. org.apache.maven.plugins maven-source-plugin - 3.3.0 org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 diff --git a/src/main/java/org/scoverage/plugin/ScalaVersion.java b/src/main/java/org/scoverage/plugin/ScalaVersion.java index f36b3d00..0c3b0bcd 100644 --- a/src/main/java/org/scoverage/plugin/ScalaVersion.java +++ b/src/main/java/org/scoverage/plugin/ScalaVersion.java @@ -9,13 +9,42 @@ public class ScalaVersion { private static final Pattern regexp = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?([-\\.].+)?"); + /** + * The full version number, including the modifier if any. + */ public String full; + + /** + * The binary compatible version number for this Scala version. + * e.g. for 2.10.0-M1, this would be 2.10.0-M1, for 2.10.0, this would be 2.10, for 3.3.1, this would be 3. + */ public String compatible; + + /** + * The major Scala version number. e.g. for 2.10.0-M1, this would be 2. + */ public int major; + + /** + * The minor Scala version number. e.g. for 2.10.0-M1, this would be 10. + */ public int minor; + + /** + * The bugfix Scala version number. e.g. for 2.10.0-M1, this would be 0. + */ public int bugfix; + + /** + * The modifier for this Scala version. e.g. for 2.10.0-M1, this would be M1. + */ public String modifier; + /** + * Creates a ScalaVersion from a String. + * + * @param s String to parse + */ public ScalaVersion(String s) { full = s; // parse @@ -40,6 +69,9 @@ public ScalaVersion(String s) { /** * Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix. + * + * @param other ScalaVersion to compare to + * @return true if this version is of the same or newer Scala version as the other version */ public boolean isAtLeast(ScalaVersion other) { return major >= other.major && @@ -48,10 +80,20 @@ public boolean isAtLeast(ScalaVersion other) { } + /** + * Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix. + * + * @param scalaVersion to compare to + * @return true if this version is of the same or newer Scala version as the other version + */ public boolean isAtLeast(String scalaVersion) { return isAtLeast(new ScalaVersion(scalaVersion)); } + + /** + * @return true if this is a Scala 2 version + */ public boolean isScala2() { return major == 2; }