Commit Graph

1473 Commits

Author SHA1 Message Date
Eugene Yokota d945925d0e
Silent startup for scalas
Fixes #840
2016-09-15 22:08:56 +01:00
Dale Wijnand 8f2a5a659a Merge pull request #2742 from eed3si9n/wip/early2
[sbt 0.13] Rename early command to `early(command)`
2016-09-15 11:22:16 +01:00
Eugene Yokota ee718e8700 Rename early command to `early(command)`
Backports #2741, Fixes #1041

e93c445 added a feature called early command, which uses `--` as a
prefix to denote some commands that runs ahead of session loading.
While the feature might be useful especially for logging, `--` is too
useful just for this purpose.

In addition, this adds log level commands with single `-`, such as
-error to treat them as early commands; and keeps `--` variant for log
level for backward compatibility.
2016-09-15 03:06:12 -04:00
Eugene Yokota 675f70fd85 Rename to extraProjects/derivedProjects
Ref #2717
2016-09-14 20:09:16 -04:00
Dale Wijnand 6a26bb2fb6 Return a better forked test harness failure message 2016-09-02 14:19:42 +01:00
Eugene Yokota 254c615f36 Fail when the forked test harness fails
Fixes #2442/#2722
2016-09-02 11:59:30 +01:00
eugene yokota 16a6906826 Deprecate the old operators `<<=`, `<+=`, and `<++=` (#2716)
* Backport style changes in tests and Defaults.scala

This backports the scripted tests and Defaults.scala style changes to
use `build.sbt` and `:=`.

* Fix backport

* 	Deprecate the old operators `<<=`, `<+=`, and `<++=`

The no-longer-documented operators `<<=`, `<+=`, and `<++=` are
deprecated in anticipation of the removal in sbt 1.0. Ref #2711

For `<<=`, the suggested migration would be to use either `:=` or `~=`
operators. The RHS of `<<=` takes an `Initialize[_]` expression, which
can be converted to `:=` style by wrapping the expression in
parenthesis, and calling `.value` at the end.
2016-08-29 21:15:13 +02:00
eugene yokota cd216a2758 Backport style changes in scripted tests and Defaults.scala (#2715)
* Backport style changes in tests and Defaults.scala

This backports the scripted tests and Defaults.scala style changes to
use `build.sbt` and `:=`.
2016-08-29 21:14:39 +02:00
Eugene Yokota 0fab1181c4 Add buildExtras and projectExtras. Fixes #2532
This adds support to generate synthetic subprojects from an auto plugin.

In addition, a method called `projectOrigin` is added to distinguish
Organic, BuildExtra, ProjectExtra, and GenericRoot.
2016-08-27 07:31:51 -04:00
eugene yokota 6631456eff Deprecate .value extension method from input tasks (#2709)
Calling the `.value` method on an input task returns `InputTask[A]`, which is completely unintuitive. I think it's basically a bug in `.value`. This change deprecates the `.value` call on input tasks, in preparation to the removal in sbt 1.0.

In most cases `.evaluated` should be called, which returns `A` by evaluating the task. Just in case `InputTask[A]` is needed, `inputTaskValue` method is now provided.

One of the motivation for doing this now is the deprecation of old operators `<<=`, which forces more users to convert to the `:=` style and potentially run into the `.value` behavior.
2016-08-26 14:44:49 -04:00
Martin Duhem 60bcc58852 Fix key selection for build level keys
PR #2469 added build keys to tab completion, with the side effect of
considering as available candidate in key selection, thus making sbt
think that some inputs were ambiguous (e.g. `baseDirectory`): should it
apply to the current project or to the build level key?

This commit fixes this issue by improving the key selection:
 - If there's no candidate, we return the default key
 - If there's a single possible project level key, and zero or more
   build level keys, then we select the project level key.
 - If there are zero project level key, and a single build level key,
   then we select the build level key
 - If there are multiple candidates, sbt says that the input is
   ambiguous.

Fixes #2707
2016-08-24 11:13:08 +02:00
Eugene Yokota f29932e594 Fix parser for new command 2016-08-22 11:29:35 -04:00
Eugene Yokota 954e744408 Adds templateResolvers and `new` command
This adds `new` command, which helps create a new build definition. The
`new` command is extensible via a mechanism called the template
resolver,
which evaluates the arbitrary arguments passed to the command to find
and run a template.

As a reference implementation [Giter8][g8] is provided as follows:

    sbt new eed3si9n/hello.g8

This will run eed3si9n/hello.g8 using Giter8.

  [g8]: http://www.foundweekends.org/giter8/
2016-08-22 02:38:46 -04:00
Eugene Yokota ca12418eb8 Fixes #2686 by resetting scalaVersion for updateSbtClassifiers
Ref #2634

updateSbtClassifiers uses an artificially created dependency graph set
in classifiersModule. The problem is that ivyScala instance is reused
from the outer scope that has the user project's scalaVersion as
demonstrated as follows:

    scala> val is = (ivyScala in updateSbtClassifiers).eval
    is: Option[sbt.IvyScala] =
Some(IvyScala(2.9.3,2.9.3,List(),true,false,true,org.scala-lang))

This change fixes #2686 by redefining ivyScala with scalaVersion and
scalaBinaryVersion scoped to updateSbtClassifiers task. The existing
scripted test was modified to reproduce the bug.
2016-08-05 01:21:06 -04:00
eugene yokota 6c8555c5f1 Merge pull request #2681 from pauldraper/pauldraper-forked-test-group
Fix #2677: Tags.ForkedTestGroup doesn't work
2016-07-25 03:30:07 -04:00
xuwei-k b92e5773f7 `aggregate` can now be used inside a .sbt file 2016-07-25 12:07:49 +09:00
Paul Draper 0c9182a4b9 Fix #2677: Tags.ForkedTestGroup doesn't work
Move tag to correct task
2016-07-22 10:17:24 -06:00
Anatoly Fayngelerin fcedd17270 dependsOn can now be used inside a .sbt file for a subproject 2016-06-29 17:20:28 -04:00
Miles Sabin e98b2363c2 Override scala organization and version transitively at the Ivy level. Fixes #2286. 2016-06-02 12:07:30 +01:00
Eugene Yokota 6a0f5dd471 Use parent's toString 2016-05-25 12:57:38 -04:00
Eugene Yokota 4900c71ff9 Cache now takes in account of the parent of the classloader 2016-05-25 12:21:35 -04:00
Eugene Yokota 84f8cc447d Remove unnecessary val 2016-05-25 03:51:53 -04:00
Eugene Yokota f9b1583251 Cache based on the underlying URLs of the ClassLoader per review 2016-05-25 03:51:12 -04:00
Eugene Yokota c67b3881de Display log when sbt loading is going to pause
Def.make could take 10099ms for 100 subprojects. This would display
logs probably for projects with more than 10 subprojects, which might
pause for a few seconds during load.
2016-05-25 01:51:07 -04:00
Eugene Yokota 0f43d21e72 Improve structureIndex call by using Vector
This call takes around 8035ms for 100 subprojects. I don't think using
Vector here had any noticeable effect.
2016-05-25 01:49:23 -04:00
Eugene Yokota ed0c82de7f Cache global user settings 2016-05-25 01:12:49 -04:00
Eugene Yokota 511737c828 Add perf logs 2016-05-25 01:11:47 -04:00
ekrich fd5f87e7b4 Add Windows script support and native file extensions on Unix platforms
When running a sbt script, this change lets the user on UNIX and
Windows platforms to use native file extensions like none/.sh or
.bat/.cmd. The code copies the file to the sbt boot/hash/src_managed
directory with a .scala extension.
2016-05-10 12:32:32 -07:00
Eugene Yokota 84e7244e4e Fix #2519. Fixes Maven Central getting included even with repo override 2016-04-24 14:24:05 -04:00
eugene yokota b10414da73 Merge pull request #2564 from Duhemm/wip/fix-2518
Off-the-grid installation of sbt
2016-04-20 16:53:19 -04:00
Martin Duhem 175ece4238 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.
2016-04-15 08:35:27 +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
Dale Wijnand f2f12022a5 Deprecate the Build trait 2016-03-31 16:47:12 +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
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 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
Martin Duhem 6cabb9b4cb Update bridge retrieval in `consoleProject`
Fixes sbt/sbt#2428
2016-01-31 17:09:56 +01:00
Eugene Yokota 9da5fc871b Changed the flag name to "sbt.global.autoimport" per review. 2016-01-26 03:05:30 +09:00
Eugene Yokota ceccbf2d5a Fixes #2415. Hide global setting fix behind sbt.globalsettingfix
We are hiding a bug fix on global setting that was not importing auto
imports because fixing this via sbt/sbt#2399 breaks the source
compatibility: sbt/sbt#2415
I've split out the relevant portion of the scripted test into
global-settings, and marked it pending.
2016-01-24 16:50:21 -08: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
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
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 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 e82e6652d0 Move intransitive warning to update. Ref #2127 2015-12-30 13:41:31 -05:00
eugene yokota 05e5ae311b Merge pull request #2322 from dwijnand/drop-sealed-from-Append-typeclasses
Drop sealed from the typeclasses in Append
2015-12-29 13:00:57 -05:00
Eugene Yokota 9699f4b1b7 Adds bootIvyConfiguration to grab compiler bridge source. Fixes #2336
As described in #2336, I noticed that when using 0.13 nightly from
Bintray, sbt was unable to locate the compiler source.
Since `updateSbtClassifiers` is already set up to download sbt's own
sources, the `ivyConfiguration` should be reused. However, `compilers`
is a derived task, which is unable to depend on a scoped key.
To workaround this I had to create a new key called
`bootIvyConfiguration`. This should now use the metabuild's resolvers
to download the compiler bridge source.
2015-12-28 17:15:02 -05:00