Skip to content

Fix javadoc generation #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 11 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ under the License.

<maven.version>3.9.6</maven.version>
<maven-plugin-plugin.version>3.10.2</maven-plugin-plugin.version>
<maven-reporting-api.version>3.1.1</maven-reporting-api.version>
<doxia.version>1.11.1</doxia.version>

<scalac-scoverage-plugin.version>2.0.11</scalac-scoverage-plugin.version>
<scalac-scoverage-plugin.scala.version>2.13</scalac-scoverage-plugin.scala.version>
Expand Down Expand Up @@ -147,13 +149,13 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.1.1</version>
<version>${maven-reporting-api.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>1.11.1</version>
<version>${doxia.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -264,10 +266,9 @@ under the License.
<subpackages>org.scoverage.plugin</subpackages>
<links>
<link>https://docs.oracle.com/javase/11/docs/api/</link>
<link>https://maven.apache.org/ref/${maven.version}/maven-plugin-api/apidocs/</link>
<link>https://maven.apache.org/ref/${maven.version}/maven-project/apidocs/</link>
<link>https://maven.apache.org/ref/${maven.version}/maven-reporting/maven-reporting-api/apidocs/</link>
<link>https://maven.apache.org/doxia/doxia/apidocs/</link>
<link>https://maven.apache.org/ref/${maven.version}/apidocs/</link>
<link>https://maven.apache.org/shared-archives/maven-reporting-api-${maven-reporting-api.version}/apidocs/</link>
<link>https://maven.apache.org/doxia/components/doxia-archives/doxia-${doxia.version}/apidocs/</link>
</links>
<notimestamp>true</notimestamp>
</configuration>
Expand Down Expand Up @@ -580,6 +581,10 @@ under the License.

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -591,10 +596,6 @@ under the License.
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-report-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</profile>
Expand Down Expand Up @@ -749,13 +750,11 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
</plugin>

<plugin>
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/org/scoverage/plugin/ScalaVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 &&
Expand All @@ -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;
}
Expand Down