HomeDocs
DocsCommunityTestimonialsUsersGitHubTwitterBlogJobsTermsPrivacyCookies
TermsPrivacyCookies
Hey! These docs are for version 2.14, which is no longer officially supported. Click here for the latest version, 2.17!


Options controlling which dependencies will be inferred for Scala targets.

Backend: <span style="color: purple"><code>pants.backend.experimental.scala</code></span> Config section: <span style="color: purple"><code>[scala-infer]</code></span>

## Basic options

<div style="color: purple">

### `imports`

<code>--[no-]scala-infer-imports</code><br> <code>PANTS_SCALA_INFER_IMPORTS</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>True</code></span>

<br>

Infer a target's dependencies by parsing import statements from sources.

</div> <br>

<div style="color: purple">

### `consumed_types`

<code>--[no-]scala-infer-consumed-types</code><br> <code>PANTS_SCALA_INFER_CONSUMED_TYPES</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>True</code></span>

<br>

Infer a target's dependencies by parsing consumed types from sources.

</div> <br>

<div style="color: purple">

### `package_objects`

<code>--[no-]scala-infer-package-objects</code><br> <code>PANTS_SCALA_INFER_PACKAGE_OBJECTS</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>True</code></span>

<br>

Add dependency on the package object to every target.

</div> <br>

<div style="color: purple">

### `force_add_siblings_as_dependencies`

<code>--[no-]scala-infer-force-add-siblings-as-dependencies</code><br> <code>PANTS_SCALA_INFER_FORCE_ADD_SIBLINGS_AS_DEPENDENCIES</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

If true, add a dependency on all scala_source targets generated by the same scala_sources target generator. If false, the dependencies will only be added if [scala-infer].imports is also set to false.

Setting this option to true reduces the precision of dependency information. That means that you may end up compiling more than is necessary for a particular task, and that compilation will be invalidated more frequently than actually necessary. However, setting to true may be helpful if compilation fails due to missing dependencies.

</div> <br>

## Advanced options

None

## Deprecated options

None