Commit Graph

375 Commits

Author SHA1 Message Date
Eugene Yokota 6ac4571197 Adds "reboot dev"
This adds a new option `dev` to the `reboot` command, which deletes the only the current sbt artifacts from the boot directory. `reboot dev` reads actively from `build.properties` instead of using the current state since `reboot` can restart into another sbt version.

In general, `reboot dev` is intended for the local development of sbt.

Fixes #3590
2017-10-25 03:19:10 -04:00
PanAeon 27a30a933a fix sbt help new does not explain how to use sbt new 2017-10-24 19:08:56 +01:00
Dale Wijnand 78c5ee92d3
Track sources in base directory non-recursively
Using a recursive Source meant that ~ looked into target. If you have
any source generators and use ~ with anything the invokes them, like
~compile, that means that the act of generating sources triggers ~ to
re-execute compile (perhaps only on macOS where the NIO WatchService
just polls, after an initial delay).

Requires sbt/io#78

Fixes #3501
2017-10-24 11:09:00 +01:00
Eugene Yokota ae860d5a7d Bump to Scala 2.12.4
Uses Scala 2.12.4 for the build definition. This includes fix for runtime reflection of empty package members under Java 9.

Fixes sbt/sbt#3587
2017-10-20 00:23:29 -05:00
PanAeon 64241e0d3a Fixes #3464. Escape imports from sbt files, so if user creates a backquoted definition then task evalution will not fail. 2017-10-13 11:04:15 +01:00
eugene yokota 8c04b267bf Merge branch '1.x' into 1.0.x 2017-10-10 10:57:05 -04:00
Michael Stringer b9a4d32916 Add system property to revert to old polling fs watcher
This adds a sbt.watch.mode system property that if set to 'polling' will
use PollingWatchService instead of WatchServiceAdapter (nio).

On macOS this will default to 'polling' and on all others 'nio'.

This is a temporary workaround for users affected by #3527
2017-10-10 01:17:42 -04:00
Michael Stringer a3c34c6c0a
Add system property to revert to old polling fs watcher
This adds a sbt.watch.mode system property that if set to 'polling' will
use PollingWatchService instead of WatchServiceAdapter (nio).

On macOS this will default to 'polling' and on all others 'nio'.

This is a temporary workaround for users affected by #3527
2017-10-09 18:01:33 +01:00
Dale Wijnand 530c405b2f
Implement Project#withId 2017-10-04 13:54:37 +01:00
Dale Wijnand 21bd7c3a91 Merge pull request #3434 from eed3si9n/wip/slash
Unify sbt shell and build.sbt syntax (unified slash syntax redux)
2017-09-28 09:26:25 +01:00
Eugene Yokota 33a01f3ceb Unified slash syntax
Fixes sbt/sbt#1812

This adds unified slash syntax for both sbt shell and the build.sbt DSL.
Instead of the current `<project-id>/config:intask::key`,
this adds `<project-id>/<config-ident>/intask/key` where <config-ident> is the Scala identifier notation for the configurations like `Compile` and `Test`.

This also adds a series of implicits called `SlashSyntax` that adds `/` operators to project refererences, configuration, and keys such that the same syntax works in build.sbt.

These examples work for both from the shell and in build.sbt.

    Global / cancelable
    ThisBuild / scalaVersion
    Test / test
    root / Compile / compile / scalacOptions
    ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/scalacOptions
    Zero / Zero / name

The inspect command now outputs something that can be copy-pasted:

    > inspect compile
    [info] Task: sbt.inc.Analysis
    [info] Description:
    [info] 	Compiles sources.
    [info] Provided by:
    [info] 	ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/compile
    [info] Defined at:
    [info] 	(sbt.Defaults) Defaults.scala:326
    [info] Dependencies:
    [info] 	Compile/manipulateBytecode
    [info] 	Compile/incCompileSetup
    [info] Reverse dependencies:
    [info] 	Compile/printWarnings
    [info] 	Compile/products
    [info] 	Compile/discoveredSbtPlugins
    [info] 	Compile/discoveredMainClasses
    [info] Delegates:
    [info] 	Compile/compile
    [info] 	compile
    [info] 	ThisBuild/Compile/compile
    [info] 	ThisBuild/compile
    [info] 	Zero/Compile/compile
    [info] 	Global/compile
    [info] Related:
    [info] 	Test/compile
