Skip to content

Commit d6378b7

Browse files
committed
Fix javadoc generation
1 parent e3d0e90 commit d6378b7

File tree

3 files changed

+55
-12
lines changed

3 files changed

+55
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ jobs:
2626
run: mvn --version
2727
- name: Build
2828
run: mvn -ntp -B clean verify
29+
- name: Generate site
30+
run: mvn -ntp -B clean site -P publicsite

pom.xml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ under the License.
8989

9090
<maven.version>3.9.6</maven.version>
9191
<maven-plugin-plugin.version>3.10.2</maven-plugin-plugin.version>
92+
<maven-reporting-api.version>3.1.1</maven-reporting-api.version>
93+
<doxia.version>1.11.1</doxia.version>
9294

9395
<scalac-scoverage-plugin.version>2.0.11</scalac-scoverage-plugin.version>
9496
<scalac-scoverage-plugin.scala.version>2.13</scalac-scoverage-plugin.scala.version>
@@ -147,13 +149,13 @@ under the License.
147149
<dependency>
148150
<groupId>org.apache.maven.reporting</groupId>
149151
<artifactId>maven-reporting-api</artifactId>
150-
<version>3.1.1</version>
152+
<version>${maven-reporting-api.version}</version>
151153
</dependency>
152154

153155
<dependency>
154156
<groupId>org.apache.maven.doxia</groupId>
155157
<artifactId>doxia-site-renderer</artifactId>
156-
<version>1.11.1</version>
158+
<version>${doxia.version}</version>
157159
</dependency>
158160

159161
<dependency>
@@ -264,10 +266,9 @@ under the License.
264266
<subpackages>org.scoverage.plugin</subpackages>
265267
<links>
266268
<link>https://docs.oracle.com/javase/11/docs/api/</link>
267-
<link>https://maven.apache.org/ref/${maven.version}/maven-plugin-api/apidocs/</link>
268-
<link>https://maven.apache.org/ref/${maven.version}/maven-project/apidocs/</link>
269-
<link>https://maven.apache.org/ref/${maven.version}/maven-reporting/maven-reporting-api/apidocs/</link>
270-
<link>https://maven.apache.org/doxia/doxia/apidocs/</link>
269+
<link>https://maven.apache.org/ref/${maven.version}/apidocs/</link>
270+
<link>https://maven.apache.org/shared-archives/maven-reporting-api-${maven-reporting-api.version}/apidocs/</link>
271+
<link>https://maven.apache.org/doxia/components/doxia-archives/doxia-${doxia.version}/apidocs/</link>
271272
</links>
272273
<notimestamp>true</notimestamp>
273274
</configuration>
@@ -580,6 +581,10 @@ under the License.
580581

581582
<reporting>
582583
<plugins>
584+
<plugin>
585+
<groupId>org.apache.maven.plugins</groupId>
586+
<artifactId>maven-plugin-report-plugin</artifactId>
587+
</plugin>
583588
<plugin>
584589
<groupId>org.apache.maven.plugins</groupId>
585590
<artifactId>maven-javadoc-plugin</artifactId>
@@ -591,10 +596,6 @@ under the License.
591596
</reportSet>
592597
</reportSets>
593598
</plugin>
594-
<plugin>
595-
<groupId>org.apache.maven.plugins</groupId>
596-
<artifactId>maven-plugin-report-plugin</artifactId>
597-
</plugin>
598599
</plugins>
599600
</reporting>
600601
</profile>
@@ -749,13 +750,11 @@ under the License.
749750
<plugin>
750751
<groupId>org.apache.maven.plugins</groupId>
751752
<artifactId>maven-source-plugin</artifactId>
752-
<version>3.3.0</version>
753753
</plugin>
754754

755755
<plugin>
756756
<groupId>org.apache.maven.plugins</groupId>
757757
<artifactId>maven-javadoc-plugin</artifactId>
758-
<version>3.6.3</version>
759758
</plugin>
760759

761760
<plugin>

src/main/java/org/scoverage/plugin/ScalaVersion.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,42 @@
99
public class ScalaVersion {
1010
private static final Pattern regexp = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?([-\\.].+)?");
1111

12+
/**
13+
* The full version number, including the modifier if any.
14+
*/
1215
public String full;
16+
17+
/**
18+
* The binary compatible version number for this Scala version.
19+
* 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.
20+
*/
1321
public String compatible;
22+
23+
/**
24+
* The major Scala version number. e.g. for 2.10.0-M1, this would be 2.
25+
*/
1426
public int major;
27+
28+
/**
29+
* The minor Scala version number. e.g. for 2.10.0-M1, this would be 10.
30+
*/
1531
public int minor;
32+
33+
/**
34+
* The bugfix Scala version number. e.g. for 2.10.0-M1, this would be 0.
35+
*/
1636
public int bugfix;
37+
38+
/**
39+
* The modifier for this Scala version. e.g. for 2.10.0-M1, this would be M1.
40+
*/
1741
public String modifier;
1842

43+
/**
44+
* Creates a ScalaVersion from a String.
45+
*
46+
* @param s String to parse
47+
*/
1948
public ScalaVersion(String s) {
2049
full = s;
2150
// parse
@@ -40,6 +69,9 @@ public ScalaVersion(String s) {
4069

4170
/**
4271
* Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
72+
*
73+
* @param other ScalaVersion to compare to
74+
* @return true if this version is of the same or newer Scala version as the other version
4375
*/
4476
public boolean isAtLeast(ScalaVersion other) {
4577
return major >= other.major &&
@@ -48,10 +80,20 @@ public boolean isAtLeast(ScalaVersion other) {
4880

4981
}
5082

83+
/**
84+
* Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
85+
*
86+
* @param scalaVersion to compare to
87+
* @return true if this version is of the same or newer Scala version as the other version
88+
*/
5189
public boolean isAtLeast(String scalaVersion) {
5290
return isAtLeast(new ScalaVersion(scalaVersion));
5391
}
5492

93+
94+
/**
95+
* @return true if this is a Scala 2 version
96+
*/
5597
public boolean isScala2() {
5698
return major == 2;
5799
}

0 commit comments

Comments
 (0)