Commit Graph

4617 Commits

Author SHA1 Message Date
eugene yokota afa8603ef7 Merge pull request #2407 from eed3si9n/wip/2347
Adds CompatibilityWarningOptions
2016-01-22 13:24:41 -05: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
Dale Wijnand 35aed2bc20 Merge pull request #2399 from timcharper/0.13
bugfix - apply autoImports for global plugins at global configuration stage
2016-01-19 06:41:08 +00:00
Tim Harper 7d86bc70d3 bugfix - apply autoImports for global plugins at global configuration stage
Previously, the autoimports for globally defined plugins were not
imported for global configuration files, although they were imported for
project configuration files.

This patch causes an additional plugin discovery phase to happen during
global config evaluation, so that auto-plugins can be detected and their
imports subsequently included.
2016-01-18 15:05:29 -07:00
Tim Harper d6c80ba1bd add notes on running tests 2016-01-18 15:02:23 -07:00
Tim Harper d86e52830e Amend contributing build instructions to help solve potential build problems 2016-01-18 00:41:25 -07:00
eugene yokota d9f10853fb Merge pull request #2371 from dwijnand/update-sbt-plugins
Upgrade sbt plugins. Fixes #2368
2016-01-16 03:11:17 -05:00
Dale Wijnand 84cba9669c Upgrade sbt plugins. Fixes #2368
Tested manually:

  $ grep 'version.*:=' build.sbt
  version := "0.13.10-SNAPSHOT",
  $ git archive --prefix=sbt-0.13.10-SNAPSHOT/ -o ~/Desktop/sbt-0.13.10-SNAPSHOT.tgz HEAD
  $ cd ~/Desktop
  $ ls
  sbt-0.13.10-SNAPSHOT.tgz
  $ tar xfz sbt-0.13.10-SNAPSHOT.tgz
  $ cd sbt-0.13.10-SNAPSHOT/
  $ sbt info
  [info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/0.13/plugins
  [info] Loading project definition from /Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project
  [info] Updating {file:/Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project/}sbt-0-13-10-snapshot-build...
  [info] Resolving org.fusesource.jansi#jansi;1.4 ...
  [info] Done updating.
  [warn] There may be incompatibilities among your library dependencies.
  [warn] Here are some of the libraries that were evicted:
  [warn]  * com.typesafe.sbt:sbt-site:0.8.1 -> 0.8.2
  [warn] Run 'evicted' to see detailed eviction warnings
  [info] Compiling 12 Scala sources to /Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project/target/scala-2.10/sbt-0.13/classes...
  [info] This is sbt 0.13.9
  [info] The current project is {file:/Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/}sbtRoot 0.13.10-SNAPSHOT
  [info] The current project is built against Scala 2.10.6
  [info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin...
  [info] sbt, sbt plugins, and build definitions are using Scala 2.10.5
2016-01-16 00:24:05 +00:00
eugene yokota a5bda9d80d Merge pull request #2354 from eed3si9n/wip/internal
Inter-project dependency tracking
2016-01-13 14:26:45 -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 7e88edbc25 Merge pull request #2358 from gkossakowski/compileInterface-tests
Run unit tests from compileInterface on Travis CI.
2016-01-08 20:52:18 -05:00
Grzegorz Kossakowski dd0ed7de5e Fix DependencySpecification test.
This is a fixup of 0f616294c4.
That commit assumed that dealiasing is being done for types referred in
self type. It was changed to not do that but the test wasn't updated.
Unfortunately, that mistake slipped by during PR review because unit tests
of compileInterface were not ran (see #2358).
2016-01-09 00:00:14 +01:00
Grzegorz Kossakowski e738bc3f73 Run unit tests from compileInterface on Travis CI.
Also, make the intent of the env variable clearer in travis configuration.

Fixes #2357.
2016-01-08 21:53:53 +01:00
eugene yokota d06b49d66d Merge pull request #2355 from eed3si9n/wip/scripted-more-mem
Adds more memory to internal scripted task
2016-01-08 11:22:27 -05:00
Eugene Yokota a39a5d2330 Adds more memory to internal scripted task 2016-01-08 02:15:49 -05:00
eugene yokota f9dc203247 Merge pull request #2343 from sbt/topic/inc-comp-stable-self
Assorted incremental compiler bug fixes.
2016-01-07 11:54:45 -05:00
Eugene Yokota 83b725559f Fix notes 2016-01-06 22:12:01 -05:00
Eugene Yokota 5661b0fac4 Adds release note to #2343 2016-01-06 17:52:53 -05:00
Adriaan Moors 81786a2206 Prefix name hashing debug output with [naha]
Further categorize debug output as api diff ([diff]), and
invalidation ([inv]). Since we log a ton of diagnostics,
make it a bit easier to find the relevant bits.
2016-01-06 13:56:54 -05:00
Adriaan Moors 698902ba44 API limited to static annotations to mimic pickling
Since pickled annotated types and symbols only mention
static annotations, whereas compilation from source
sees all annotations, we must explicitly filter annotations
in the API representation using the same criteria as the pickler,
so that we generate the same API when compiling from source
as when we're loading classfiles.
2016-01-06 13:56:54 -05:00
Krzysztof Romanowski d32a0eaaa0 Exclude all non static annotations from ExtractAPI 2016-01-06 13:56:54 -05:00
Adriaan Moors 0f616294c4 Extract dependencies in one pass.
Also a bit more complete: handle SelectFromTypeTree,
consider the self type an inheritance dependency,
and flatten any refinement types in inherited types,
to get to the symbols of their parents, instead of the
useless symbol of the refinement class.

Include inheritance dependencies in regular ones

Also, update test to reflect the self type is now seen as an inheritance dependency.

self types are local, so don't treat them like inherited types

note inheritanceSymbols dealiases, where allSymbols is constructed differently

fix NPE in source-dependencies/macro-annotation
2016-01-06 13:56:54 -05:00
Adriaan Moors 8c73b2f221 Refactor mkStructure
Specialize two implementations for each value of the `inherit` boolean argument.
Also use a more direct way of distinguishing declared and inherited members.

backwards compat for source-dependencies/inherited-dependencies
2016-01-06 13:56:54 -05:00
Adriaan Moors 9346e2bb4d Only include all base types for class definitions
For refinement types, the Structure was already restricted
to declarations (and not inherited members), but all base types
were still included for a refinement's parents, which would
create unwieldy, and even erroneous (cyclic) types by expanding
all constituents of an intersection type to add all base types.

Since the logic already disregarded inherited members, it seems
logical to only include direct parents, and not all ancestor types.

```
class Dep {
  def bla(c: Boolean) = if (c) new Value else "bla"
}

class Value extends java.lang.Comparable[Value] { def compareTo(that: Value): Int = 1 }
```
2016-01-06 13:56:54 -05:00
Adriaan Moors 3e03e0d1b5 Clean up ShowApi implicit overload
Motivated because we want to make it more robust & configurable.
Original motivation was to diagnose a cyclic type representation,
likely due to an f-bounded existential type, as illustrated by the following:

```
class Dep {
  // The API representation for `bla`'s result type contains a cycle
  // (an existential's type variable's bound is the existential type itself)
  // This results in a stack overflow while showing the API diff.
  // Note that the actual result type in the compiler is not cyclic
  // (the f-bounded existential for Comparable is truncated)
  def bla(c: Boolean) = if (c) new Value else "bla"
}

class Value extends java.lang.Comparable[Value] { def compareTo(that: Value): Int = 1 }
```

Limit nesting (`-Dsbt.inc.apidiff.depth=N`, where N defaults to `2`),
and number of declarations shown for a class/structural type
(via `sbt.inc.apidiff.decls`, which defaults to `0` -- no limit).

Limiting nesting is crucial in keeping the size of api diffs of large programs
within a reasonable amount of RAM...

For example, compiling the Scala library, the API diff with nesting at `4`
exhausts 4G of RAM...
2016-01-06 13:56:54 -05:00
Adriaan Moors 51524055f7 Reduce memory usage of ExtractDependenciesTraverser 2016-01-06 13:56:54 -05:00
Adriaan Moors 1ce1123054 API only tracks declared type of self variable
The only aspect of the self variable that's relevant for
incremental compilation is its explicitly declared type,
and only when it's different from the type of the class that declares it.

Technically, any self type that's a super type of the class could be ignored,
as it cannot affect external use (instantiation/subclassing) of the class.
2016-01-06 13:56:54 -05:00
Adriaan Moors 214451c51f API extraction ensures class symbol is initialized
Call `initialize` in case symbol's `info` hadn't been completed
during normal compilation.

Also, normalize to the class symbol immediately.

Add a TODO regarding only looking at class symbols,
and thus ignoring the term symbol for objects,
as the corresponding class symbol has all the relevant info.
2016-01-06 13:56:54 -05:00
Dale Wijnand 5b7c55109e Merge pull request #2349 from gkossakowski/scripted-scala-version-cleanup
Upgrade Scala version in scripted tests
2016-01-06 03:51:04 +01:00
Grzegorz Kossakowski 8c9c61815a Upgrade Scala version in scripted tests
Both continuations and macro-config set scalaVersion explicitly but since
sbt relies now on Scala 2.10 it's not needed anymore. In particular, we
can upgrade continuations to 2.10 which makes it easier to work with Java
8.
2016-01-05 23:08:50 +01: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 886b3647e3 Merge pull request #2345 from eed3si9n/wip/testtest
Maven compatibility changes (intransitive warnings and "configuration not public")
2016-01-01 01:23:59 -05: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 182374c712 Reproduce "configuration not public" on local test->test. #1827 2015-12-31 00:25:21 -05:00
Eugene Yokota e82e6652d0 Move intransitive warning to update. Ref #2127 2015-12-30 13:41:31 -05:00
eugene yokota bcb98ab6bb Merge pull request #2342 from sbt/wip/file-bincompat-in-io-for-pr2268
[0.13.10] Fix bincompat issue introduced in #2268
2015-12-30 12:48:10 -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 068cffa578 Reimplement fallback to system classloader to maintain the 0.13 semantics 2015-12-30 07:36:12 -05:00
Eugene Yokota fd6373d8bf Bump up ivy to 2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a 2015-12-30 07:21:07 -05:00
Eugene Yokota db81fa2109 Fix bincompat issue introduced in #2268 2015-12-30 06:22:55 -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 cc07ad78eb Bump up ivy to 2.3.0-sbt-39ece6f17e1af62c2e89a9d88b59c0c3aad56145
Ref sbt/ivy#21
2015-12-30 04:07:39 -05:00
eugene yokota b87a4acc2e Merge pull request #2338 from sbt/wip/nightly_launchconfig
Include sbt-ivy-snapshots to launchconfig
2015-12-29 23:45:50 -05:00
eugene yokota 5ba7352a0d Merge pull request #2339 from sbt/wip/2325_notes
Release note for #2325
2015-12-29 21:46:19 -05:00
Eugene Yokota 585e727a97 Include sbt-ivy-snapshots to launchconfig
Include sbt-ivy-snapshots to launchconfig
Prior to this change, the launchconfig for sbt was generated using
Transform's resource generator so releases would include
`typesafe-ivy-releases` repo, and snapshot releases would include
`typesafe-ivy-snapshots` and `sonatype-snapshots` repos in addition.
This is no longer useful since nightly builds are now published to
`sbt-ivy-snapshots` instead, which is backed by Bintray.

This removes the switching logic, so both `typesafe-ivy-releases` and
`sbt-ivy-snapshots` repos are always included into the launchconfig.
This removes the step of needing to download a launcher just to try the
nightly builds.
2015-12-29 19:48:57 -05:00
Eugene Yokota fd347f0020 Release note for #2325 2015-12-29 18:13:58 -05:00