2017-09-28 01:01:43 -04:00
Alexey Alekhin 5384114185 Merge branch '1.x' into patch-1 2017-09-26 21:30:04 +02:00
Alexey Alekhin e99aa6d7b3 Added release note for the `version` new default 2017-09-26 01:22:44 +02:00
Jonas Fonseca 3a666705a6 Add release note 2017-09-25 14:08:41 -04:00
Eugene Yokota 15ecc9845a contributors 2017-09-16 20:32:33 -04:00
Eugene Yokota f21d190a65 `sbt.server.autostart` flag and startServer
Adds JVM flag `sbt.server.autostart` to enable/disable the automatic starting of sbt server with the sbt shell.

This also adds a new command `startServer` to manually start the server.
2017-09-16 03:24:30 -04:00
Eugene Yokota 8dbb00f3b1 notes 2017-09-16 02:37:30 -04:00
eugene yokota caf2fa2cb8 Merge pull request #3523 from guillaumebort/1.0.x
Sbt server could miss some messages
2017-09-15 23:31:13 -04:00
Dale Wijnand 71ae211841
Redefine crossScalaVersions, because it's Def.derive..
Fixes #3495
2017-09-15 16:59:47 +01:00
Guillaume Bort b355aa66e4 Sbt server could miss some messages
If the read buffer contains more that 2 messages, we need to consume them all before blocking on socket read again. For that we have to loop until the buffer does not contain anymore the message delimiter character.

