@@ -29,19 +29,24 @@ object ApidocPlugin extends AutoPlugin {
29
29
object autoImport extends ApidocKeys
30
30
import autoImport ._
31
31
32
- val version = ParadoxPlugin .readProperty(" akka-paradox.properties" , " akka.paradox.version" )
33
-
34
- override def requires : Plugins = ParadoxPlugin
35
-
32
+ override def requires : Plugins = ParadoxPlugin
36
33
override def trigger : PluginTrigger = AllRequirements
37
34
38
- override def projectSettings : Seq [Setting [_]] = apidocSettings( Compile )
35
+ override def projectSettings : Seq [Setting [_]] = apidocParadoxZeroSettings
39
36
40
- def apidocParadoxGlobalSettings : Seq [Setting [_]] = Seq (
37
+ def apidocParadoxZeroSettings : Seq [Setting [_]] = Seq (
41
38
apidocRootPackage := " scala" ,
39
+ apidocClasses := Def .taskDyn {
40
+ val classpathProjects = apidocProjects.? .value
41
+ .map(inProjects)
42
+ .getOrElse {
43
+ inAggregates(LocalRootProject , includeRoot = true )
44
+ }
45
+ val filter = ScopeFilter (classpathProjects, inConfigurations(Compile ))
46
+ fullClasspath.all(filter).map(_.flatMap(_.files).map(_.toURI.toURL))
47
+ }.value,
42
48
paradoxDirectives ++= Def .taskDyn {
43
- val classpath = (fullClasspath in Compile ).value.files.map(_.toURI.toURL).toArray
44
- val classLoader = new java.net.URLClassLoader (classpath, this .getClass.getClassLoader)
49
+ val classLoader = new java.net.URLClassLoader (apidocClasses.value.toArray, this .getClass.getClassLoader)
45
50
val scanner = new ClassGraph ()
46
51
.whitelistPackages(apidocRootPackage.value)
47
52
.addClassLoader(classLoader)
@@ -56,11 +61,4 @@ object ApidocPlugin extends AutoPlugin {
56
61
}
57
62
}.value
58
63
)
59
-
60
- def apidocSettings (config : Configuration ): Seq [Setting [_]] =
61
- apidocParadoxGlobalSettings ++ inConfig(config)(
62
- Seq (
63
- // scoped settings here
64
- )
65
- )
66
64
}
0 commit comments