Commit Graph

5148 Commits

Author SHA1 Message Date
jvican 8aee628297
Fix #3610: project/old-ops
`compile` does nothing in this test, what we need to do is `reload`.
2017-05-10 21:40:21 +02:00
jvican 0ebf2d14a3
Fix more tests using compiler iterations 2017-05-10 21:40:21 +02:00
jvican 6191f35f1c
Fix java options for scripted
* Remove MaxPermSize from another scripted opts
* Reduce memory of sbt host to 1g instead of 2g
* Add Xms java options to scripted
* Enable parallelism with 512M for sbt tests
* Parallelism + batch mode
2017-05-10 21:40:03 +02:00
jvican 5a23fa0e9a
Fix #3160: Newline after comment line 2017-05-10 21:40:03 +02:00
jvican dc048926c7
Fix fancy uses of analysis
Clean up first analysis to make sure that test utilities using
information from analysis have correct information that does not collide
with the compilation analysis of the previous runs (batch tests).
2017-05-10 21:40:03 +02:00
jvican 927910aa72
Fix compile tests using `checkIterations`
Those tests using `checkIterations` were not working because an
invariant was working: the first iterations number is 0. As we reuse
sbt for running several tests, this is no longer true, so this commit
makes sure that they are updated with the pertinent infrastructure to
compute the performed iterations from the latest known number of
iterations.
2017-05-10 21:40:02 +02:00
jvican c94a445737
Use scripted hook to run reload
This saves us from duplicating error handling logic to correctly manage
`pending` tests whose projects don't even load (and make our reload)
fail.
2017-05-10 21:40:02 +02:00
jvican 210dcde822
Run pre hook only after checking disabled tests 2017-05-10 21:40:02 +02:00
jvican 0ee3585b6d
Add batch mode execution to scripted
For that, we:

* Change the existing infrastructure to recycle as much code as
  possible.
* Use `BatchScriptRunner` since `ScriptRunner` is too restrictive to
  programmatically control the underlying sbt servers.
* Unify `TestRunner` to the more general way for both batch and
  non-batch modes.
2017-05-10 21:40:02 +02:00
jvican 70cf417525
Fix #3161: Don't fail if group is not present
This covers the case described in #1361 plus an esoteric case too.
Parsers are initialized when sbt starts and text completions use the
knowledge at that time. If we happen to move a new file that should
influence the behaviour of the tab completion, that file will not be
picked up. Before, since we were throwing an error, the previous case
that would no produce any tab completion would also fail, though the
files are legitimately in the correct place.
2017-05-10 21:40:02 +02:00
jvican e69436adde
Remove `MaxPermSize` since sbt depends on JDK8
FTR:

```
[error] OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
```
2017-05-10 21:40:01 +02:00
jvican c6610b9395
Fix #3160: Don't use val extractor in build
See comment in https://github.com/sbt/sbt/issues/3160.
2017-05-10 21:40:01 +02:00
jvican 9d8f18a4a4
Fix #3160: Disable sha-conflict
This test was always failing but was marked as passed by the previous
scripted framework because the test files were only checking the failure
of tests.

The test case depends on bintray, which could never have been resolved
for sbt 1.0.0-SNAPSHOT. This resolution error was the one "hidden".
2017-05-10 21:40:01 +02:00
jvican 293ae706f5
Fix #3160: Make actions/task-cancel compile 2017-05-10 21:40:01 +02:00
jvican 9d260f68c7
Use `ConsoleReporter` if no reporter is found
This change is necessary in the cases where we have global
initialization issues that have no position, like:

```
[info] [error] scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
```

Before, it was failing with a `sys.error` exception. Now we will report
these issues with a console reporter that is not meant to be
thread-safe.
2017-05-10 21:40:01 +02:00
jvican 5ca2e3c87e
Reduce memory of scripted tests + extra
* Remove oversight in error message
* Up the memory limit per scripted instance
2017-05-10 21:39:45 +02:00
jvican b923f12cc8
Deduplicate `scriptedTest` and remove exceptions
The following commit minimises the amount of exceptions that leak
through our internal signatures. It thus changes the return type
signature of `scriptedTest` to return an `Option` instead of `Unit`.