Same problem in the client ServerConnection code.
2017-09-13 13:18:38 +02:00
Eugene Yokota 01e8f609e8 lm 1.0.1 2017-09-10 14:13:51 -04:00
Eugene Yokota 2a014781d6 Mention #3481 2017-08-28 13:23:53 -04:00
Eugene Yokota dd58299472 Fix typo 2017-08-28 12:01:47 -04:00
Eugene Yokota 6c6abc3ae6 1.0.1 notes 2017-08-28 11:54:59 -04:00
eugene yokota ddaa091dec Merge pull request #3442 from dwijnand/sbt-plugin-cross-version
[fport] Fix addSbtPlugin to use the correct version of sbt
2017-08-23 18:37:23 -04:00
Will Sargent 533365d8a4 "dreprecations" 2017-08-15 13:56:35 -07:00
Dale Wijnand a5afc21bf0
Fix addSbtPlugin to use the correct version of sbt
Fixes #3393
2017-08-15 12:13:28 +01:00
Eugene Yokota b4f7312171 Cleans up notes 2017-08-12 01:49:49 -04:00
Eugene Yokota dcff4dd5eb notes 2017-07-28 19:41:19 -04:00
Eugene Yokota 79394da920 notes 2017-07-17 01:00:57 -04:00
Eugene Yokota 2f8d7c2f7a Fixes tests/scala-instance-classloader 2017-07-16 17:50:23 -04:00
Eugene Yokota c279995cdd Fixes source-dependencies / transitive-memberRef 2017-07-16 17:38:58 -04:00
Eugene Yokota cc090344d9 Fixes project/auto-plugins 2017-07-16 17:22:33 -04:00
Eugene Yokota d8929ae135 Fixes dependency-management/pom-advanced 2017-07-16 15:33:35 -04:00
Eugene Yokota 6107242c24 Fixes compiler-project/semantic-errors 2017-07-16 14:43:31 -04:00
Eugene Yokota e1dc83cf08 Fixes compiler-project/macro-config 2017-07-16 14:31:58 -04:00
Eugene Yokota 12ae6e66ff Fixes compiler-project/error-in-invalidated 2017-07-16 14:16:08 -04:00
Eugene Yokota fa67110143 Fixes compiler-project/separate-analysis-per-scala 2017-07-16 14:12:45 -04:00
Eugene Yokota a7bb39d3cb notes 2017-07-16 14:07:59 -04:00
Eugene Yokota 99be5b25f4 Roll back Vector changes in Keys.scala
Keys should Seq type since it's fairly common to use List in build.sbt, and it would cause annoying build changes.
Fixes actions/cross
2017-07-16 13:58:51 -04:00
Eugene Yokota b4e4a48208 Fixes actions/external-doc 2017-07-16 10:19:42 -04:00
Dale Wijnand 0fe0de5fb3
Move the tuple enrichments into sbt.TupleSyntax
This undeprecates the syntax, but at the same times moves it out of
implicit scope, therefore requiring a 'import TupleSyntax._' to opt-in
to the old syntax.
2017-06-27 12:42:46 +01:00
Eugene Yokota f81598c6e9 Fixes test content logger dropping out, or displaying twice
Fixes #3117
2017-06-20 03:04:53 -04:00
Eugene Yokota 94ec0af21a notes change 2017-06-13 18:36:50 -04:00
Dale Wijnand 50ed5ee8fe Link Johannes 2017-05-31 17:48:48 +02:00
Eugene Yokota adb92f6bd9 sbt 1.0.0-M6 notes 2017-05-31 03:56:00 -04:00
eugene yokota d631d7e918 Merge pull request #3224 from eed3si9n/fport/3155
[fport] ScalaTest nested suites reported in JUnit XML reports as  "(It is not a test)"
2017-05-30 10:37:42 -04:00
eugene yokota 9fc9304638 Merge pull request #3223 from eed3si9n/fport/3153
[fport] Remove the "hit [ENTER] to switch to interactive mode" feature
2017-05-27 01:12:15 -04:00
eugene yokota 4d3b910a19 Merge pull request #3221 from eed3si9n/fport/3133
[fport] Port sbt-cross-building's ^ and ^^ commands
2017-05-27 01:12:00 -04:00
James Koch fe72a6e11d Issue #3154 - ScalaTest nested suites reported in JUnit XML reports as "(It is not a test)". 2017-05-27 00:18:40 -04:00
Eugene Yokota 0e979b4a3a Port sbt-cross-building's ^ and ^^ commands
This ports sbt-cross-building's cross (`^`) and switch (`^^`) commands.
Instead of making it a plugin, the default settings are now changed
to use `sbtVersion in pluginCrossBuild` for the sbt dependency.
2017-05-27 00:15:03 -04:00
Dale Wijnand e4be5f4a09 Remove the "hit [ENTER] to switch to interactive mode" feature
In sbt 0.13.15, in addition to notifying the user about the existence of
sbt's shell, a feature was added to allow the user to switch to sbt's
shell - a more pro-active approach to just displaying a message.

Unfortunately sbt is often unintentionally invoked in shell scripts in
"interactive mode" when no interaction is expected by, for exmaple,
invoking `sbt package` instead of `sbt package < /dev/null`. In that
case hitting [ENTER] would silently trigger sbt to run its shell,
easily wrecking the script. In addition to that I was unhappy with the
implementation as it created a tight coupling between sbt's command
processing abstraction to sbt's shell command.

If you want to stay in sbt's shell after running a task like `package`
then invoke sbt like so:

    sbt package shell

Fixes #3091
2017-05-26 21:42:41 -04:00
Dale Wijnand b54c0ff059 Notify users about shell only if compile is present
This is a change in strategy.

The motivation is the need to find a good balance between:

  + informing the uninformed that would benefit from this information, &
  + not spamming the already informed

