sbt, the interactive build tool
Go to file
Ståle Undheim 42e23e54ff
Fix to issue #180 to handle null contentType
If the content type is null, the call for .toString on it will cause an NPE. This fixes this issue by wrapping the call in an Option, then mapping toString or falling back to null. getCharSetFromContentType handles null by returning ISO-8859-1
2018-02-24 00:25:34 +01:00
core Change modifiedTime definitions 2017-12-22 00:55:24 +01:00
ivy/src Fix to issue #180 to handle null contentType 2018-02-24 00:25:34 +01:00
notes Library management API 2017-07-15 11:17:23 -04:00
project Update version/mimaPreviousArtifacts/sbt.version 2018-02-14 10:46:24 +00:00
.gitignore Maven version range improvement 2017-04-04 16:22:28 -04:00
.java-version Cross publish to Scala 2.12 2017-01-07 00:49:45 -05:00
.scalafmt.conf Add back, re-configure & re-enable Scalafmt 2017-08-10 12:04:58 +01:00
.travis.yml add Java 9 test 2017-11-13 16:19:00 +09:00
README.md rename to DependencyResolutionInterface 2017-07-15 11:17:23 -04:00
build.sbt Update version/mimaPreviousArtifacts/sbt.version 2018-02-14 10:46:24 +00:00
sbt-allsources.sh sbt-contraband 0.3.0-M4 2017-03-17 23:03:37 -04:00

README.md

librarymanagement module for sbt

scala> import java.io.File
import java.io.File

scala> import sbt.librarymanagement._, syntax._
import sbt.librarymanagement._
import syntax._

scala> val log = sbt.util.LogExchange.logger("test")
log: sbt.internal.util.ManagedLogger = sbt.internal.util.ManagedLogger@c439b0f

scala> val lm = {
         import sbt.librarymanagement.ivy._
         val ivyConfig = InlineIvyConfiguration().withLog(log)
         IvyDependencyResolution(ivyConfig)
       }
lm: sbt.librarymanagement.DependencyResolution = sbt.librarymanagement.DependencyResolution@6a9b40f8

scala> val module = "commons-io" % "commons-io" % "2.5"
module: sbt.librarymanagement.ModuleID = commons-io:commons-io:2.5

scala> lm.retrieve(module, scalaModuleInfo = None, new File("target"), log)
res0: Either[sbt.librarymanagement.UnresolvedWarning,Vector[java.io.File]] = Right(Vector(target/jars/commons-io/commons-io/commons-io-2.5.jar, target/jars/commons-io/commons-io/commons-io-2.5.jar, target/jars/commons-io/commons-io/commons-io-2.5.jar))