Commit Graph

529 Commits

Author SHA1 Message Date
eugene yokota b2b02a1dd7 Merge pull request #3403 from dwijnand/fix-doc-more
Remove a series of warnings from running `doc`
2017-08-04 17:39:32 -04:00
eugene yokota 5ae723c5fb Merge pull request #3400 from dwijnand/no-exec
Drop the exec permission on random source files
2017-08-04 17:28:03 -04:00
Dale Wijnand 47c4542a30
Remove a series of warnings from running `doc` 2017-08-04 11:34:27 +01:00
Dale Wijnand 1e851953c0
Fix doc erroring
Scaladoc 2.10 struggles with FastTypeTag's macro.

Fixes #2812
2017-08-04 11:21:56 +01:00
Dale Wijnand 684e2c3692
Drop the exec permission on random source files 2017-08-04 11:13:40 +01:00
Eugene Yokota c3ebcd64d8 Fixes sbtApiVersion logic
The NonRelease pattern matcher is ony checking for the third segment, but for sbt 1.x, we need to check both the second and third segment since 1.1.0-M1 would be bincompat with 1.0.

Fixes sbt/sbt#3360
2017-07-23 13:16:34 -04:00
eugene yokota 5c85acb17f Merge pull request #3215 from eed3si9n/wip/moduleid
[sbt 0.13] backport withXXX for ModuleID and Artifact
2017-05-25 21:10:28 -04:00
Eugene Yokota 9b944f74fa backport withXXX for ModuleID and Artifact
Fixes sbt/sbt#3159

This helps keep source compat.
2017-05-24 19:59:01 -04:00
Eugene Yokota 631b5c7c7a Improve the eviction warning presentation.
Fixes sbt/sbt#2699

Before:

    [warn] There may be incompatibilities among your library dependencies.
    [warn] Here are some of the libraries that were evicted:
    [warn]  * com.google.code.findbugs:jsr305:2.0.1 -> 3.0.0
    [warn] Run 'evicted' to see detailed eviction warnings

