Commit Graph

4546 Commits

Author SHA1 Message Date
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
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
Jason Zaugg 2e5567b816 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 08:25:36 +10:00
eugene yokota d3962a01ff Merge pull request #2441 from Duhemm/wip/fix-2436
Include ONLY nonpublic vars in API hash of traits
2016-02-10 16:26:54 -05:00
Martin Duhem 6576844698 Hash of traits: include private fields, objects and super accessors 2016-02-10 18:15:44 +01:00
eugene yokota 251596ab8f Merge pull request #2448 from timcharper/0.13
add documention for FileFunction.cached
2016-02-09 13:52:06 -05:00
Tim Harper fe0c3df36e add documention for FileFunction.cached 2016-02-09 09:52:19 -07:00
Martin Duhem edc1174468 Extend test `trait-private-var` with vals
Private vars and private vals defined in a trait impact the bytecode
generated for the implementors of these traits. The scripted test
`source-dependencies/trait-private-var` only accounted for private vars.

It now tries the same scenario both with private vars and private vals.
2016-02-09 15:28:35 +01:00
Martin Duhem 7d94251108 Also include private vals 2016-02-09 14:55:30 +01:00
Martin Duhem 8e17269c97 Include non-public vars in API hash of traits 2016-02-09 14:35:12 +01:00
eugene yokota 6f072f8f3b Merge pull request #2443 from eed3si9n/wip/2427
Fixes #2427 inter-project dependency interference with sbt-web
2016-02-05 12:18:36 -05:00
Eugene Yokota bd5453c0b0 Fixes #2427 inter-project dependency interference with sbt-web
sbt-web uses exportedProducts key as an extension point.
This removes exportedProductsAlways from 0.13.10-RC1,
and uses exportedProducts instead.
2016-02-05 08:28:59 -05:00
eugene yokota cdb52e96ca Merge pull request #2430 from Duhemm/wip/fix-2428
Update bridge retrieval in `consoleProject`
2016-02-04 23:40:40 -05:00
eugene yokota 49e801070f Merge pull request #2438 from Duhemm/wip/package-object-filename
Do not rely on filename of package objects
2016-02-04 23:40:07 -05:00
eugene yokota e41859ffe4 Merge pull request #2440 from cunei/toni-output-jars
Do not create dir, if trying to output classes to a jar
2016-02-04 18:38:32 -05:00
Martin Duhem be8ba763fa Include ONLY non-public members in API hash of traits
The previous logic was wrong and included all members of traits in their
API hash, which degraded the performance of the incremental compiler.

This commit changes this logic so that only the non-public members of
traits are included into their API hash.

Fixes #2436
2016-02-04 16:32:36 +01:00
Grzegorz Kossakowski 207dd762f4 Move `trait-member-modified` to source-dependencies
It's not clear what the distinction between compiler-project and
source-dependencies scripted tests is so let's stick to the one that has
the biggest number of tests for incremental compiler.
2016-02-04 16:32:35 +01:00
Grzegorz Kossakowski 74ffe5d064 Add a pending test for a modified member of a trait
The test shows that name hashing optimization is broken for members
defined in traits. The problem is that modification of a member of a trait
triggers change of a hash of trait's name.

The behavior covered by this test regressed in
40ebc82531
The bug is tracked in #2436.
2016-02-04 16:32:35 +01:00
Antonio Cunei 3e50fdc825 Do not create dir, if trying to output classes to a jar 2016-02-04 15:11:55 +01:00
Martin Duhem 34d2aabfa9 Attempt at fixing Codacy's complaints 2016-02-04 13:24:22 +01:00
Grzegorz Kossakowski 6e5082e5a7 Merge pull request #2437 from gkossakowski/nameHashing-trait-regression
Add a pending test for a modified member of a trait
2016-02-03 17:11:51 +01:00