Commit Graph

4665 Commits

Author SHA1 Message Date
Martin Duhem 1d44420c91 Comply to Ivy's specification in `FakeResolver` 2016-04-11 09:48:42 +02:00
Martin Duhem fab20c73bf 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.
2016-04-11 09:14:37 +02:00
Martin Duhem 6beb8f2c85 Tests for FakeResolver 2016-04-11 09:14:35 +02:00
eugene yokota c35cb7f54e Merge pull request #2542 from eed3si9n/wip/ivypath
Add toString to IvyPaths for debugging purpose
2016-04-06 15:16:10 -04:00
eugene yokota ba72faab35 Merge pull request #2540 from eed3si9n/wip/synthetic
Adds withIncludeSynthToNameHashing.
2016-04-06 13:48:57 -04:00
Eugene Yokota e065df9610 Add toString to IvyPaths for debugging purpose 2016-04-06 12:29:37 -04:00
Eugene Yokota 9458eb6428 Fixes test 2016-04-06 11:26:17 -04:00
Martin Duhem 88dd987d5f 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.
2016-04-06 15:21:01 +02: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
Eugene Yokota c75a386a82 Adds withIncludeSynthToNameHashing. Ref #2537
Provides a workaround flag `incOptions :=
incOptions.value.withIncludeSynthToNameHashing(true)` for name hashing
not including synthetic methods. This will not be enabled by default in
sbt 0.13. It can also enabled by passing `sbt.inc.include_synth=true`
to JVM.
2016-04-05 22:57:59 -04:00
Eugene Yokota 36293f7400 scalariform changed this. 2016-04-05 22:52:05 -04:00
eugene yokota bc70ec0492 Merge pull request #2169 from Duhemm/scripted-local-repo
Publish compiler interface to an alternate local repository for Scripted tests
2016-04-05 13:16:34 -04:00
Martin Duhem 5b0c9aa938 Add alternative resolver to scripted test using a plugin 2016-04-05 17:33:51 +02:00
Martin Duhem 8318ff9b63 Publish compiler interface to alternate repo for Scripted
Some scripted tests override the default local repository, which
produces errors with the compiler because sbt cannot find the sources
for the compiler interface.

This fix proposes to publish the compiler interface sources to an
alternate local repository before running the scripted tests. This
alternate repository is added to the scripted sbt's configuration, so
that sbt is finally able to find the compiler interface sources.
2016-04-05 17:33:51 +02:00
Martin Duhem cb4500f085 Auto format `Tracked.scala` 2016-04-04 13:35:06 +02:00
eugene yokota 6125cf596c Merge pull request #2530 from dwijnand/deprecate-Build
Deprecate the Build trait
2016-04-01 10:14:08 -04:00
Dale Wijnand f2f12022a5 Deprecate the Build trait 2016-03-31 16:47:12 +01:00
eugene yokota 9d666c5ad0 Merge pull request #2507 from gkossakowski/self-variable-unstable
Fix instability of self variable API representation
2016-03-18 12:50:01 -04: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 c338e87d0a Pending test for sbt/sbt#2435 2016-03-14 15:58:27 +01:00
eugene yokota 575bc12e00 Merge pull request #2500 from Duhemm/wip/fix-2431
Fix sbt/sbt#2431
2016-03-14 10:18:19 -04: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
Grzegorz Kossakowski f848b69534 Add more test cases for self type and self variables.
Per review request, add two more test cases for self variable (no self
type).
2016-03-09 00:58:28 +01:00
Grzegorz Kossakowski a6ae339515 Fix instability of self variable API representation
The reason for instability is a bit tricky so let's unpack what the
previous code checking if there's self type declared was doing. It would
check if `thisSym` of a class is equal to a symbol representing the class.
If that's true, we know that there's no self type. If it's false, then
`thisSym` represents either a self type or a self variable. The second
(type test) was supposed to check whether the type of `thisSym` is
different from a type of the class. However, it would always yield false
because TypeRef of `thisSym` was compared to ClassInfoType of a class.
So if you had a self variable the logic would see a self type (and that's
what API representation would give you).

Now the tricky bit: `thisSym` is not pickled when it's representing just
a self variable because self variable doesn't affect other classes
referring to a class. If you looked at a type after unpickling, the
symbol equality test would yield true and we would not see self type when
just a self variable was declared.

The fix is to check equality of type refs on both side of the type equality
check. This makes the pending test passing.

Also, I added another test that checks if self types are represented in
various combinations of declaring a self variable or/and self type.

