Skip to main content
Version: 2.17.x

scala-infer


Options controlling which dependencies will be inferred for Scala targets.

Backend: pants.backend.experimental.scala

Config section: [scala-infer]

Basic options

imports

--[no-]scala-infer-imports
PANTS_SCALA_INFER_IMPORTS
default: True

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

consumed_types

--[no-]scala-infer-consumed-types
PANTS_SCALA_INFER_CONSUMED_TYPES
default: True

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

package_objects

--[no-]scala-infer-package-objects
PANTS_SCALA_INFER_PACKAGE_OBJECTS
default: True

Add dependency on the package object to every target.

force_add_siblings_as_dependencies

--[no-]scala-infer-force-add-siblings-as-dependencies
PANTS_SCALA_INFER_FORCE_ADD_SIBLINGS_AS_DEPENDENCIES
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.

Advanced options

None

Deprecated options

None