Commit Graph

508 Commits

Author SHA1 Message Date
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
Eugene Yokota c796c77386 Add useJCenter setting, which is set to false. Fixes #2217
Adds a new setting `useJCenter`, which is set to `false` by default.
When set to `true`, JCenter will be placed as the first external
resolver to find library dependencies.

The implementation of `externalResolvers` is changed to incorporate the
setting by calling `Resolver.reorganizeAppResolvers`. These changes
were required because `externalResolvers` uses whatever that's in the
launchconfig, which the build user may not upgrade.
2015-12-25 23:20:56 -05:00
Eugene Yokota e6c846db47 Fixes #1514. Enable latest SNAPSHOT option by default
#1520 originally fixed #1514 by reimplementing part of chain resolver
to check all resolvers to find the latest snapshot artifacts.
This behavior did not work well with Maven repositories where sbt was
failing to calculate the correct publication dates.
Now that #2075 fixes the Maven integration issue we should enable this
flag back again.

The build user can opt out by:

    updateOptions := updateOptions.value.withLatestSnapshots(false)
2015-12-14 16:59:55 -05:00
eugene yokota 8749a969c3 Merge pull request #2297 from sbt/wip/fix-2264
Fixes #2264. Fixes updateClassifiers when default configuration is missing + uses listed artifacts if any
2015-12-03 02:11:52 -05:00
Eugene Yokota 3a3965b5f5 Fixes #2264. Use explicit artifacts if any, fallback to hardcoded
Even though it's not really used, updateClassifiers constructs
dependency graph based on the result from update.
The direct cause of #2264 came from the fact that the `allModules`
returned from ConfigurationReport did not include dependency
configurations. For example it returned "compile" instead of
"compile->runtime". I've identified that in #2264 and was fixed by
@Duhemm in f49fb33e6d.

Martin identified that the fix still does not address the fact that
updateClassifier hardcodes the classifiers to be tried. This commit
adds the fallback behavior so for Ivy-published modules it will use the
explicit list of artifacts, and for others it will fallback to the
hardcoded list of classifiers.
2015-12-02 16:41:02 -05:00
Martin Duhem 13410ca68e WIP 2015-12-02 16:56:14 +01:00
Martin Duhem 6d7c8fe655 Correct separator for configurations 2015-11-30 22:53:36 +01:00
Martin Duhem f49fb33e6d Combine ConfigurationReport's conf with ModuleReport's confs 2015-11-30 10:03:40 +01:00
Dale Wijnand f270cd2a5c Add Resolver.bintrayIvyRepo 2015-11-25 09:26:58 +00:00
Martin Duhem 541bd4a6a4 Fix for sbt/sbt#1933
sbt was reporting warning abouts inconsistent versions of dependencies
even if these dependencies didn't have the same configuration (as in
`provided` vs `compile`).

This commit fixes this problem by comparing the dependencies by
organization, artifact name and configuration.

Fixes sbt/sbt#1933
2015-10-28 15:23:45 +01:00
Martin Duhem dcad8a5527 Specify the compiler bridge module in a setting
In order to restore reproducibility of builds, we no longer cascade over
the possibly available versions of the compiler bridge sources (a
specific version of the bridge sources may not be available one day, but
exist on the next day), but rather let the build definition configure
which module to use.

Fixes sbt/sbt#2196
2015-09-04 11:17:27 +02:00
Dale Wijnand 8e6e32d7cb Enable Ivy flag that fixes #1750. 2015-08-28 23:38:45 +01:00
Dale Wijnand 5662b2ceed Only set LocalIfFileRepo if MavenRepository.localIfFile is set. 2015-08-23 17:25:25 +01:00
Dale Wijnand 0bf7e63887 Add localIfFile to MavenRepository. 2015-08-23 17:24:54 +01:00
Dale Wijnand 9beaf21926 Use string interpolation. 2015-08-20 23:12:17 +01:00
eugene yokota 66af3adefa Merge pull request #2142 from pdalpra/fix-warnings
Fix additional warnings
2015-08-13 03:27:35 -04:00
Dale Wijnand a432c3def1 Merge remote-tracking branch 'origin/0.13.9' into merge-0.13.9-into-0.13
* origin/0.13.9:
  Notes
  0.13.9
  cached resolution: use mutable map to speed up breakLoops
  cached resolution: don't include callers from evicted modules
  Add debug logs
  Fixes #2129. break up circular dependency loops in cached resolution
  try breaking circular dependency and continue sorting
  refactored to use less stack space
  make sortModules tailrec
  Reproduce stack overflow using cached resolution with circular dependency
2015-08-11 22:42:31 +01:00
Pierre DAL-PRA 8f1fb2d232 Fix additional warnings 2015-08-07 00:23:14 +02:00
Eugene Yokota 868740a2ae cached resolution: use mutable map to speed up breakLoops 2015-08-05 07:01:21 -04:00
Eugene Yokota dd94cb90d9 cached resolution: don't include callers from evicted modules 2015-08-05 07:00:39 -04:00
Pierre DAL-PRA 54d54b9f4f Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
Eugene Yokota ff729643e3 Add debug logs 2015-08-03 08:17:48 -04:00