At the call-site of `scriptedTest`, we also remove the code to handle
the exceptions thrown by it.
2017-05-10 21:32:36 +02:00
jvican e80ec0a670
Abstract over `runAll` and `runInParallel`
This is the best we can do without using structural types.
2017-05-10 21:32:36 +02:00
jvican f497e15cd8
Run scripted tests in parallel
Add binary-compatible methods to run scripted tests in parallel using
parallel collections. Parallel collections are not tuned and a default
of 4 cores is used for the `ForkJoinPool`. This can be a matter of
experimentation in the future but for now I prefer to stay with it.

The non-parallel methods are not affected by this change.

The changes to the scripted plugin have not been used, only the sbt
scripted plugin is using `runInParallel`. In the future, this change can
also happen so that plugin authors can benefit from parallel sbt
testing. This is not a priority for me now :)
2017-05-10 21:32:36 +02:00
jvican 23762a3ac5
Delete scripted deprecations & CompatibilityLevel
We don't have to care about migrations in these removals because no one
should be depending on these methods directly. People consume scripted
via the sbt plugin.

This commit also removes the unused `CompatibilityLevel` which is
completely outdated, making reference to Scala 2.9 et al.
2017-05-10 21:32:31 +02:00
Dale Wijnand 934fabae25 Merge pull request #3182 from eed3si9n/wip/interactive
Add InteractionService from sbt-core-next
2017-05-09 07:31:56 +01:00
Eugene Yokota 4182249526 Add InteractionService from sbt-core-next
Fixes sbt/sbt#3167
2017-05-08 21:54:58 -04:00
Dale Wijnand 367ab3b2d3 Merge pull request #3181 from dwijnand/pre-sbt1
Upgrades & tweaks to the build to prep for using sbt 1
2017-05-08 16:41:27 +01:00
Dale Wijnand 31f61948d6
Add a few more migration notes to 1.0.0 notes 2017-05-08 15:18:36 +01:00
Dale Wijnand 55e055fa39
Upgrade to sbt-ghpages 0.6.0 2017-05-08 15:02:32 +01:00
Dale Wijnand b65dc1830e
Upgrade to sbt-bintray 0.4.0 2017-05-08 15:02:31 +01:00
Dale Wijnand ad03595584
Upgrade to sbt-site 1.2.0 2017-05-08 15:02:31 +01:00
Dale Wijnand 3a7fc6d1e5
Upgrade to sbt-git 0.9.2 2017-05-08 14:34:30 +01:00
Dale Wijnand f9e0dc0a48
Upgrade to sbt-mima 0.1.14 2017-05-08 14:16:35 +01:00
Dale Wijnand d5a10923f8
Drop myProvided from the build
Introduces by Mark in d928047678.

Dropped because Project#copy no longer exists (publically) in sbt 1.

It looks like it might have been added to deal with transitive
dependencies of scala-compiler, possibly JLine. Now it looks like it's
only used by launcher-interface, which has 0 dependencies.
2017-05-08 14:08:40 +01:00
Dale Wijnand 33f79a9fcd
Make sure addSbtModule will work in sbt 1
For some reason using ClasspathDependency doesn't work in sbt 1, while
ClasspathDep[ProjectReference] does. The latter is less specific and
works just as well.
2017-05-08 14:07:37 +01:00
eugene yokota 6cd3cd2323 Merge pull request #3149 from scalacenter/clean-update
Clean up `update` in `Defaults`
2017-05-05 11:03:18 -04:00
Dale Wijnand 545f5f66e7 Merge pull request #3169 from scalacenter/util-x11
Bump up to lm X11
2017-05-04 12:49:11 +01:00
jvican 1252db6b4a
Address Eugene's feedback 2017-05-04 13:33:21 +02:00
eugene yokota da21e26339 Merge pull request #3163 from scalacenter/unique-settings-computation
Add duplicated settings test
2017-05-03 11:48:47 -04:00
jvican 818b8c85ae
Bump util to X11 and rename `SbtExclusionRule` 2017-05-03 12:42:16 +02:00
jvican 06fcf78bc9
Add duplicated settings test
This test shows how sbt is recomputing the settings completely (even if
they have side effect) every time a `Project.extract` and settings
manipulations are performed.

