From 63e9122e1efd184c91f2d55dd2eb15f5d9a5d30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Thu, 9 Aug 2018 09:22:22 +0200 Subject: [PATCH] Fix javadoc errors Release failed because Javadocs in scalafix-interfaces reported warnings. --- build.sbt | 17 ++++++++++++----- project/ScalafixBuild.scala | 1 + .../main/java/scalafix/interfaces/Scalafix.java | 10 +++++----- .../scalafix/interfaces/ScalafixException.java | 1 + .../scalafix/interfaces/ScalafixSeverity.java | 3 +++ 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index 66c1ca96b..0d73cfda0 100644 --- a/build.sbt +++ b/build.sbt @@ -9,14 +9,21 @@ inThisBuild( noPublish +// force javac to fork by setting javaHome to get error messages during compilation, +// see https://github.com/sbt/zinc/issues/520 +def inferJavaHome() = + Some(file(System.getProperty("java.home")).getParentFile) + lazy val interfaces = project .in(file("scalafix-interfaces")) .settings( - javaHome.in(Compile) := { - // force javac to fork by setting javaHome to get error messages during compilation, - // see https://github.com/sbt/zinc/issues/520 - Some(file(sys.props("java.home")).getParentFile) - }, + javacOptions.in(Compile) ++= List( + "-Xlint:all", + "-Werror" + ), + javacOptions.in(Compile, doc) := List("-Xdoclint:none"), + javaHome.in(Compile) := inferJavaHome(), + javaHome.in(Compile, doc) := inferJavaHome(), moduleName := "scalafix-interfaces", crossVersion := CrossVersion.disabled, crossScalaVersions := List(scala212), diff --git a/project/ScalafixBuild.scala b/project/ScalafixBuild.scala index 9e5c2c194..2db6a9b12 100644 --- a/project/ScalafixBuild.scala +++ b/project/ScalafixBuild.scala @@ -178,6 +178,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { commands += Command.command("ci-212") { s => "++2.12.6" :: "unit/test" :: + "interfaces/doc" :: s }, commands += Command.command("ci-211") { s => diff --git a/scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java b/scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java index c1cc553c1..8ccf69c2c 100644 --- a/scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java +++ b/scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java @@ -36,27 +36,27 @@ public interface Scalafix { String mainHelp(int screenWidth); /** - * @return The release version of the current Scalafix API instance. + * The release version of the current Scalafix API instance. */ String scalafixVersion(); /** - * @return The recommended Scalameta version to match the current Scalafix API instance. + * The recommended Scalameta version to match the current Scalafix API instance. */ String scalametaVersion(); /** - * @return The exact Scala versions that are supported by the recommended {@link #scalametaVersion()} + * The exact Scala versions that are supported by the recommended {@link #scalametaVersion()} */ String[] supportedScalaVersions(); /** - * @return The most recent Scala 2.11 version in {@link #supportedScalaVersions()} + * The most recent Scala 2.11 version in {@link #supportedScalaVersions()} */ String scala211(); /** - * @return The most recent Scala 2.12 version in {@link #supportedScalaVersions()} + * The most recent Scala 2.12 version in {@link #supportedScalaVersions()} */ String scala212(); diff --git a/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixException.java b/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixException.java index c3d018151..0d8cc0b02 100644 --- a/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixException.java +++ b/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixException.java @@ -4,6 +4,7 @@ * An error occurred while classloading an instance of {@link Scalafix}. */ public class ScalafixException extends Exception { + static final long serialVersionUID = 118L; ScalafixException(String message, Exception cause) { super(message, cause); } diff --git a/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixSeverity.java b/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixSeverity.java index fc00c0413..eb4bef528 100644 --- a/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixSeverity.java +++ b/scalafix-interfaces/src/main/java/scalafix/interfaces/ScalafixSeverity.java @@ -1,5 +1,8 @@ package scalafix.interfaces; +/** + * The logging level at which Scalafix diagnostics are reported. + */ public enum ScalafixSeverity { INFO, WARNING,