Skip to content

v0.13.7

Compare
Choose a tag to compare
@eed3si9n eed3si9n released this 25 Dec 21:14
· 8220 commits to 1.10.x since this release
v0.13.7

Fixes with compatibility implications

  • Maven artifact dependencies will limit their transitive dependencies to Compile rather than every configuration if no master configuration is found. #1586 by @jsuereth
  • The new natural whitspace handling parser is unable to cope with certain classes of Scala syntax. In particular, top-level pattern matches, or multi-value defintions are no longer supported.

Here are examples:

val x, y = project // BAD
val x = project    // 
val y = project    //  GOOD

Improvements

  • Natural whitespace handling. See below. #1606 by @rkrzewski, @ajozwik, and others at @WarsawScala
  • Adds support for publishing to a custom Maven local repository. See below. #1589/#1600 by @topping
  • Adds circular dependency check. See below. #1601 by @eed3si9n
  • Adds cached resolution (minigraph caching). See below. #1631 by @eed3si9n
  • Allows the "-bin" Scala version suffix to specify a bincompat version. #1573 by @cunei
  • Adds support for publishing to file repositories specified in ~/.sbt/repositories. #1579 by @copumpkin
  • Adds support for publishing to a Maven repository with file URLs. #1618 by @jsuereth
  • Don't hardcode existing relations in TextAnalysisFormat. #1572 by @Duhemm
  • Adds developers key. #1590 by @jedesah
  • Will warn when none or multiple main classes detected. #1648 by @kretes

Bug fixes

  • Fixes issues with specifying scalaHome/scalaInstance and running tests. #1584 by @jsuereth
  • Fixes StackOverflow error in dependencies extraction with macro and name hashing. #1563/#1642/#1237/#1544 by @Duhemm
  • Fixes set every. #1591/#1430 by @cunei
  • Ivy no longer silently flops to HttpClient resolver when httpclient is on the classpath. #1602 by @jsuereth
  • Backports Ivy fix to not throw exceptions when modules are evicted. #1607/#1598 by @jsuereth
  • When resolving from a Maven repository, and unable to read maven-metadata.xml file (common given the divergence in
    Maven 3 and Ivy 2), we attempt to use LastModified timestamp in lieu of "published" timestamp.
    #1611/#1618 by @jsuereth
  • Fixes NullPointerException when using ChainResolver and Maven repositories. #1611/#1618 by @jsuereth
  • Fixes Resolver's url method dropping descriptorOptional and skipConsistencyCheck. #1621 by @tmandke
  • Revert useLatestSnapshot on updateOptions to default to false. Reverts chain resolver to previous behavior. #1683 by @jsuereth

Natural whitespace handling

Starting sbt 0.13.7, build.sbt will be parsed using a customized Scala parser. This eliminates the requirement to use blank line as the delimiter between each settings, and also allows blank lines to be inserted at arbitrary position within a block.

This feature can be disabled, if necessary, via the -Dsbt.parser.simple=true flag.

This feature was contributed by Andrzej Jozwik (@ajozwik), Rafał Krzewski (@rkrzewski) and others at @WarsawScala inspired by Typesafe's @gkossakowski organizing multiple meetups and hackathons on how to patch sbt with the focus on this blank line issue. Dziękujemy! #1606

Custom Maven local repository location

Maven local repository is now resolved from the first of:

  • <localRepository/> element in ~/.m2/settings.xml
  • <localRepository/> element in $M2_HOME/conf/settings.xml, or
  • the default of ~/.m2/repository if neither of those configuration elements exist

If more Maven settings are required to be recovered, the proper thing to do is merge the two possible settings.xml files, then query against the element path of the merge. This code avoids the merge by checking sequentially.

#1589/#1600 by @topping

Circular dependency

By default circular dependencies are warned, but they do not halt the dependency resolution. Using the following setting, circular dependencies can be treated as an error.

updateOptions := updateOptions.value.withCircularDependencyLevel(CircularDependencyLevel.Error)

#1601 by @eed3si9n

Cached resolution (minigraph caching)

sbt 0.13.7 adds a new experimental update option called cached resolution, which replaces consolidated resolution:

updateOptions := updateOptions.value.withCachedResolution(true)

Unlike consolidated resolution, which only consolidated subprojects with identical dependency graph, cached resolution create an artificial graph for each direct dependency (minigraph) for all subprojects, resolves them independently, saves them into json file, and stiches the minigraphs together.

Once the minigraphs are resolved and saved as files, dependency resolution turns into a matter of loading json file from the second run onwards, which should complete in a matter of seconds even for large projects. Also, because the files are saved under a global ~/.sbt/0.13/dependency (or what's specified by sbt.dependency.base flag), the resolution result is shared across all builds.

Breaking graphs into minigraphs allows partial resolution results to be shared, which scales better for subprojects with similar but slightly different dependencies, and also for making small changes to the dependencies graph over time. See documentation on cached resolution for more details.

#1631 by @eed3si9n