Fixes #2504.
2016-03-08 22:24:26 +01:00
Grzegorz Kossakowski d7eee101d0 Add a pending test for self variable bug (#2504)
Add a pending test that shows a problem with instability of representing
self variables. This test covers the bug described in #2504.

In order to test API representation of a class declared either in source
file or unpickled from a class file, ScalaCompilerForUnitTesting has been
extended to extract APIs from multiple compiler instances sharing a
classpath.
2016-03-08 20:42:11 +01:00
Grzegorz Kossakowski abc525a23d Compiler instances handling in ScalaCompilerForUnitTesting
This commit enables control of whether a compiler instance should be reused
between compiling groups of Scala source files. Check comments in the code
for why this can be useful to control.
2016-03-08 20:32:16 +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
Martin Duhem 2986a3bcbb Pending test for sbt/sbt#2431 2016-03-07 11:37:39 +01:00
Dale Wijnand 884da06170 Merge pull request #2469 from Duhemm/wip/fix-2460
Completion for build-level keys
2016-02-25 19:11:36 +00:00
Martin Duhem 791358abb0 Notes for #2469 2016-02-25 16:09:17 +01:00
eugene yokota 65201a578b Merge pull request #2474 from dwijnand/bump-versions
Bump to 0.13.12-SNAPSHOT & 0.13.11
2016-02-23 10:28:25 -05:00
Martin Duhem 1bda41fc31 Address problems reported by Codacy 2016-02-23 15:19:04 +01:00
Martin Duhem 4fea604759 Unspecified project axis means current project or its build 2016-02-23 15:11:16 +01:00
Martin Duhem e35f9bb11e Completion for build-level keys
sbt's shell provided completion only for keys that were relative to a
defined project, but didn't provide completion for keys that belong to
the build definition only.

This commit fixes this issue by defining a new kind of `Parser` (from
which completions are generated) which runs its input simultaneously on
distinct parsers. We now define a parser for project-level keys and
another parser for build-level keys. These two parsers are eventually
combined, and we get the completions of both parsers.

Fixes sbt/sbt#2460
2016-02-23 15:11:15 +01:00
Dale Wijnand 511f74504a Update sbt.version to 0.13.11 2016-02-22 21:21:26 +00:00
Dale Wijnand d5e2e7d406 Update version to 0.13.12-SNAPSHOT 2016-02-22 21:15:22 +00:00
Dale Wijnand 260aa7624f Merge pull request #2471 from eed3si9n/wip/0.13.10-merge
0.13.10 branch changes
2016-02-22 21:09:33 +00:00
Eugene Yokota 9a57834d25 source-dependencies/trait-member-modified is no longer pending 2016-02-22 13:22:51 -05:00
Eugene Yokota 2fe5eabd6e Merge branch '0.13.10' into wip/0.13.10-merge 2016-02-22 13:19:38 -05:00
Eugene Yokota d281c3561d notes 2016-02-22 02:22:29 -05:00
Eugene Yokota 683995e64f bump launchconfig 2016-02-21 21:28:59 -05:00
Eugene Yokota 7ebba1c54e sbt 0.13.11 is the new 0.13.10 2016-02-21 18:50:17 -05:00
Dale Wijnand 213dc87e9f Merge pull request #2467 from eed3si9n/wip/jcenter
Fixes #2464. Actually reorganize appResolvers
2016-02-21 13:19:47 +00:00
Eugene Yokota d2cb16968c Adds test for #2466 per review 2016-02-21 06:44:35 -05:00
Eugene Yokota c5954ae156 Fixes #2464. Actually reorganize appResolvers
Fixes #2464 and Fixes #2465
appResolvers is a set of resolvers specified in the launcher
configuration.
This list fluctuates depending on the version of sbt, and sbt 0.13.10
meant to stabilize it by weeding out JCenter even when it includes it,
which failed when I applied the filter on the wrong list. This should
correct it.
2016-02-21 04:08:12 -05:00
Eugene Yokota 2a956a97df launchconfig bump 2016-02-19 16:39:37 -05:00
Dale Wijnand 7530878806 Merge pull request #2412 from smarter/patch-1
CONTRIBUTING.md: Fix error in scripted test command
2016-02-14 23:21:16 +00:00
Eugene Yokota be69daeb8d Add notes for #2453 2016-02-11 16:32:39 -05:00
Jason Zaugg 7d4890b68a Avoid CCE when scalac internally uses compileLate. Fixes #2452
For example, when the `--sourcepath` option is provided
and the refchecks phase compiles an annotation found
on a referenced symbol from the sourcepath.

`compileLate` assumes that all non-sentinel compiler
phases can be down cast to `GlobalPhase`.

This commit changes the two phases in SBT to extend
this instead of `Phase`. This has the knock on benefit
of simplifying the phases by letting the `GlobalPhase.run`
iterator over the list of compilation units and feed them
to us one by one.

I checked that the test case failed before making each
change.
2016-02-11 16:29:09 -05:00
eugene yokota e4926da40b Merge pull request #2453 from retronym/topic/sourcepath
Avoid CCE when scalac internally uses compileLate
2016-02-10 20:49:32 -05:00