diff --git a/build.sbt b/build.sbt index 591b02d1f..0dc52aefe 100644 --- a/build.sbt +++ b/build.sbt @@ -99,6 +99,10 @@ lazy val lmCore = (project in file("core")) ) ) .taskValue, + Compile / scalacOptions ++= (scalaVersion.value match { + case v if v.startsWith("2.12.") => List("-Ywarn-unused:-locals,-explicits,-privates") + case _ => List() + }), managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/ArtifactTypeFilter.scala b/core/src/main/contraband-scala/sbt/librarymanagement/ArtifactTypeFilter.scala index fa68be8f1..ce5ab7765 100644 --- a/core/src/main/contraband-scala/sbt/librarymanagement/ArtifactTypeFilter.scala +++ b/core/src/main/contraband-scala/sbt/librarymanagement/ArtifactTypeFilter.scala @@ -4,15 +4,15 @@ // DO NOT EDIT MANUALLY package sbt.librarymanagement -/** Work around the inadequacy of Ivy's ArtifactTypeFilter (that it cannot reverse a filter) */ +/** + * Work around the inadequacy of Ivy's ArtifactTypeFilter (that it cannot reverse a filter) + * @param types Represents the artifact types that we should try to resolve for (as in the allowed values of + `artifact[type]` from a dependency `` section). One can use this to filter + source / doc artifacts. + * @param inverted Whether to invert the types filter (i.e. allow only types NOT in the set) + */ final class ArtifactTypeFilter private ( - /** - * Represents the artifact types that we should try to resolve for (as in the allowed values of - * `artifact[type]` from a dependency `` section). One can use this to filter - * source / doc artifacts. - */ val types: Set[String], - /** Whether to invert the types filter (i.e. allow only types NOT in the set) */ val inverted: Boolean) extends sbt.librarymanagement.ArtifactTypeFilterExtra with Serializable { diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/ConfigRef.scala b/core/src/main/contraband-scala/sbt/librarymanagement/ConfigRef.scala index 30cba07f5..f956602f6 100644 --- a/core/src/main/contraband-scala/sbt/librarymanagement/ConfigRef.scala +++ b/core/src/main/contraband-scala/sbt/librarymanagement/ConfigRef.scala @@ -4,9 +4,11 @@ // DO NOT EDIT MANUALLY package sbt.librarymanagement -/** A reference to Configuration. */ +/** + * A reference to Configuration. + * @param name The name of the configuration that eventually get used by Maven. + */ final class ConfigRef private ( - /** The name of the configuration that eventually get used by Maven. */ val name: String) extends Serializable { diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/ConfigurationReport.scala b/core/src/main/contraband-scala/sbt/librarymanagement/ConfigurationReport.scala index 228a8fdbe..1243665a1 100644 --- a/core/src/main/contraband-scala/sbt/librarymanagement/ConfigurationReport.scala +++ b/core/src/main/contraband-scala/sbt/librarymanagement/ConfigurationReport.scala @@ -4,13 +4,15 @@ // DO NOT EDIT MANUALLY package sbt.librarymanagement -/** Provides information about resolution of a single configuration. */ +/** + * Provides information about resolution of a single configuration. + * @param configuration the configuration this report is for. + * @param modules a sequence containing one report for each module resolved for this configuration. + * @param details a sequence containing one report for each org/name, which may or may not be part of the final resolution. + */ final class ConfigurationReport private ( - /** the configuration this report is for. */ val configuration: sbt.librarymanagement.ConfigRef, - /** a sequence containing one report for each module resolved for this configuration. */ val modules: Vector[sbt.librarymanagement.ModuleReport], - /** a sequence containing one report for each org/name, which may or may not be part of the final resolution. */ val details: Vector[sbt.librarymanagement.OrganizationArtifactReport]) extends sbt.librarymanagement.ConfigurationReportExtra with Serializable { diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/UpdateConfiguration.scala b/core/src/main/contraband-scala/sbt/librarymanagement/UpdateConfiguration.scala index 533a24542..4443f1eb8 100644 --- a/core/src/main/contraband-scala/sbt/librarymanagement/UpdateConfiguration.scala +++ b/core/src/main/contraband-scala/sbt/librarymanagement/UpdateConfiguration.scala @@ -4,22 +4,20 @@ // DO NOT EDIT MANUALLY package sbt.librarymanagement +/** + * @param retrieveManaged If set to some RetrieveConfiguration, this enables retrieving dependencies to the specified directory. + Otherwise, dependencies are used directly from the cache. + * @param missingOk If set to true, it ignores when artifacts are missing. + This setting could be uses when retrieving source/javadocs jars opportunistically. + * @param logging Logging setting used specifially for library management. + * @param logicalClock The clock that may be used for caching. + * @param metadataDirectory The base directory that may be used to store metadata. + */ final class UpdateConfiguration private ( - /** - * If set to some RetrieveConfiguration, this enables retrieving dependencies to the specified directory. - * Otherwise, dependencies are used directly from the cache. - */ val retrieveManaged: Option[sbt.librarymanagement.RetrieveConfiguration], - /** - * If set to true, it ignores when artifacts are missing. - * This setting could be uses when retrieving source/javadocs jars opportunistically. - */ val missingOk: Boolean, - /** Logging setting used specifially for library management. */ val logging: sbt.librarymanagement.UpdateLogging, - /** The clock that may be used for caching. */ val logicalClock: sbt.librarymanagement.LogicalClock, - /** The base directory that may be used to store metadata. */ val metadataDirectory: Option[java.io.File], val artifactFilter: Option[sbt.librarymanagement.ArtifactTypeFilter], val offline: Boolean, diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/UpdateReport.scala b/core/src/main/contraband-scala/sbt/librarymanagement/UpdateReport.scala index 5ad396e00..ef6da3930 100644 --- a/core/src/main/contraband-scala/sbt/librarymanagement/UpdateReport.scala +++ b/core/src/main/contraband-scala/sbt/librarymanagement/UpdateReport.scala @@ -8,13 +8,13 @@ package sbt.librarymanagement * Provides information about dependency resolution. * It does not include information about evicted modules, only about the modules ultimately selected by the conflict manager. * This means that for a given configuration, there should only be one revision for a given organization and module name. + * @param cachedDescriptor the location of the resolved module descriptor in the cache + * @param configurations a sequence containing one report for each configuration resolved. + * @param stats stats information about the update that produced this report */ final class UpdateReport private ( - /** the location of the resolved module descriptor in the cache */ val cachedDescriptor: java.io.File, - /** a sequence containing one report for each configuration resolved. */ val configurations: Vector[sbt.librarymanagement.ConfigurationReport], - /** stats information about the update that produced this report */ val stats: sbt.librarymanagement.UpdateStats, val stamps: Map[java.io.File, Long]) extends sbt.librarymanagement.UpdateReportExtra with Serializable { diff --git a/ivy/src/main/java/internal/librarymanagement/JavaNetAuthenticator.java b/ivy/src/main/java/internal/librarymanagement/JavaNetAuthenticator.java index 10a0e6285..aa10461cc 100644 --- a/ivy/src/main/java/internal/librarymanagement/JavaNetAuthenticator.java +++ b/ivy/src/main/java/internal/librarymanagement/JavaNetAuthenticator.java @@ -31,9 +31,9 @@ import okhttp3.Challenge; import okhttp3.Credentials; /** - * Adapts {@link java.net.Authenticator} to {@link Authenticator}. Configure OkHttp to use {@link - * java.net.Authenticator} with {@link OkHttpClient.Builder#authenticator} or {@link - * OkHttpClient.Builder#proxyAuthenticator(Authenticator)}. + * Adapts java.net.Authenticator to Authenticator. Configure OkHttp to use + * java.net.Authenticator with OkHttpClient.Builder#authenticator or + * OkHttpClient.Builder#proxyAuthenticator(Authenticator). */ public final class JavaNetAuthenticator implements Authenticator { @Override public Request authenticate(Route route, Response response) throws IOException { diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala index b30777a12..72a3490dd 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala @@ -26,8 +26,6 @@ import syntax._ import InternalDefaults._ import UpdateClassifiersUtil._ -import scala.util.Try - object IvyActions { /** Installs the dependencies of the given 'module' from the resolver named 'from' to the resolver named 'to'.*/ diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala index fd0fd259c..2f4985c46 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala @@ -21,7 +21,7 @@ class IvyDependencyResolution private[sbt] (val ivySbt: IvySbt) private[sbt] def toModule(module: ModuleDescriptor): Module = module match { - case m: Module => m + case m: Module @unchecked => m } } diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala index cc92e8bf9..8ae4a4481 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala @@ -25,7 +25,7 @@ class IvyPublisher private[sbt] (val ivySbt: IvySbt) extends PublisherInterface private[sbt] def toModule(module: ModuleDescriptor): Module = module match { - case m: Module => m + case m: Module @unchecked => m } } diff --git a/project/build.properties b/project/build.properties index d6e35076c..0cd8b0798 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.6 +sbt.version=1.2.3 diff --git a/project/plugins.sbt b/project/plugins.sbt index 32f478494..335c8fb18 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ -addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.7") -addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.0") +addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.8") +addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.1") addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.9") scalacOptions += "-language:postfixOps"