diff --git a/po/summary/getting-started/plugin-basics.ja.po b/po/summary/getting-started/plugin-basics.ja.po new file mode 100644 index 000000000..6c12b50f4 --- /dev/null +++ b/po/summary/getting-started/plugin-basics.ja.po @@ -0,0 +1,185 @@ +#: src/reference/guide/plugin-basics.md:12 +msgid "Plugin basics" +msgstr "" + +#: src/reference/guide/plugin-basics.md:22 +msgid "What is a plugin?" +msgstr "" + +#: src/reference/guide/plugin-basics.md:25 +msgid "" +"A plugin extends the build definition, most commonly by adding new settings " +"and tasks. For example, a plugin could add `githubWorkflowGenerate` task to " +"generate GitHub Actions YAML." +msgstr "" + +#: src/reference/guide/plugin-basics.md:33 +msgid "Finding the plugin versions using Scaladex" +msgstr "" + +#: src/reference/guide/plugin-basics.md:36 +msgid "" +"You can use [Scaladex](https://index.scala-lang.org/search?platform=sbt2) to " +"search for plugins, and find out the latest version of the plugin." +msgstr "" + +#: src/reference/guide/plugin-basics.md:38 +msgid "Declaring a plugin" +msgstr "" + +#: src/reference/guide/plugin-basics.md:41 +msgid "" +"If your project is in directory `hello`, and if you are adding sbt-github-" +"actions to the build definition, create `hello/project/plugins.sbt` and " +"declare the plugin dependency by passing the plugin's module ID to " +"`addSbtPlugin(...)`:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:48 +#: src/reference/guide/plugin-basics.md:56 +msgid "// In project/plugins.sbt" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"com.github.sbt\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"sbt-github-actions\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"0.28.0\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:53 +msgid "If you're adding sbt-assembly, add the following:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"com.eed3si9n\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"sbt-assembly\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"2.3.1\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:61 +msgid "" +"See [Source dependency plugin](../recipes/source-dependency-plugin.md) " +"recipe for an experimental technique of using plugins hosted on git repos." +msgstr "" + +#: src/reference/guide/plugin-basics.md:63 +msgid "" +"Plugins usually provide settings and tasks that get added to a subproject to " +"enable the plugin's functionality. This is described in the next section." +msgstr "" + +#: src/reference/guide/plugin-basics.md:66 +msgid "Enabling and disabling auto plugins" +msgstr "" + +#: src/reference/guide/plugin-basics.md:69 +msgid "" +"A plugin can declare that its settings be automatically added to the build " +"definition, in which case you don't have to do anything to add them." +msgstr "" + +#: src/reference/guide/plugin-basics.md:72 +msgid "" +"The auto plugins feature enables plugins to " +"automatically, and safely, ensure their settings and dependencies are on a " +"project. Many auto plugins should have their default settings automatically." +msgstr "" + +#: src/reference/guide/plugin-basics.md:77 +msgid "" +"If you're using an auto plugin that requires explicit enablement, then you " +"have to add the following to your `build.sbt`:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:81 +#: src/reference/guide/plugin-basics.md:96 +msgid "\"util\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:84 +#: src/reference/guide/plugin-basics.md:100 +msgid "\"hello-util\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:88 +msgid "" +"The `enablePlugins` method allows projects to explicitly define the auto " +"plugins they wish to consume." +msgstr "" + +#: src/reference/guide/plugin-basics.md:91 +msgid "" +"Projects can also exclude plugins using the `disablePlugins` method. For " +"example, if we wish to remove the `IvyPlugin` settings from `util`, we " +"modify our `build.sbt` as follows:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:104 +msgid "" +"Auto plugins should document whether they need to be explicitly enabled. If " +"you're curious which auto plugins are enabled for a given project, just run " +"the `plugins` command on the sbt console." +msgstr "" + +#: src/reference/guide/plugin-basics.md:108 +msgid "For example:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:126 +msgid "" +"Here, the `plugins` output is showing that the sbt default plugins are all " +"enabled. sbt's default settings are provided via 7 plugins:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:129 +msgid "`CorePlugin`: Provides the core parallelism controls for tasks." +msgstr "" + +#: src/reference/guide/plugin-basics.md:130 +msgid "`DependencyTreePlugin`: Provides dependency tree tasks." +msgstr "" + +#: src/reference/guide/plugin-basics.md:131 +msgid "`Giter8TemplatePlugin`: Provides `sbt new` support." +msgstr "" + +#: src/reference/guide/plugin-basics.md:132 +msgid "`IvyPlugin`: Provides the mechanisms to publish/resolve modules." +msgstr "" + +#: src/reference/guide/plugin-basics.md:133 +msgid "`JUnitXmlReportPlugin`: Provides support for generating junit-xml." +msgstr "" + +#: src/reference/guide/plugin-basics.md:134 +msgid "" +"`JvmPlugin`: Provides the mechanisms to compile/test/run/package Java/Scala " +"projects." +msgstr "" + +#: src/reference/guide/plugin-basics.md:136 +msgid "`SemanticdbPlugin`: Provides support for generating SemanticDB." +msgstr "" + +#: src/reference/guide/plugin-basics.md:154 +msgid "Available plugins" +msgstr "" + +#: src/reference/guide/plugin-basics.md:157 +msgid "" +"In addition to [Scaladex](https://index.scala-lang.org/search?" +"platform=sbt2), there's also [a list of available plugins](../community-" +"plugins.md)." +msgstr "" diff --git a/po/summary/getting-started/plugin-basics.zh-cn.po b/po/summary/getting-started/plugin-basics.zh-cn.po new file mode 100644 index 000000000..6c12b50f4 --- /dev/null +++ b/po/summary/getting-started/plugin-basics.zh-cn.po @@ -0,0 +1,185 @@ +#: src/reference/guide/plugin-basics.md:12 +msgid "Plugin basics" +msgstr "" + +#: src/reference/guide/plugin-basics.md:22 +msgid "What is a plugin?" +msgstr "" + +#: src/reference/guide/plugin-basics.md:25 +msgid "" +"A plugin extends the build definition, most commonly by adding new settings " +"and tasks. For example, a plugin could add `githubWorkflowGenerate` task to " +"generate GitHub Actions YAML." +msgstr "" + +#: src/reference/guide/plugin-basics.md:33 +msgid "Finding the plugin versions using Scaladex" +msgstr "" + +#: src/reference/guide/plugin-basics.md:36 +msgid "" +"You can use [Scaladex](https://index.scala-lang.org/search?platform=sbt2) to " +"search for plugins, and find out the latest version of the plugin." +msgstr "" + +#: src/reference/guide/plugin-basics.md:38 +msgid "Declaring a plugin" +msgstr "" + +#: src/reference/guide/plugin-basics.md:41 +msgid "" +"If your project is in directory `hello`, and if you are adding sbt-github-" +"actions to the build definition, create `hello/project/plugins.sbt` and " +"declare the plugin dependency by passing the plugin's module ID to " +"`addSbtPlugin(...)`:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:48 +#: src/reference/guide/plugin-basics.md:56 +msgid "// In project/plugins.sbt" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"com.github.sbt\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"sbt-github-actions\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:50 +msgid "\"0.28.0\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:53 +msgid "If you're adding sbt-assembly, add the following:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"com.eed3si9n\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"sbt-assembly\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:58 +msgid "\"2.3.1\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:61 +msgid "" +"See [Source dependency plugin](../recipes/source-dependency-plugin.md) " +"recipe for an experimental technique of using plugins hosted on git repos." +msgstr "" + +#: src/reference/guide/plugin-basics.md:63 +msgid "" +"Plugins usually provide settings and tasks that get added to a subproject to " +"enable the plugin's functionality. This is described in the next section." +msgstr "" + +#: src/reference/guide/plugin-basics.md:66 +msgid "Enabling and disabling auto plugins" +msgstr "" + +#: src/reference/guide/plugin-basics.md:69 +msgid "" +"A plugin can declare that its settings be automatically added to the build " +"definition, in which case you don't have to do anything to add them." +msgstr "" + +#: src/reference/guide/plugin-basics.md:72 +msgid "" +"The auto plugins feature enables plugins to " +"automatically, and safely, ensure their settings and dependencies are on a " +"project. Many auto plugins should have their default settings automatically." +msgstr "" + +#: src/reference/guide/plugin-basics.md:77 +msgid "" +"If you're using an auto plugin that requires explicit enablement, then you " +"have to add the following to your `build.sbt`:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:81 +#: src/reference/guide/plugin-basics.md:96 +msgid "\"util\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:84 +#: src/reference/guide/plugin-basics.md:100 +msgid "\"hello-util\"" +msgstr "" + +#: src/reference/guide/plugin-basics.md:88 +msgid "" +"The `enablePlugins` method allows projects to explicitly define the auto " +"plugins they wish to consume." +msgstr "" + +#: src/reference/guide/plugin-basics.md:91 +msgid "" +"Projects can also exclude plugins using the `disablePlugins` method. For " +"example, if we wish to remove the `IvyPlugin` settings from `util`, we " +"modify our `build.sbt` as follows:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:104 +msgid "" +"Auto plugins should document whether they need to be explicitly enabled. If " +"you're curious which auto plugins are enabled for a given project, just run " +"the `plugins` command on the sbt console." +msgstr "" + +#: src/reference/guide/plugin-basics.md:108 +msgid "For example:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:126 +msgid "" +"Here, the `plugins` output is showing that the sbt default plugins are all " +"enabled. sbt's default settings are provided via 7 plugins:" +msgstr "" + +#: src/reference/guide/plugin-basics.md:129 +msgid "`CorePlugin`: Provides the core parallelism controls for tasks." +msgstr "" + +#: src/reference/guide/plugin-basics.md:130 +msgid "`DependencyTreePlugin`: Provides dependency tree tasks." +msgstr "" + +#: src/reference/guide/plugin-basics.md:131 +msgid "`Giter8TemplatePlugin`: Provides `sbt new` support." +msgstr "" + +#: src/reference/guide/plugin-basics.md:132 +msgid "`IvyPlugin`: Provides the mechanisms to publish/resolve modules." +msgstr "" + +#: src/reference/guide/plugin-basics.md:133 +msgid "`JUnitXmlReportPlugin`: Provides support for generating junit-xml." +msgstr "" + +#: src/reference/guide/plugin-basics.md:134 +msgid "" +"`JvmPlugin`: Provides the mechanisms to compile/test/run/package Java/Scala " +"projects." +msgstr "" + +#: src/reference/guide/plugin-basics.md:136 +msgid "`SemanticdbPlugin`: Provides support for generating SemanticDB." +msgstr "" + +#: src/reference/guide/plugin-basics.md:154 +msgid "Available plugins" +msgstr "" + +#: src/reference/guide/plugin-basics.md:157 +msgid "" +"In addition to [Scaladex](https://index.scala-lang.org/search?" +"platform=sbt2), there's also [a list of available plugins](../community-" +"plugins.md)." +msgstr "" diff --git a/po/summary/recipes/source-dependency-plugin.ja.po b/po/summary/recipes/source-dependency-plugin.ja.po new file mode 100644 index 000000000..b14242101 --- /dev/null +++ b/po/summary/recipes/source-dependency-plugin.ja.po @@ -0,0 +1,53 @@ +#: src/reference/recipes/source-dependency-plugin.md:1 +msgid "Source dependency plugin" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:10 +msgid "Objective" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:13 +msgid "" +"I want to use a plugin hosted on a git repository, without publishing to the " +"Central Repo." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:15 +msgid "Steps" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:18 +msgid "Host an sbt 2.x plugin on a git repository, built using sbt 2.x." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:19 +msgid "Add the following to `project/plugins.sbt`:" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:21 +msgid "// In project/plugins.sbt" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:23 +msgid "" +"\"https://github.com/eed3si9n/sbt-" +"jmh.git#303c3e98e1d1523e6a4f99abe09c900165028edb\"" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:24 +msgid "\"plugin\"" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:27 +msgid "" +"When you start sbt, it will automatically clone the repository under " +"`$HOME/.sbt/2/staging/`." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:29 +msgid "" +"In the above, `https://github.com/eed3si9n/sbt-jmh.git` is the HTTP endpoint " +"for a plugin hosted on GitHub, and " +"`303c3e98e1d1523e6a4f99abe09c900165028edb` is a commit id on the default " +"branch." +msgstr "" diff --git a/po/summary/recipes/source-dependency-plugin.zh-cn.po b/po/summary/recipes/source-dependency-plugin.zh-cn.po new file mode 100644 index 000000000..b14242101 --- /dev/null +++ b/po/summary/recipes/source-dependency-plugin.zh-cn.po @@ -0,0 +1,53 @@ +#: src/reference/recipes/source-dependency-plugin.md:1 +msgid "Source dependency plugin" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:10 +msgid "Objective" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:13 +msgid "" +"I want to use a plugin hosted on a git repository, without publishing to the " +"Central Repo." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:15 +msgid "Steps" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:18 +msgid "Host an sbt 2.x plugin on a git repository, built using sbt 2.x." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:19 +msgid "Add the following to `project/plugins.sbt`:" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:21 +msgid "// In project/plugins.sbt" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:23 +msgid "" +"\"https://github.com/eed3si9n/sbt-" +"jmh.git#303c3e98e1d1523e6a4f99abe09c900165028edb\"" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:24 +msgid "\"plugin\"" +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:27 +msgid "" +"When you start sbt, it will automatically clone the repository under " +"`$HOME/.sbt/2/staging/`." +msgstr "" + +#: src/reference/recipes/source-dependency-plugin.md:29 +msgid "" +"In the above, `https://github.com/eed3si9n/sbt-jmh.git` is the HTTP endpoint " +"for a plugin hosted on GitHub, and " +"`303c3e98e1d1523e6a4f99abe09c900165028edb` is a commit id on the default " +"branch." +msgstr "" diff --git a/po/summary/summary.ja.po b/po/summary/summary.ja.po index fe39f6cbb..60d925972 100644 --- a/po/summary/summary.ja.po +++ b/po/summary/summary.ja.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: The Book of sbt\n" -"POT-Creation-Date: 2025-09-14T16:10:04-04:00\n" +"POT-Creation-Date: 2025-09-24T00:36:39-04:00\n" "PO-Revision-Date: 2025-08-08 04:04-0400\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -61,138 +61,142 @@ msgid "Multi project basics" msgstr "" #: src/reference/SUMMARY.md:15 -msgid "Build layout" +msgid "Plugin basics" msgstr "" #: src/reference/SUMMARY.md:16 -msgid "sbt with IDEs" +msgid "Build layout" msgstr "" #: src/reference/SUMMARY.md:17 +msgid "sbt with IDEs" +msgstr "" + +#: src/reference/SUMMARY.md:18 msgid "Changes" msgstr "変更点" -#: src/reference/SUMMARY.md:18 +#: src/reference/SUMMARY.md:19 msgid "sbt 2.0 changes" msgstr "sbt 2.0 の変更点" -#: src/reference/SUMMARY.md:19 +#: src/reference/SUMMARY.md:20 msgid "Migrating from sbt 1.x" msgstr "" -#: src/reference/SUMMARY.md:20 +#: src/reference/SUMMARY.md:21 msgid "Concepts" msgstr "" -#: src/reference/SUMMARY.md:21 +#: src/reference/SUMMARY.md:22 msgid "Command" msgstr "" -#: src/reference/SUMMARY.md:22 +#: src/reference/SUMMARY.md:23 msgid "Cross building" msgstr "" -#: src/reference/SUMMARY.md:23 +#: src/reference/SUMMARY.md:24 msgid "sbt query" msgstr "" -#: src/reference/SUMMARY.md:24 +#: src/reference/SUMMARY.md:25 msgid "Caching" msgstr "" -#: src/reference/SUMMARY.md:25 +#: src/reference/SUMMARY.md:26 msgid "Reference" msgstr "" -#: src/reference/SUMMARY.md:26 +#: src/reference/SUMMARY.md:27 msgid "sbt" msgstr "" -#: src/reference/SUMMARY.md:27 +#: src/reference/SUMMARY.md:28 msgid "sbt update" msgstr "" -#: src/reference/SUMMARY.md:28 +#: src/reference/SUMMARY.md:29 #, fuzzy msgid "sbt compile" msgstr "例題でみる sbt" -#: src/reference/SUMMARY.md:29 +#: src/reference/SUMMARY.md:30 msgid "sbt run" msgstr "" -#: src/reference/SUMMARY.md:30 +#: src/reference/SUMMARY.md:31 msgid "sbt test" msgstr "" -#: src/reference/SUMMARY.md:31 +#: src/reference/SUMMARY.md:32 msgid "sbt inspect" msgstr "" -#: src/reference/SUMMARY.md:32 +#: src/reference/SUMMARY.md:33 msgid "sbt publish" msgstr "" -#: src/reference/SUMMARY.md:33 +#: src/reference/SUMMARY.md:34 msgid "Watch command" msgstr "" -#: src/reference/SUMMARY.md:34 +#: src/reference/SUMMARY.md:35 msgid "Cached task" msgstr "" -#: src/reference/SUMMARY.md:35 +#: src/reference/SUMMARY.md:36 msgid "Cross building setup" msgstr "" -#: src/reference/SUMMARY.md:36 +#: src/reference/SUMMARY.md:37 msgid "Remote cache setup" msgstr "" -#: src/reference/SUMMARY.md:37 +#: src/reference/SUMMARY.md:38 msgid "Artifact" msgstr "" -#: src/reference/SUMMARY.md:38 +#: src/reference/SUMMARY.md:39 msgid "Input task" msgstr "" -#: src/reference/SUMMARY.md:39 +#: src/reference/SUMMARY.md:40 msgid "Tab-completion parser" msgstr "" -#: src/reference/SUMMARY.md:40 +#: src/reference/SUMMARY.md:41 msgid "Community plugins" msgstr "" -#: src/reference/SUMMARY.md:41 +#: src/reference/SUMMARY.md:42 msgid "Recipes" msgstr "" -#: src/reference/SUMMARY.md:42 +#: src/reference/SUMMARY.md:43 msgid "Write hello world" msgstr "" -#: src/reference/SUMMARY.md:43 +#: src/reference/SUMMARY.md:44 msgid "Publishing to the Central Repo" msgstr "" -#: src/reference/SUMMARY.md:44 +#: src/reference/SUMMARY.md:45 msgid "Use sbt as Metals build server" msgstr "" -#: src/reference/SUMMARY.md:45 +#: src/reference/SUMMARY.md:46 msgid "Import to IntelliJ IDEA" msgstr "" -#: src/reference/SUMMARY.md:46 -msgid "Use Neovim" +#: src/reference/SUMMARY.md:47 +msgid "Source dependency plugin" msgstr "" -#: src/reference/SUMMARY.md:47 +#: src/reference/SUMMARY.md:48 msgid "Appendix: Glossary" msgstr "" -#: src/reference/SUMMARY.md:48 +#: src/reference/SUMMARY.md:49 msgid "Appendix: Setup notes" msgstr "" diff --git a/po/summary/summary.zh-cn.po b/po/summary/summary.zh-cn.po index 3ddb1df7b..0f56faf00 100644 --- a/po/summary/summary.zh-cn.po +++ b/po/summary/summary.zh-cn.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: The Book of sbt\n" -"POT-Creation-Date: 2025-09-14T16:14:32-04:00\n" +"POT-Creation-Date: 2025-09-24T00:36:34-04:00\n" "PO-Revision-Date: 2025-08-08 01:48-0400\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -61,138 +61,142 @@ msgid "Multi project basics" msgstr "" #: src/reference/SUMMARY.md:15 -msgid "Build layout" +msgid "Plugin basics" msgstr "" #: src/reference/SUMMARY.md:16 -msgid "sbt with IDEs" +msgid "Build layout" msgstr "" #: src/reference/SUMMARY.md:17 -msgid "Changes" +msgid "sbt with IDEs" msgstr "" #: src/reference/SUMMARY.md:18 -msgid "sbt 2.0 changes" +msgid "Changes" msgstr "" #: src/reference/SUMMARY.md:19 -msgid "Migrating from sbt 1.x" +msgid "sbt 2.0 changes" msgstr "" #: src/reference/SUMMARY.md:20 -msgid "Concepts" +msgid "Migrating from sbt 1.x" msgstr "" #: src/reference/SUMMARY.md:21 -msgid "Command" +msgid "Concepts" msgstr "" #: src/reference/SUMMARY.md:22 -msgid "Cross building" +msgid "Command" msgstr "" #: src/reference/SUMMARY.md:23 -msgid "sbt query" +msgid "Cross building" msgstr "" #: src/reference/SUMMARY.md:24 -msgid "Caching" +msgid "sbt query" msgstr "" #: src/reference/SUMMARY.md:25 -msgid "Reference" +msgid "Caching" msgstr "" #: src/reference/SUMMARY.md:26 -msgid "sbt" +msgid "Reference" msgstr "" #: src/reference/SUMMARY.md:27 -msgid "sbt update" +msgid "sbt" msgstr "" #: src/reference/SUMMARY.md:28 +msgid "sbt update" +msgstr "" + +#: src/reference/SUMMARY.md:29 #, fuzzy msgid "sbt compile" msgstr "sbt 示例教程" -#: src/reference/SUMMARY.md:29 +#: src/reference/SUMMARY.md:30 msgid "sbt run" msgstr "" -#: src/reference/SUMMARY.md:30 +#: src/reference/SUMMARY.md:31 msgid "sbt test" msgstr "" -#: src/reference/SUMMARY.md:31 +#: src/reference/SUMMARY.md:32 msgid "sbt inspect" msgstr "" -#: src/reference/SUMMARY.md:32 +#: src/reference/SUMMARY.md:33 msgid "sbt publish" msgstr "" -#: src/reference/SUMMARY.md:33 +#: src/reference/SUMMARY.md:34 msgid "Watch command" msgstr "" -#: src/reference/SUMMARY.md:34 +#: src/reference/SUMMARY.md:35 msgid "Cached task" msgstr "" -#: src/reference/SUMMARY.md:35 +#: src/reference/SUMMARY.md:36 msgid "Cross building setup" msgstr "" -#: src/reference/SUMMARY.md:36 +#: src/reference/SUMMARY.md:37 msgid "Remote cache setup" msgstr "" -#: src/reference/SUMMARY.md:37 +#: src/reference/SUMMARY.md:38 msgid "Artifact" msgstr "" -#: src/reference/SUMMARY.md:38 +#: src/reference/SUMMARY.md:39 msgid "Input task" msgstr "" -#: src/reference/SUMMARY.md:39 +#: src/reference/SUMMARY.md:40 msgid "Tab-completion parser" msgstr "" -#: src/reference/SUMMARY.md:40 +#: src/reference/SUMMARY.md:41 msgid "Community plugins" msgstr "" -#: src/reference/SUMMARY.md:41 +#: src/reference/SUMMARY.md:42 msgid "Recipes" msgstr "" -#: src/reference/SUMMARY.md:42 +#: src/reference/SUMMARY.md:43 msgid "Write hello world" msgstr "" -#: src/reference/SUMMARY.md:43 +#: src/reference/SUMMARY.md:44 msgid "Publishing to the Central Repo" msgstr "" -#: src/reference/SUMMARY.md:44 +#: src/reference/SUMMARY.md:45 msgid "Use sbt as Metals build server" msgstr "" -#: src/reference/SUMMARY.md:45 +#: src/reference/SUMMARY.md:46 msgid "Import to IntelliJ IDEA" msgstr "" -#: src/reference/SUMMARY.md:46 -msgid "Use Neovim" +#: src/reference/SUMMARY.md:47 +msgid "Source dependency plugin" msgstr "" -#: src/reference/SUMMARY.md:47 +#: src/reference/SUMMARY.md:48 msgid "Appendix: Glossary" msgstr "" -#: src/reference/SUMMARY.md:48 +#: src/reference/SUMMARY.md:49 msgid "Appendix: Setup notes" msgstr "" diff --git a/src/reference/SUMMARY.md b/src/reference/SUMMARY.md index 757471133..1518aa105 100644 --- a/src/reference/SUMMARY.md +++ b/src/reference/SUMMARY.md @@ -12,6 +12,7 @@ - [Build definition basics](guide/build-definition-basics.md) - [Library dependency basics](guide/library-dependency-basics.md) - [Multi project basics](guide/multi-project-basics.md) + - [Plugin basics](guide/plugin-basics.md) - [Build layout](guide/build-layout.md) - [sbt with IDEs](guide/IDE.md) - [Changes](changes/index.md) @@ -43,6 +44,6 @@ - [Publishing to the Central Repo](recipes/central.md) - [Use sbt as Metals build server](recipes/use-sbt-as-metals-build-server.md) - [Import to IntelliJ IDEA](recipes/import-to-intellij.md) - - [Use Neovim](recipes/use-neovim.md) + - [Source dependency plugin](recipes/source-dependency-plugin.md) - [Appendix: Glossary](appendix/glossary.md) - [Appendix: Setup notes](appendix/setup-notes.md) diff --git a/src/reference/guide/10-Using-Plugins.md b/src/reference/guide/plugin-basics.md similarity index 51% rename from src/reference/guide/10-Using-Plugins.md rename to src/reference/guide/plugin-basics.md index f9fc69926..63710825f 100644 --- a/src/reference/guide/10-Using-Plugins.md +++ b/src/reference/guide/plugin-basics.md @@ -1,68 +1,78 @@ ---- -out: Using-Plugins.html ---- [Basic-Def]: Basic-Def.html [Library-Dependencies]: Library-Dependencies.html [Multi-Project]: Multi-Project.html [global-vs-local-plugins]: ../docs/Best-Practices.html#global-vs-local-plugins - [Community-Plugins]: ../docs/Community-Plugins.html + [Community-Plugins]: ../community-plugins.md [Plugins]: ../docs/Plugins.html [Plugins-Best-Practices]: ../docs/Plugins-Best-Practices.html [Task-Graph]: Task-Graph.html + [Scaladex]: https://index.scala-lang.org/search?platform=sbt2 -Using plugins -------------- +Plugin basics +============= + -### What is a plugin? -A plugin extends the build definition, most commonly by adding new -settings. The new settings could be new tasks. For example, a plugin -could add a `codeCoverage` task which would generate a test coverage -report. +What is a plugin? +----------------- -### Declaring a plugin +A plugin extends the build definition, most commonly by adding new settings and tasks. +For example, a plugin could add `githubWorkflowGenerate` task to generate GitHub Actions YAML. -If your project is in directory `hello`, and you're adding -sbt-site plugin to the build definition, create `hello/project/site.sbt` -and declare the plugin dependency by passing the plugin's Ivy module ID -to `addSbtPlugin`: + -```scala -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.0") -``` +Finding the plugin versions using Scaladex +------------------------------------------ + +You can use [Scaladex][Scaladex] to search for plugins, and find out the latest version of the plugin. -If you're adding sbt-assembly, create `hello/project/assembly.sbt` with the following: +Declaring a plugin +------------------ + +If your project is in directory `hello`, and +if you are adding sbt-github-actions to the build definition, +create `hello/project/plugins.sbt` +and declare the plugin dependency by passing the plugin's module ID +to `addSbtPlugin(...)`: ```scala -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") +// In project/plugins.sbt + +addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.28.0") ``` -Not every plugin is located on one of the default repositories and a -plugin's documentation may instruct you to also add the repository where -it can be found: +If you're adding sbt-assembly, add the following: ```scala -resolvers ++= Resolver.sonatypeOssRepos("public") +// In project/plugins.sbt + +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1") ``` -Plugins usually provide settings that get added to a project to enable +See [Source dependency plugin](../recipes/source-dependency-plugin.md) recipe for an experimental technique of using plugins hosted on git repos. + +Plugins usually provide settings and tasks that get added to a subproject to enable the plugin's functionality. This is described in the next section. -### Enabling and disabling auto plugins +Enabling and disabling auto plugins +----------------------------------- A plugin can declare that its settings be automatically added to the build definition, in which case you don't have to do anything to add them. -As of sbt 0.13.5, there is a new -[auto plugins][Plugins] feature that enables +The auto plugins feature enables plugins to automatically, and safely, ensure their settings and dependencies are on a project. Many auto plugins should have their default -settings automatically, however some may require explicit enablement. +settings automatically. If you're using an auto plugin that requires explicit enablement, then you have to add the following to your `build.sbt`: @@ -97,52 +107,35 @@ curious which auto plugins are enabled for a given project, just run the For example: -``` -> plugins -In file:/home/jsuereth/projects/sbt/test-ivy-issues/ - sbt.plugins.IvyPlugin: enabled in scala-sbt-org - sbt.plugins.JvmPlugin: enabled in scala-sbt-org - sbt.plugins.CorePlugin: enabled in scala-sbt-org - sbt.plugins.JUnitXmlReportPlugin: enabled in scala-sbt-org +```scala +sbt:hello> plugins +In build /tmp/hello/: + Enabled plugins in hello: + sbt.plugins.CorePlugin + sbt.plugins.DependencyTreePlugin + sbt.plugins.Giter8TemplatePlugin + sbt.plugins.IvyPlugin + sbt.plugins.JUnitXmlReportPlugin + sbt.plugins.JvmPlugin + sbt.plugins.SemanticdbPlugin +Plugins that are loaded to the build but not enabled in any subprojects: + sbt.ScriptedPlugin + sbt.plugins.SbtPlugin ``` Here, the `plugins` output is showing that the sbt default plugins are all -enabled. sbt's default settings are provided via three plugins: +enabled. sbt's default settings are provided via 7 plugins: 1. `CorePlugin`: Provides the core parallelism controls for tasks. -2. `IvyPlugin`: Provides the mechanisms to publish/resolve modules. -3. `JvmPlugin`: Provides the mechanisms to compile/test/run/package +2. `DependencyTreePlugin`: Provides dependency tree tasks. +3. `Giter8TemplatePlugin`: Provides `sbt new` support. +4. `IvyPlugin`: Provides the mechanisms to publish/resolve modules. +5. `JUnitXmlReportPlugin`: Provides support for generating junit-xml. +6. `JvmPlugin`: Provides the mechanisms to compile/test/run/package Java/Scala projects. +7. `SemanticdbPlugin`: Provides support for generating SemanticDB. -In addition, `JUnitXmlReportPlugin` provides an experimental support for -generating junit-xml. - -Older non-auto plugins often require settings to be added explicitly, so -that [multi-project build][Multi-Project] could have different types of -projects. The plugin documentation will indicate how to configure it, -but typically for older plugins this involves adding the base settings -for the plugin and customizing as necessary. - -For example, for the sbt-site plugin, create `site.sbt` with the following content - -```scala -site.settings -``` - -to enable it for that project. - -If the build defines multiple projects, instead add it directly to the -project: - -```scala -// don't use the site plugin for the `util` project -lazy val util = (project in file("util")) - -// enable the site plugin for the `core` project -lazy val core = (project in file("core")) - .settings(site.settings) -``` - + -### Available Plugins - -There's [a list of available plugins][Community-Plugins]. - -Some especially popular plugins are: +Available plugins +----------------- -- those for IDEs (to import an sbt project into your IDE) -- those supporting web frameworks, such as - [xsbt-web-plugin](https://github.com/earldouglas/xsbt-web-plugin). +In addition to [Scaladex][Scaladex], there's +also [a list of available plugins][Community-Plugins]. + diff --git a/src/reference/recipes/source-dependency-plugin.md b/src/reference/recipes/source-dependency-plugin.md new file mode 100644 index 000000000..ac3c9b78a --- /dev/null +++ b/src/reference/recipes/source-dependency-plugin.md @@ -0,0 +1,29 @@ +Source dependency plugin +======================== + +~~~admonish note +The recipe section of the documentation focuses on the objectives +with minimal explanations. +~~~ + + +Objective +--------- + +I want to use a plugin hosted on a git repository, without publishing to the Central Repo. + +Steps +----- + +1. Host an sbt 2.x plugin on a git repository, built using sbt 2.x. +2. Add the following to `project/plugins.sbt`: + ```scala + // In project/plugins.sbt + lazy val jmhRef = ProjectRef( + uri("https://github.com/eed3si9n/sbt-jmh.git#303c3e98e1d1523e6a4f99abe09c900165028edb"), + "plugin") + BareBuildSyntax.dependsOn(jmhRef) + ``` +3. When you start sbt, it will automatically clone the repository under `$HOME/.sbt/2/staging/`. + +In the above, `https://github.com/eed3si9n/sbt-jmh.git` is the HTTP endpoint for a plugin hosted on GitHub, and `303c3e98e1d1523e6a4f99abe09c900165028edb` is a commit id on the default branch.