Commit Graph

1512 Commits

Author SHA1 Message Date
Dale Wijnand bd59f14f08
Notify about shell less
+ Don't notify ScriptMain users by moving the logic to xMain
+ Only trigger shell if shell is a defined command
+ Use existing Shell/BootCommand strings instead of new ones
2017-03-21 13:20:34 +00:00
Dale Wijnand aaaf254375
Tell the user we're setting sbt.version 2017-03-16 21:49:15 +00:00
Dale Wijnand 465a9be635
Add -Dsbt.skip.version.write=true opt-out 2017-03-16 19:42:17 +00:00
Dale Wijnand 155f764943
Write sbt.version to project/build.properties
Have sbt.version set in project/build.properties is a best practice
because it makes the build more deterministic and reproducible.

With this change sbt, after ensuring that the base directory is probably
an sbt project, writes out sbt.version in project/build.properties if it
is missing.

Fixes #754
2017-03-16 18:55:26 +00:00
Lars Hupel b64f64ca9a avoid deleting the target of `makeJar` if it's not a file 2017-03-14 16:20:20 +01:00
Dale Wijnand 14adc2b47f
Handle non-shell sbt startup warning
The sbt/sbt-launcher-package doesn't invoke sbt with the "shell"
command. sbt has a mechanism for handling this in its "boot" command
that adds an "iflast shell" to the commands. Handle this when displaying
the "Executing in batch mode" warning.

Fixes #3004
2017-03-13 15:44:36 +00:00
Eugene Yokota 6f3e756871 bump to sbt-giter8-resolver 0.1.3 2017-03-11 01:12:54 -05:00
Dale Wijnand 347323bb98
Avoid missleading, link the syntax migration guide
Fixes #2818
2017-03-10 11:29:44 +00:00
eugene yokota cc19d51f1d Merge pull request #2961 from ekrich/wip13/fix-2551
Fix #2551: scripted mode ignores quotation
2017-03-09 14:44:59 -05:00
eugene yokota a3d776c1c9 Merge pull request #2996 from dwijnand/stay-in-shell
Notify & enable users to stay in the warm shell
2017-03-07 13:16:41 -05:00
Dale Wijnand e75ebb86b6
Try communicating in actual English 2017-03-07 13:56:05 +00:00
Dale Wijnand 1c614fd699
Instruct how to get into interactive mode directly 2017-03-07 13:30:56 +00:00
Dale Wijnand 019f92dc93
Switch from log.info and !!! to log.warn
Good idea, Lars. Thanks.
2017-03-07 13:01:44 +00:00
Dale Wijnand b53d8c4433
Notify & enable users to stay in the warm shell
Notify & enable users to stay in sbt's shell on the warm JVM by hitting
[ENTER] while sbt is running.