This is worrying because it's:

* Inefficient.
* Surprising.
* Incorrect -- settings may produce side effects.

Unless I'm mistaken, this proves that the computation of settings is not
performed once.
2017-05-02 20:47:30 +02:00
jvican e7b8cbfe01
Move `cachedUpdate` to new `DependencyResolver`
The `cachedUpdate` implementation does not need to be in `Defaults`
since it's not using any of the tasks/settings defined there, that's
`updateTask`'s job.

This commit moves the utilities required by `updateTask` to the
`sbt.internal.librarymanagement` namespace.
2017-04-28 10:31:45 +02:00
jvican 1c961e8814
Move `AltLibraryManagementCodec` to internal
This is an implementation detail that should not be exposed in `Defaults`.

It is therefore moved to `librarymanagement.internal`.
2017-04-28 10:31:33 +02:00
jvican 8fd40e56df
Ease `updateTask` and `cachedUpdate` maintenance
This commit does some changes to the implementation with the purpose of
making this code more readable. I find that this rewrite was necessary
as I was implementing the dependency lock file.
2017-04-27 15:14:42 +02:00
eugene yokota edf7e566ba Merge pull request #3125 from eed3si9n/wip/format
[sbt 1.0] Reformat using Scalafmt
2017-04-21 12:05:27 -04:00
Eugene Yokota da046791e0 Apply Scalafmt formatting 2017-04-21 04:48:31 -04:00
Eugene Yokota 1ec7e8d975 format: off / format: on 2017-04-21 03:11:48 -04:00
Eugene Yokota 306db4d788 Check for git diff at Travis CI 2017-04-21 03:11:48 -04:00
Eugene Yokota 9d87e6b3d4 Add Scalafmt 2017-04-21 03:11:48 -04:00
eugene yokota d148103eda Merge pull request #3130 from eed3si9n/wip/fix-loaded-build-configuration
Improve `Load` in sbt
2017-04-21 03:09:56 -04:00
jvican 5c48b11d3f Simplify and document `load`
This commit has two goals:

* Simplify the `load` API endpoints, removing the unused ones to shorten
  the surface of the API.
* Add documentation to the main `load` methods.
2017-04-21 01:09:06 -04:00
jvican d2a51d5085 Indent timing logs
Sbt has a feature to show timed logs for every operation at startup.
However, its output is cluttered and users cannot read how much time
single methods consume nor if they call other methods.

This commit improves the status quo by adding indentation.
2017-04-21 01:09:06 -04:00
jvican 9175193df3 Remove unused `pluginDefinitionLoader` methods
This commit reduces the complexity around `loadPluginDefinition` et al.
`pluginDefinitionLoader` is not used anywhere in sbt, so the extra
definitions are removed.

Both the implementation of `loadPluginDefinition` and
`pluginDefinitionLoader` are reduced to a bare minimum where the
components at hand (definition classpath, dependency classpath) are
properly defined.

Documentation to the three methods has been added.
2017-04-21 01:09:06 -04:00
jvican 90782b1cd0 Fix implementation of `LoadBuildConfiguration`
It mainly does three things:

* Clean up the implementation, removing unused values like
  `globalPluginDefs`.
* Make the implementation more readable.
* And the big one: Remove the creation of a classloader that we were
  instantiating but whose value we were throwing away. This has an impact
  in performance, but I'm yet to benchmark how much it is.
2017-04-21 01:09:06 -04:00