sbt, the interactive build tool
Go to file
Martin Duhem da0fa5388e
Support annotated definitions in build.sbt
Previously, sbt would fail to load build.sbt files when they included
annotated definitions because the parser would not correctly recognize
those definitions as such. In sbt 1.x, this used to be fine, because
there was little use for annotations in build.sbt.

Starting with sbt 2, whether caching should be enabled for a task key
can be controlled via annotations on the task key definition. Because
these can appear in build.sbt, support for annotations in build.sbt
becomes more important.

This patch enhances parsing of build.sbt by keeping the parsed trees
around so that the AST can be used to determine whether a given line
represents a setting or a definition, rather than relying on string
matching.
2025-08-11 10:33:22 +02:00
.github refactor: Unify to dependency-tree 2025-08-10 00:37:16 -04:00
buildfile/src Support annotated definitions in build.sbt 2025-08-11 10:33:22 +02:00
client Bye jansi 2024-11-07 22:07:07 -08:00
core-macros/src Default to cached task 2025-06-21 08:54:51 +09:00
internal Worker 2025-06-30 02:44:36 -04:00
launch Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
launcher-package Merge branch '1.10.x' into wip/merge-1.10.x 2025-05-12 03:30:51 -04:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
lm-core bport: Handle partialVersion("2") 2025-08-10 19:50:18 -04:00
lm-coursier fix: Change URL usage to URI 2025-08-10 18:32:04 -04:00
lm-ivy/src refactor: Hide Ivy-related classes 2025-08-09 01:52:45 -04:00
main fix: Fixes reload 2025-08-10 04:58:53 -04:00
main-actions/src Update test 2025-08-09 13:58:35 -04:00
main-command/src Remove deprecated methods 2025-05-11 05:23:41 -04:00
main-settings/src Remove IntegrationTest 2025-08-03 19:50:33 -04:00
notes Spelling (#8028) 2025-02-04 01:11:28 -05:00
project Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-09 13:47:36 -04:00
protocol/src/main Remove IntegrationTest 2025-08-03 19:50:33 -04:00
run Reimplement test agent as a worker command 2025-07-04 01:28:56 -04:00
sbt-app/src Support annotated definitions in build.sbt 2025-08-11 10:33:22 +02:00
sbt-remote-cache/src/main/scala/sbt remove unnecessary `case` 2025-02-22 08:48:29 +09:00
scripted-sbt remove unnecessary `case` 2025-02-22 08:48:29 +09:00
scripts Fix lm-coursier scripted 2024-10-11 14:30:55 +02:00
server-test/src Scala 3.7.2 2025-07-30 09:55:46 +09:00
src/main/conscript sbt 1.3.0 2019-09-04 01:24:08 -04:00
tasks remove unnecessary `case` 2025-02-22 08:48:29 +09:00
tasks-standard Remove deprecated methods 2025-05-11 05:23:41 -04:00
testing refactor: Change the test type 2025-08-02 18:12:20 -04:00
util-cache Default to cached task 2025-06-21 08:54:51 +09:00
util-collection Remove unused code 2025-08-03 16:03:00 -04:00
util-tracking Remove deprecated methods 2025-05-11 05:23:41 -04:00
worker/src Reimplement test agent as a worker command 2025-07-04 01:28:56 -04:00
zinc-lm-integration/src refactor: Hide Ivy-related classes 2025-08-09 01:52:45 -04:00
.git-blame-ignore-revs Add .git-blame-ignore-revs 2024-10-09 13:38:02 +02:00
.gitattributes Fix line endings in msi 2021-11-19 20:41:39 -05:00
.gitignore Fix server completion tests 2024-03-19 17:06:09 +01:00
.gitmodules Move metadata to lm-coursier/metadata 2024-10-09 09:44:42 +02:00
.jvmopts Add .jvmopts 2023-11-25 01:06:30 -05:00
.mailmap Add mailmap 2019-06-11 09:30:14 +02:00
.sbtopts Restore .sbtopts file 2020-11-19 12:42:26 -08:00
.scala-steward.conf Pin slf4j-api 2023-01-02 22:06:46 -05:00
.scalafmt.conf update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
CONTRIBUTING.md Minor updates on development guide 2023-10-21 21:00:31 -04:00
DEVELOPING.md Spelling (#8028) 2025-02-04 01:11:28 -05:00
LICENSE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
PROFILING.md Spelling (#8028) 2025-02-04 01:11:28 -05:00
README.md Merge remote-tracking branch 'lm/wip/sbt-2.x' into 2.x-lm-coursier 2024-10-09 08:50:03 +02:00
SUPPORT.md Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
build.sbt refactor: Unify to dependency-tree 2025-08-10 00:37:16 -04:00
reset.sh 1.0.3-SNAPSHOT 2017-09-16 15:52:58 -04:00
sbt Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-09 13:47:36 -04:00
sbt-allsources.sh Merge remote-tracking branch 'lm/wip/sbt-2.x' into 2.x-lm-coursier 2024-10-09 08:50:03 +02:00
sbt.sh Implement sbt-launch.jar download 2021-04-19 23:43:15 -04:00
server.md setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00

README.md

CI Latest version Discord

sbt

sbt is a build tool for Scala, Java, and more.

For general documentation, see https://www.scala-sbt.org/.

sbt 1.x

This is the 1.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.

  • sbt/io hosts sbt.io module.
  • sbt/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implements the build tool.
  • Setup: Describes getting started with the latest binary release.
  • FAQ: Explains how to get help and more.
  • sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions

Issues and Pull Requests

Please read CONTRIBUTING carefully before opening a GitHub Issue.

The short version: try searching or asking on StackOverflow.

license

See LICENSE.