Looks like this; first I run 'sbt about', then I hit [ENTER]:

    $ sbt about
    [info] !!! Executing in batch mode !!! For better performance, hit [ENTER] to remain in the sbt shell

    [info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/0.13/plugins
    [info] Loading project definition from /s/t/project
    [info] Set current project to t (in build file:/s/t/)
    [info] This is sbt 0.13.14-SNAPSHOT
    [info] The current project is {file:/s/t/}t 0.1.0-SNAPSHOT
    [info] The current project is built against Scala 2.12.1
    [info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
    [info] sbt, sbt plugins, and build definitions are using Scala 2.10.6
    >
    >

Fixes #2987
2017-03-07 12:36:34 +00:00
Haochi Chen f2ff94f0f3 Backport #2941 to 0.13.x 2017-02-23 02:24:22 -03:00
Eric K Richardson 8a78de1ff3 Merge branch '0.13' into wip13/fix-2551 2017-02-14 10:05:15 -05:00
ekrich d74b24db42 Fix #2551: scripted mode ignores quotation 2017-02-14 09:55:27 -05:00
Eugene Yokota 70a2878dbc Adds an Append instance that extracts taskValue
This adds a macro-level hack to support += op for sourceGenerators and resourceGenerators using RHS of Initialize[Task[Seq[File]]].
When the types match up, the macro now calls `.taskValue` automatically.
2017-01-22 23:44:48 -05:00
Dale Wijnand 011d0e8489
Remove some code duplication between TaskInstance and MultiInTask 2017-01-13 14:26:54 +00:00
Guillaume Martres 3c6db1ce5d Automatically choose proper compiler bridge for dotty
Before this commit, using dotty in your sbt project required to add:
  scalaCompilerBridgeSource := ("ch.epfl.lamp" % "dotty-sbt-bridge" %
    scalaVersion.value % "component").sources()
in your build.sbt. We might as well automatically do this, this reduces
the boilerplate for using dotty in your project to:
  scalaOrganization := "ch.epfl.lamp"
  scalaVersion := "0.1.1-SNAPSHOT"
  scalaBinaryVersion := "2.11" // dotty itself is only published as a
                               // 2.11 artefact currently
2017-01-11 16:06:45 +01:00
Eugene Yokota 00bab7b743 Add build-level keys to the tab completion
Fixes #2460
Fixes #2851
Ref #2707, #2708, #2469

Unlike the previous attempts at fixing the handling of build-level
keys, this change does not change the main parsing logic, which uses
`getKey` to retrieve the key from the key map.
The fact that shell worked pre-0.13.11 means that the parsing was ok.

What this changes is just the "example" keys supplied to the parser so
the tab completion works.
2016-11-30 02:33:05 -05:00
Eugene Yokota 49809056fc Revert "Completion for build-level keys"
This reverts commit e35f9bb11e.
2016-11-29 05:59:33 -05:00
Eugene Yokota 612d9555d0 Revert "Unspecified project axis means current project or its build"
This reverts commit 4fea604759.
2016-11-29 05:59:18 -05:00
Eugene Yokota 3e653f73b3 Revert "Fix key selection for build level keys"
This reverts commit 60bcc58852.
2016-11-29 05:57:43 -05:00
Petro Verkhogliad 08951436f0
Use sbt-giter8-resolver 0.1.2 2016-11-08 15:31:29 -05:00
Petro Verkhogliad 29a524e18d
Use sbt-giter8-resolver 0.1.1 2016-11-06 17:25:56 -05:00
eugene yokota 38cfb622f7 Merge pull request #2764 from dwijnand/deprecate-tuple-enrich
Deprecate tuple enrichments. Fixes #2763
2016-10-14 20:13:22 -04:00
Dale Wijnand 6ad39b1069
Deprecate tuple enrichments. Fixes #2763 2016-10-14 21:28:51 +01:00
Eugene Yokota 620a49bb0c Improve deprecation message 2016-10-14 14:42:38 -04:00
Eugene Yokota cfac453c07 Add "-deprecattion" flag to metabuild
Fixes #2783
Ref #2716

`build.sbt` is treated a Scala source of metabuild, so to enable
deprecation flag on build.sbt we set the option here.
2016-10-14 14:19:53 -04:00
Eugene Yokota 81284081e2 Use non-deprecated constructor 2016-10-14 14:15:05 -04:00
Eugene Yokota 6ad545efea Move deprecation warnings to macro body
Ref #2783
2016-10-14 14:12:37 -04:00
Eugene Yokota f1055c79df Remove unused match 2016-10-13 18:15:54 -04:00
Eugene Yokota 4e09e9ef68 Refactoring per review 2016-10-13 18:12:40 -04:00
Eugene Yokota 6f3bbed47e Safer template resolver
Fixes #2761

With sbt 0.13.13-RC1 rediscovered that the dependency pulled in from
Giter8 was affecting the plugins. To avoid this, this change splits up
the template resolver implementation to another module called
sbt-giter8-resolver, and it will be downloaded using Ivy into
`~/.sbt/0.13/templates/`, and then launched reflectively using Java as
the interface.
2016-10-12 20:06:10 -04:00
Eugene Yokota 272ada1e74
Improve `show` when key returns a `Seq`
This changes the output to:

```
> show externalDependencyClasspath
[info] Updating {file:/xxx/hello/}root...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] *
Attributed(/Users/xxx/.sbt/boot/scala-2.11.8/lib/scala-library.jar)
[info] *
Attributed(/Users/xxx/.ivy2/cache/commons-io/commons-io/jars/commons-io-
2.4.jar)
```
2016-09-27 14:23:53 +01:00
Dale Wijnand 06cdefebb9 Replace var/set with withClassLoaderCache 2016-09-26 19:32:11 +10:00
Jason Zaugg 5005abfef2 SD-232 Recycle classloaders to be anti-hostile to JIT.
The compiler interface subclasses `scala.tools.nsc.Global`,
and loading this new subclass before each `compile` task forces
HotSpot JIT to deoptimize larges swathes of compiled code. It's
a bit like SBT has rigged the dice to always descend the longest
ladder in a game of Snakes and Ladders.

The slowdown seems to be larger with Scala 2.12. There are a number
of variables at play, but I think the main factor here is that
we now rely on JIT to devirtualize calls to final methods in traits
whereas we used to emit static calls. JIT does a good job at this,
so long as classloading doesn't undo that good work.

This commit extends the existing `ClassLoaderCache` to encompass
the classloader that includes the compiler interface JAR. I've
resorted to adding a var to `AnalyzingCompiler` to inject the
dependency to get the cache to the spot I need it without binary
incompatible changes to the intervening method signatures.
2016-09-26 14:49:47 +10:00
Dale Wijnand 86670caf37 Add back addPluginResolvers (#2749)
See https://github.com/sbt/sbt/pull/2715/files#r79729382
2016-09-22 13:35:03 +01:00
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