Making it dependent on "compile" being present in remainingCommands will
probably make it trigger for, for example, Maven users who are used to
running "mvn compile" and always run "sbt compile", and who therefore
are unneccesarily suffering terribly slow compile speeds by starting up
the jvm and sbt every time.

Fixes #3091
Fixes #3097
2017-05-26 21:33:49 -04:00
Dale Wijnand 859b334a51
Better toError migration notes [ci skip] 2017-05-16 10:21:14 +01:00
Dale Wijnand 31f61948d6
Add a few more migration notes to 1.0.0 notes 2017-05-08 15:18:36 +01:00
Eugene Yokota ab5e875ce4 notes 2017-04-19 16:15:48 -04:00
Eugene Yokota c6e8cc2e04 Release note for sbt 1.0.0-M5
Ref #3063
2017-04-19 16:02:13 -04:00
eugene yokota 1f02e61819 Merge pull request #3077 from eed3si9n/fport/3008
[fport] Notify & enable users to stay in the warm shell
2017-04-04 20:33:05 -07:00
eugene yokota 43d0013bf7 Merge pull request #3075 from eed3si9n/fport/3025
[fport] Write sbt.version to project/build.properties
2017-04-04 18:21:11 -07:00
Dale Wijnand 1a2bfc546b 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-04-04 19:43:28 -04:00
Dale Wijnand a974ce7bb4 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-04-04 18:46:24 -04:00
Guillaume Martres 334517aba8 Fix #3013: ScriptedPlugin: Add support for paginated tests
This was already supported in the internal Scripted used by sbt but not
in the ScriptedPlugin. This is fixed by just copy-pasting the modified
parser. We will have to wait for sbt itself to be built using an sbt
with the upgraded ScriptedPlugin to be able to avoid the code duplication.
2017-04-04 17:05:17 -04:00
Guillaume Martres 2283c68031 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-04-04 14:49:32 -04:00
eugene yokota c6b593df95 Merge pull request #2990 from valydia/1.0.x
Add logging of the name(s) of build files
2017-03-09 14:46:19 -05:00
valydia 047a061812 Add logging of the name(s) of build files
Fixes #1911
2017-03-04 14:13:39 +00:00
ekrich b97d68a214 Fix #2551: scripted mode ignores quotation 2017-02-14 10:29:58 -05:00
Roman Iakovlev 982a7c8724 Add new SBT global setting asciiGraphWidth
This setting controls the maximum width of the ASCII graphs printed
by commands like `inspect tree`. Default value corresponds to the
previously hardcoded value of 40 characters.
2017-01-22 13:06:20 -05:00
Josh Soref 582c9cbcf7 spelling: undefined 2017-01-20 08:30:01 +00:00
Josh Soref b873338f25 spelling: disabled 2017-01-20 08:13:29 +00:00
Josh Soref 80583a35bb spelling: dependent 2017-01-20 08:13:17 +00:00
Josh Soref a8ce474fd6 spelling: dependencies 2017-01-20 08:13:00 +00:00
Josh Soref 701b57107f spelling: compatibility 2017-01-20 08:11:39 +00:00
Josh Soref f66acb8c0e spelling: abstraction 2017-01-20 08:06:55 +00:00
Eugene Yokota 569e19d03c 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.
2017-01-16 15:39:01 -05:00
Eugene Yokota 73a427c0b8 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/
2017-01-16 08:43:23 -05:00
eugene yokota 6493f336b9 Merge pull request #2917 from eed3si9n/fport/2730
[fport] Fail when the forked test harness fails
2017-01-15 21:01:01 -05:00
Eugene Yokota 3ec0734f6c Move release notes 2017-01-15 05:59:51 -05:00
Eugene Yokota beb1fe3c5a Fail when the forked test harness fails
Fail when the forked test harness fails using NonFatal
Fixes #2442/#2722

