There seems to be an issue with the discovery of auto plugins in an
inner nested class. The error you would get is:
[info] java.lang.ClassNotFoundException: sbttest.Imports.A$
[info] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[info] at java.security.AccessController.doPrivileged(Native Method)
[info] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[info] at java.lang.Class.forName0(Native Method)
[info] at java.lang.Class.forName(Class.java:249)
[info] at
sbt.internal.inc.ModuleUtilities$.getObject(ModuleUtilities.scala:16)
[info] at
sbt.internal.inc.ModuleUtilities$.getCheckedObject(ModuleUtilities.scala
:22)
[info] at
sbt.internal.inc.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(Modu
leUtilities.scala:25)
[info] at
sbt.internal.inc.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(Modu
leUtilities.scala:25)
[info] at scala.collection.immutable.Stream.map(Stream.scala:418)
[info] at
sbt.internal.inc.ModuleUtilities$.getCheckedObjects(ModuleUtilities.scal
a:25)
[info] at sbt.PluginDiscovery$.loadModules(PluginDiscovery.scala:138)
[info] at
sbt.PluginDiscovery$.binarySourceModules(PluginDiscovery.scala:132)
[info] at sbt.PluginDiscovery$.discover$1(PluginDiscovery.scala:36)
[info] at sbt.PluginDiscovery$.discoverAll(PluginDiscovery.scala:45)
[info] at sbt.internal.Load$.loadPlugins(Load.scala:856)
Adds `trackInternalDependencies` and `exportToInternal` settings. These
can be used to control whether to trigger compilation of a dependent
subprojects when you call `compile`. Both keys will take one of three
values: `TrackLevel.NoTracking`, `TrackLevel.TrackIfMissing`, and
`TrackLevel.TrackAlways`. By default they are both set to
`TrackLevel.TrackAlways`.
When `trackInternalDependencies` is set to `TrackLevel.TrackIfMissing`,
sbt will no longer try to compile internal (inter-project) dependencies
automatically, unless there are no `*.class` files (or JAR file when
`exportJars` is `true`) in the output directory. When the setting is
set to `TrackLevel.NoTracking`, the compilation of internal
dependencies will be skipped. Note that the classpath will still be
appended, and dependency graph will still show them as dependencies.
The motivation is to save the I/O overhead of checking for the changes
on a build with many subprojects during development. Here's how to set
all subprojects to `TrackIfMissing`.
lazy val root = (project in file(".")).
aggregate(....).
settings(
inThisBuild(Seq(
trackInternalDependencies := TrackLevel.TrackIfMissing,
exportJars := true
))
)
The `exportToInternal` setting allows the dependee subprojects to opt
out of the internal tracking, which might be useful if you want to
track most subprojects except for a few. The intersection of the
`trackInternalDependencies` and `exportToInternal` settings will be
used to determine the actual track level. Here's an example to opt-out
one project:
lazy val dontTrackMe = (project in file("dontTrackMe")).
settings(
exportToInternal := TrackLevel.NoTracking
)