Skip to main content
Version: 2.23 (prerelease)

scala-infer


Options controlling which dependencies will be inferred for Scala targets.

Backend: pants.backend.experimental.scala

Config section: [scala-infer]

Basic options

consumed_types

--[no-]scala-infer-consumed-types
PANTS_SCALA_INFER_CONSUMED_TYPES
pants.toml
[scala-infer]
consumed_types = <bool>
default: True

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

force_add_siblings_as_dependencies

--[no-]scala-infer-force-add-siblings-as-dependencies
PANTS_SCALA_INFER_FORCE_ADD_SIBLINGS_AS_DEPENDENCIES
pants.toml
[scala-infer]
force_add_siblings_as_dependencies = <bool>
default: False

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.

imports

--[no-]scala-infer-imports
PANTS_SCALA_INFER_IMPORTS
pants.toml
[scala-infer]
imports = <bool>
default: True

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

package_objects

--[no-]scala-infer-package-objects
PANTS_SCALA_INFER_PACKAGE_OBJECTS
pants.toml
[scala-infer]
package_objects = <bool>
default: True

Add dependency on the package object to every target.

Advanced options

None

Deprecated options

None

None