Commit Graph

98 Commits

Author SHA1 Message Date
Eugene Yokota df53eefbb0 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 `"*"`.
2017-01-14 07:05:52 -05:00
Eugene Yokota a87ed10dc7
Move ModuleID toString out 2017-01-05 15:42:34 +00:00
Eugene Yokota 4ca5b5ae0a
Change publicationDate to java.util.Calendar
This migrates to java.util.Calendar, which is better than
java.util.Date and is supported by sjson-new out of the box.
2017-01-05 15:42:34 +00:00
Dale Wijnand 71fddd5e3f
Upgrade from sbt/datatype to sbt/contraband 2017-01-05 15:42:29 +00:00
Dale Wijnand 946f307082
Implement JsonFormat[NodeSeq] like it was in IvyCache 2017-01-05 13:42:16 +00:00
eugene yokota b0f97eaa37 Merge pull request #64 from dwijnand/add-back-SbtExclusionRule-companion-implicit-lifts
Add back SbtExclusionRule companion implicit lifts
2016-12-31 00:26:37 -05:00
Dale Wijnand 04904ed34d
Add back SbtExclusionRule companion implicit lifts 2016-12-30 17:11:18 +00:00
Dale Wijnand 19f40a1668
Fix ConfigurationReport.toString
Move the toString implementation from ConfigurationReportExtra to inside
the ConfigurationReport JSON schema definition, that way the synthetic
toString generated by contraband doesn't override the carefully defined
one.
2016-12-28 16:15:13 +00:00
Dale Wijnand e209499544
Avoid source file path clash with generated sources 2016-12-14 10:31:11 +00:00
Dale Wijnand 1bf74ddffa
Make MavenRepository the top level class
Also reintroduce "isCache".
2016-12-06 09:48:23 +00:00
Dale Wijnand af1c19034b
Remove unused imports 2016-11-16 11:17:27 +00:00
Dale Wijnand 3192b3ee1a
Remove unused warnings 2016-11-16 11:14:42 +00:00
Dale Wijnand f6c98f69b9
Organise contraband descriptor by package name & alphabetically 2016-11-16 10:52:42 +00:00
Dale Wijnand b2b606f8aa
Actually, just kill the crazy MyCrazyReferences idea 2016-11-16 10:43:16 +00:00
Dale Wijnand 301ec787f2
Drop "serialising" Function1. It's easily fallible 2016-11-16 10:11:41 +00:00
Dale Wijnand e7ba7fa9a4
Switch to FooFunctions naming convention for contraband companion parents 2016-11-16 09:55:43 +00:00
Dale Wijnand 5475a3c01c
Switch to FooExtra naming convention for contraband parents 2016-11-16 01:41:47 +00:00
Dale Wijnand f2efa10af1
Switch to sbt-datatype, sjson-new & Vectors 2016-11-15 23:59:34 +00:00
Miles Sabin cee81e3bb0 Configurable explicit list of artifacts for Scala binary version check 2016-08-22 11:00:09 +01:00
Dale Wijnand 138787f55e Add Resolver.sbtIvyRepo (#49)
.. deprecate & rename SbtPluginRepositoryRoot to SbtRepositoryRoot.
2016-07-15 07:57:04 +01:00
Dale Wijnand ffcad3cdad Make CrossVersion & ModuleId more commonly equal
Two instance of functions defined in the same way don't equal themselves, but
the same instance of a function does. So by using a val idStringFun for full and
binary, and making Binary and Full case classes there are much better chances
that ModuleId's defined in the same way will be equal.
2016-07-08 03:10:37 +01:00
eugene yokota e7ca095303 Merge pull request #47 from dwijnand/cleanups
Cleanups
2016-06-21 23:20:09 +02:00
Dale Wijnand 931b7d7af5 Remove unused and unused imports
Note that the pickler/sbt-serlization macros are bringing in unused imports..
2016-06-21 16:06:40 +01:00
Dale Wijnand 9dd4014553 Give IvyPaths a nicer toString 2016-06-21 14:13:15 +01:00
eugene yokota 65a3162b43 Merge pull request #43 from Duhemm/fport/workaround-2620
FPORT: Fix for sbt/sbt#2435 and Workaround for sbt/sbt#2620
2016-06-04 12:43:34 -04:00
Miles Sabin 52867b8c95 Override scala organization and version transitively at the Ivy level 2016-06-02 22:15:06 +01:00
Martin Duhem 1756d73724 Workaround for sbt/sbt#2620 2016-05-24 17:51:24 +02:00
Martin Duhem ba274e05ac Re-enable caching and updating minigraph in cached resolution 2016-05-24 17:14:00 +02:00
Martin Duhem 92ca28e25a 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-05-24 17:13:45 +02:00
Eugene Yokota 87b3ca04c0 Don't depend on other projects' tests 2016-05-11 14:12:10 -04:00
ddworak a70c79a731 fix typos 2016-05-08 12:53:19 +02:00
Martin Duhem 8e333984f2 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-05-06 07:10:42 +02:00
Martin Duhem bd082a562b 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-05-06 07:08:33 +02:00
Eugene Yokota d304a95b24 Bump dependencies 2016-05-04 22:49:03 -04:00
eugene yokota 27bf18f7a3 Merge pull request #31 from JD557/fix-sorrting-typo
Fix small typo ("Sorrting" should be "Sorting")
2016-05-01 03:15:09 -04:00
eugene yokota 95cfb32fb8 Merge pull request #34 from Duhemm/fport/static-launcher
FPORT: Off the grid installation + repositories override
2016-05-01 03:14:44 -04:00
Martin Duhem ed0f2af66b Fix warning with Scala 2.11
We get a warning about the exhaustivity check, but the warning
disappears if we increase the maximum recursion depth.
2016-04-27 11:09:00 +02:00
Martin Duhem 65adc869d4 Implement static launcher for sbt
This is a combination of 13 commits. I squashed these 13 commits to make
forward porting those changes easier, since some commit undo the changes
of other commits.

The PRs that include these changes can be found at
https://github.com/sbt/sbt/pull/2564 and
https://github.com/sbt/sbt/pull/2576.

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.

Fix classpath issues in static launcher

The launcher defines a top classloader that willbe used by all
`ScalaInstance`s. Previously, this top classloader had a parent that
contained the scala library 2.10, which prevented the correct
compilation of the compiler bridge for scala 2.11.

Also, we no longer need the scala-reflect JAR.

Tests for FakeResolver

Add `scala-reflect.jar` to JARs of `StaticScalaProvider`

It turns out we need to have `scala-reflect.jar` on classpath to compile
the compiler bridge for the static scala instance of the launcher.

Comply to Ivy's specification in `FakeResolver`

Remove `CompilerBridgeProvider` and `ResourceBridgeProvider`

It turns out that we can leverage the`FakeResolver` that has been
implemented to use with the static launcher, and resolve a "fake
compiler bridge" using it, rather than copying it from the resources.

This also has the advantage of not requiring to change the build
definition.

Fix NPE in FakeResolver

Add compiler bridge sources to fake resolver

This allows sbt to resolve the compiler bridge sources when using the
static launcher

Don't hardcode sbt version in static launcher

Add scala compiler and library to fake resolver

This allows us to still resolve them if we have no other resolver
configured.

Add `RepositoriesParser`

This parser is used by the static launcher to parse the definition of
resolvers that override the build resolvers.

Support repositories override in static launcher

The static launcher will now parse user-defined repositories like the
usual launcher does.

Specifically, the static launcher now uses the following configuration:

 - `sbt.boot.directory`: specifies the boot directory that sbt will use.
   Defaults to `~/.sbt/boot`.
 - `sbt.override.build.repos`: indicate whether we want to override the
   build resolvers. Defaults to false.
 - `sbt.repository.config`: specifies the path to the files that
   contains repositories definition. Defaults to
   `${sbt.boot.directory}/repositories`.

Notes for sbt/sbt#2564 & sbt/sbt#2576
2016-04-27 10:14:47 +02:00
João Costa 195d35c07d Fix typo ("Sorrting" should be "Sorting") 2016-03-23 11:34:33 +00:00
Dan Sanduleac 19c7a85cd7 Rename InlineConfigurationWithExcludes -> InlineConfiguration 2016-02-24 12:02:23 +00:00
Dan Sanduleac 9e78b1cd9c Get rid of InlineConfiguration 2016-02-24 12:01:13 +00:00
Eugene Yokota 7edd4a954a Manually merged #25 2016-02-23 00:49:04 -05:00
eugene yokota 3d5dea5d4d Merge pull request #26 from oxbowlakes/branches
Add Ivy `branch` support to ModuleID
2016-02-23 00:36:14 -05:00
eugene yokota 62c12f16cd Merge pull request #24 from Duhemm/fport/inter-project-dependency-tracking
FPORT: Inter-project dependency tracking
2016-02-23 00:34:12 -05:00
Dan Sanduleac 2324c720c4 Set branch onto the ModuleID when constructing a ModuleReport 2016-02-10 17:25:59 +00:00
Dan Sanduleac 797fe0aa63 Fix IvyActions.restrictedCopy to respect branch 2016-02-10 17:25:59 +00:00
Dan Sanduleac 0fd248a19b Add [branch] to pattern for sbt's resolution cache 2016-02-10 17:25:59 +00:00
Dan Sanduleac 5ea0e0e07a [branch] as part of Resolver.localBasePattern 2016-02-10 17:25:58 +00:00
Dan Sanduleac a9b2154092 ModuleID to have a branch now, that ends up in the ModuleRevisionId too.
Also, add branch when converting ModuleID -> Ivy XML and include it in
IvyActions.substitute.
2016-02-10 17:25:58 +00:00
Dan Sanduleac 01030a197a Add IvyRepoSpec which tests that source artifacts (in this case, with type=src, though in the same "compile" configuration) are resolved correctly when using IvyActions.updateClassifiers, and NOT resolved when using the normal IvyActions.updateEither. 2016-02-10 14:44:49 +00:00