After:

    [warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
    [warn]
    [warn] 	* com.typesafe.akka:akka-actor_2.12:2.5.0 is selected over 2.4.17
    [warn] 	    +- de.heikoseeberger:akka-log4j_2.12:1.4.0            (depends on 2.5.0)
    [warn] 	    +- com.typesafe.akka:akka-parsing_2.12:10.0.6         (depends on 2.4.17)
    [warn] 	    +- com.typesafe.akka:akka-stream_2.12:2.4.17 ()       (depends on 2.4.17)
    [warn]
    [warn] Run 'evicted' to see detailed eviction warnings
2017-05-23 14:30:27 -04:00
Eugene Yokota b3850872ee update EvictionWarningSpec 2017-05-21 13:59:07 -04:00
Eugene Yokota 90c102badc change EvictionWarningOptions.default
Fixes sbt/sbt#3171

change EvictionWarningOptions.default to include transitive evictions and caller info.
2017-05-21 13:18:11 -04:00
Guillaume Martres 629a04937f Fix default scalaBinaryVersion for Dotty
Dotty is versioned as 0.*, but `CrossVersionUtil#binaryScalaVersion`
will return the full version instead of just `major.minor` for all
compiler versions < 2.10, add a special case for Dotty to avoid this.

Note: I used tabs in this commit to match the style of the surrounding code.
2017-04-28 11:45:43 +02:00
Eugene Yokota 15a2d68367 Fix version parsing
Fixes #3011
2017-03-15 00:50:58 -04:00
Eugene Yokota 54564ba7ce Maven version range improvement
Previously, when the dependency resolver (Ivy) encountered a Maven version range such as `[1.3.0,)`
it would go out to the Internet to find the latest version.
This would result to a surprising behavior where the eventual version keeps changing over time
*even when there's a version of the library that satisfies the range condition*.

This changes to some Maven version ranges would be replaced with its lower bound
so that when a satisfactory version is found in the dependency graph it will be used.
You can disable this behavior using the JVM flag `-Dsbt.modversionrange=false`.

Fixes #2954
Ref #2291 / #2953
2017-02-10 04:00:04 -05:00
Guillaume Martres 709cfc96f9 Fix support for published dotty nightly builds
Dotty nightly builds are published to maven, so they end up in
configuration "default", not "compile". We still need to look into
"compile" when dotty is published locally.

You can test this using https://github.com/smarter/dotty-example-project
by updating the sbt version used in project/build.properties and by
replacing "0.1.1-SNAPSHOT" by a nightly version like
"0.1.1-20170109-be64643-NIGHTLY" in build.sbt
2017-01-10 21:40:49 +01:00
Guillaume Martres c76832fbc7 Avoid NullPointerException in sbt.ScalaOverrideTest 2017-01-09 01:15:08 +01:00
Guillaume Martres 0d0476eaa9 OverrideScalaMediator: fix bootstrapping a Scala compiler
Fixes #2867, #2896
2017-01-08 22:08:25 +01:00
Eugene Yokota 7d6c56e391 Apply binary version conflict check to Compile related configs
Fixes #1466 Ref #2786

Even after fixing the mediator issue, we still have spurious binary
version conflict warning that does not account for sandbox
configurations.

This change follows the scalaVersionConfigs work.
2016-11-11 15:44:05 -05:00
Eugene Yokota 8d0e4d2ef0 Apply scalaVersion enforcement to Compile related configs
Fixes #2786. Ref #2634.

sbt 0.13.12 added Ivy mediator that enforces scalaOrganization and
scalaVersion for Scala toolchain artifacts.
This turns out to be a bit too aggressive because Ivy configurations
can be used as an independent dependency graph that does not rely on
the scalaVersion used by Compile configuration. By enforcing
scalaVersion in those graph causes runtime failure.

This change checks if the configuration extends Default, Compile,
Provided, or Optional before enforcing scalaVersion.
2016-11-11 05:15:58 -05:00
Eugene Yokota 6f3bbed47e Safer template resolver
Fixes #2761

With sbt 0.13.13-RC1 rediscovered that the dependency pulled in from
Giter8 was affecting the plugins. To avoid this, this change splits up
the template resolver implementation to another module called
sbt-giter8-resolver, and it will be downloaded using Ivy into
`~/.sbt/0.13/templates/`, and then launched reflectively using Java as
the interface.
2016-10-12 20:06:10 -04:00
Miles Sabin 0dfd40972d Added CrossVersion.patch which strips off -bin-suffix. (#2757) 2016-09-29 01:42:59 +01:00
Miles Sabin 2d31681220 Explicit list of artifacts for Scala binary version check. Fixes #2701 2016-08-19 17:44:19 +01:00
Eugene Yokota 307c725cd1 Ugh. trying to make codacy happy 2016-06-12 03:34:22 -04:00
Eugene Yokota ae58cf342b Fixes merged ModuleID dropping configuration specification. Fixes #2002/#1500
Given a dependency graph such as:

    libraryDependencies += "com.google.guava" % "guava-tests" % "18.0"
    libraryDependencies += "com.google.guava" % "guava-tests" % "18.0"
% "test" classifier "tests"

previous releases of sbt would drop the Test configuration from the
classifier "tests" artifacts, and end up including the test JARs into
the Compile configuration instead of the Test configuration, which
would result in runtime error.

This fix configures the explicit artifacts into the configuration
during merge even when it says `"*"`.
2016-06-12 01:27:19 -04:00
Miles Sabin e98b2363c2 Override scala organization and version transitively at the Ivy level. Fixes #2286. 2016-06-02 12:07:30 +01:00
Martin Duhem 2b9fd13096 Workaround for sbt/sbt#2620 2016-05-24 10:25:24 +02:00
ddworak b98fdf7cfa fix typos 2016-05-07 17:58:42 -04:00
Eugene Yokota 411e5f6c69 Remove unnecessary warning message 2016-04-24 14:24:05 -04:00
eugene yokota 40644aedab Merge pull request #2513 from Duhemm/wip/fix-2435
Fix for sbt/sbt#2435
2016-04-22 02:37:09 -04:00
eugene yokota b10414da73 Merge pull request #2564 from Duhemm/wip/fix-2518
Off-the-grid installation of sbt
2016-04-20 16:53:19 -04:00
Martin Duhem 81e350325e Fix NPE in FakeResolver 2016-04-15 16:25:52 +02:00
Martin Duhem 2165c347c1 Re-enable caching and updating minigraph in cached resolution 2016-04-11 10:06:13 +02:00
Martin Duhem 1d44420c91 Comply to Ivy's specification in `FakeResolver` 2016-04-11 09:48:42 +02:00
Martin Duhem 6beb8f2c85 Tests for FakeResolver 2016-04-11 09:14:35 +02:00
Eugene Yokota e065df9610 Add toString to IvyPaths for debugging purpose 2016-04-06 12:29:37 -04:00
Martin Duhem b8472668ff Static launcher, get bridge sources from resources
This commit introduces a new "static" launcher that does not use Ivy to
gather all the artifacts that it requires, but rather expect them to be
immediately available.

To be able to use sbt without Internet access, we add a new
`ComponentCompiler` that is able to retrieve the bridge sources from the
resources on classpath and compile it.
2016-04-06 12:01:34 +02:00
Martin Duhem b95b0e5628 Use configuration of evicted nodes with cached resolution
Consider a configuration where we have two projects, A and B.

A has a library dependency on "a" % "b" % "1.0.0" % "compile->runtime"
and "a" % "b" % "1.0.0" % "compile->runtime2"

B depends on project A, and has a library dependency on
"a" % "b" % "1.0.1" % "compile->runtime".

Note that project B depends on a more recent version of "a" % "b" than
project A, and that it depends ONLY on it's "runtime" configuration.

However, when compiling project B, we expect to have on the classpath
project A, and "a" % "b" % "1.0.1" % "compile->runtime" AND
"a" % "b" % "1.0.1" % "compile->runtime2" because it is part of the
compile configuration of project A.

This commit changes the cached resolution engine so that it behaves like
that, by first resolving dependencies on other project and then ensuring
that the dependent project specifies dependencies on the same
configurations.

Mark test dependency-management/cached-resolution-configurations as
passing.
2016-03-14 15:59:14 +01:00
Martin Duhem 1e96936c08 Create default artifact for deps from POM files
Dependency descriptors that are created from POM files do not specify
their artifacts. In those cases, it is correct to create a default
artifact.
2016-03-14 08:51:25 +01:00
Martin Duhem fed478cc6b Check that default artifact exists when trying to retrieve it.
When concatenating the artifacts coming from two modules, we sometimes
attempted to create a default artifact from the organization and name of
the module.

However, this may fail because a module a % b "1.0" may not have an
artifact named "b.jar" (see sbt/sbt#2431).

Fixes sbt/sbt#2431.
2016-03-07 11:44:34 +01:00
Eugene Yokota a9dc9be83b Adds CompatibilityWarningOptions. Fixes #2347
This addresses 0.13.10 regression, which currently warns users about
Maven incompatibility on a private configuration. This adds a config
class so the build user can control the level of the warning as well as
the target configuration to be monitored.
By default, we are only going to look at `Compile` and `Runtime`.
2016-01-22 01:39:00 -05:00
Eugene Yokota c55c3ec966 Merge branch 'backport/internal-tracking' into wip/internal 2016-01-13 12:59:51 -05:00
Eugene Yokota 98b26ae5d3 Inter-project dependency tracking. Fixes #2266
Adds `trackInternalDependencies` and `exportToInternal` settings. These
can be used to control whether to trigger compilation of a dependent
subprojects when you call `compile`. Both keys will take one of three
values: `TrackLevel.NoTracking`, `TrackLevel.TrackIfMissing`, and
`TrackLevel.TrackAlways`. By default they are both set to
`TrackLevel.TrackAlways`.

When `trackInternalDependencies` is set to `TrackLevel.TrackIfMissing`,
sbt will no longer try to compile internal (inter-project) dependencies
automatically, unless there are no `*.class` files (or JAR file when
`exportJars` is `true`) in the output directory. When the setting is
set to `TrackLevel.NoTracking`, the compilation of internal
dependencies will be skipped. Note that the classpath will still be
appended, and dependency graph will still show them as dependencies.
The motivation is to save the I/O overhead of checking for the changes
on a build with many subprojects during development. Here's how to set
all subprojects to `TrackIfMissing`.

    lazy val root = (project in file(".")).
      aggregate(....).
      settings(
        inThisBuild(Seq(
          trackInternalDependencies := TrackLevel.TrackIfMissing,
          exportJars := true
        ))
      )

The `exportToInternal` setting allows the dependee subprojects to opt
out of the internal tracking, which might be useful if you want to
track most subprojects except for a few. The intersection of the
`trackInternalDependencies` and `exportToInternal` settings will be
used to determine the actual track level. Here's an example to opt-out
one project:

    lazy val dontTrackMe = (project in file("dontTrackMe")).
      settings(
        exportToInternal := TrackLevel.NoTracking
      )
2016-01-13 12:56:28 -05:00
eugene yokota f00f6fd541 Merge pull request #2344 from smarter/0.13-dotty
Make sbt aware of Dotty
2016-01-03 20:22:13 -05:00
Guillaume Martres 10265efd9c Make sbt aware of Dotty
This small set of changes, together with the compiler-bridge I wrote
(https://github.com/smarter/dotty-bridge) enables us to compile code
using Dotty in sbt, see https://github.com/smarter/dotty-example-project
for an example.
2016-01-03 20:35:29 +01:00
Eugene Yokota bdffad2845 Improve warning message 2015-12-31 22:36:04 -05:00
Eugene Yokota 0d925630df Fixes #1827. Adds withInterProjectFirst to update option.
withInterProjectFirst when set to true will prioritize inter-project
resolver over all other resolver and Ivy cache.
This aimed to workaround the fact that on Maven Test configuration is
considered private, and thus project dependency with `test->test`
configuration may not under some condition. The condition is when
someone resolves `x:y:1.0` and you have a subproject named and
versioned exactly that, and some other subproject tries to depend on
it. This happens when the project does not change the version number on
the Github.
2015-12-31 01:22:27 -05:00
Eugene Yokota f244815f7d Update warning message a bit. 2015-12-31 00:41:23 -05:00
Eugene Yokota e82e6652d0 Move intransitive warning to update. Ref #2127 2015-12-30 13:41:31 -05:00
eugene yokota bfb602c29b Merge pull request #2313 from sbt/wip/refix-snapshots
Fixes #1514. Enable latest SNAPSHOT option by default
2015-12-30 10:31:07 -05:00
Eugene Yokota 1bf789eb3d Fixes #1616. Fixes the "latest snapshot" chain resolver
The "latest snapshot" chain resolver was assuming that there's at least
one artifact per module. I think that was the root cause of #1616.
2015-12-30 04:46:20 -05:00