Add another fork-uncaught scripted test
Originally from https://github.com/retronym/sbt-test-fork-swallows-error
2017-01-15 05:49:07 -05:00
Anatoly Fayngelerin 6dc2cf4210 dependsOn can now be used inside a .sbt file for a subproject 2017-01-14 07:18:10 -05:00
Ashley Mercer f92a0ab8a5 JUnitXmlTestsListener now correctly flags ignored, skipped and pending tests
Fixes #2198 Ref #2854

Generated Junit-style XML reports now include a count of ignored,
skipped and pending tests; and individual tests are correctly flagged
with the <skipped/> element.
2016-12-01 10:45:13 +00:00
Dale Wijnand befb0925e3
Make publishTo & otherResolvers TaskKey's
Fixes #2059
2016-09-29 01:35:51 +01:00
Eugene Yokota 15c078ab0b Quieter ivyLoggingLevel for CI
`ivyLoggingLevel` is dropped to `UpdateLogging.Quiet` when Jenkins or
Travis is detected.
2016-09-15 22:57:07 -04:00
Eugene Yokota 357a146460 Silent startup for scalas
Fixes #840
2016-09-15 03:42:23 -04:00
kenji yoshida 0c086a7761 `aggregate` can now be used inside a .sbt file (#2683)
(cherry picked from commit b92e5773f7)
2016-07-27 23:35:16 +09:00
Eugene Yokota 8f29d3b724 Typo 2016-06-24 18:57:36 +02:00
James Roper e21c871d71 Replaced cross building support with sbt-doge 2016-05-17 09:49:16 +10:00
ekrich d383c2f306 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-13 12:01:14 -07:00
Eugene Yokota 74f8fe9c4f Notes 2016-05-12 19:25:24 -04:00
Eugene Yokota e1009ae729 Notes 2016-05-12 18:47:22 -04:00
Eugene Yokota 2e868fbc92 Typo fixes 2016-05-08 17:13:23 -04:00
Eugene Yokota 1d7872dad5 notes 2016-05-08 13:35:57 -04:00
Eugene Yokota ee272d780e Reorganize directory structure 2016-05-06 16:01:49 -04:00
Eugene Yokota 447e2f7f8c 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-05-01 02:57:03 -04:00
Eugene Yokota faf0683a7a 0.13.11 notes 2016-05-01 01:26:18 -04:00
Eugene Yokota 7f2ab136e5 Fixes #1616. Fixes the "latest snapshot" chain resolver
The "latest snapshot" chain resolver was assuming that there's at least
one artifact per module. I think that was the root cause of #1616.
2016-02-27 04:07:33 -05:00
Eugene Yokota 0fca1a9ff4 Fixes #1514. Enable latest SNAPSHOT option by default
to check all resolvers to find the latest snapshot artifacts.
This behavior did not work well with Maven repositories where sbt was
failing to calculate the correct publication dates.
Now that #2075 fixes the Maven integration issue we should enable this
flag back again.

The build user can opt out by:

    updateOptions := updateOptions.value.withLatestSnapshots(false)
2016-02-27 04:07:33 -05:00
Eugene Yokota c1760fdc3c Move intransitive warning to update. Ref #2127 2016-02-26 17:40:07 -05:00
eugene yokota bdded0898d Merge pull request #2393 from dwijnand/fport/make-sbt-dotty-aware
FPORT: Make sbt aware of Dotty
2016-02-26 17:29:27 -05:00
Eugene Yokota cd373c99ad Add useJCenter setting, which is set to false. Fixes #2217
Adds a new setting `useJCenter`, which is set to `false` by default.
When set to `true`, JCenter will be placed as the first external
resolver to find library dependencies.

The implementation of `externalResolvers` is changed to incorporate the
setting by calling `Resolver.reorganizeAppResolvers`. These changes
were required because `externalResolvers` uses whatever that's in the
launchconfig, which the build user may not upgrade.
2016-02-25 23:02:16 -05:00
Eugene Yokota 31e07492c7 Add JCenter change to 0.13.9's notes 2016-02-25 23:02:16 -05:00