@@ -46,16 +46,13 @@ abstract class JavaAdapter @Inject constructor(
4646
4747 val dokkaExtension = project.extensions.getByType<DokkaExtension >()
4848
49- // wait for the Java plugin to be applied
50- project.plugins.withType<JavaBasePlugin >().configureEach {
51- val java = project.extensions.getByType<JavaPluginExtension >()
52- val sourceSets = project.extensions.getByType<SourceSetContainer >()
49+ val java = project.extensions.getByType<JavaPluginExtension >()
50+ val sourceSets = project.extensions.getByType<SourceSetContainer >()
5351
54- detectJavaToolchainVersion(dokkaExtension, java)
52+ detectJavaToolchainVersion(dokkaExtension, java)
5553
56- val isConflictingPluginPresent = isConflictingPluginPresent(project)
57- registerDokkaSourceSets(dokkaExtension, sourceSets, isConflictingPluginPresent)
58- }
54+ val isConflictingPluginPresent = isConflictingPluginPresent(project)
55+ registerDokkaSourceSets(dokkaExtension, sourceSets, isConflictingPluginPresent)
5956 }
6057
6158 /* * Fetch the toolchain, and use the language version as Dokka's jdkVersion */
@@ -145,7 +142,10 @@ abstract class JavaAdapter @Inject constructor(
145142 && name.startsWith(MAIN_SOURCE_SET_NAME )
146143
147144 internal fun applyTo (project : Project ) {
148- project.pluginManager.apply (type = JavaAdapter ::class )
145+ // wait for the Java plugin to be applied
146+ project.plugins.withType<JavaBasePlugin >().all {
147+ project.pluginManager.apply (type = JavaAdapter ::class )
148+ }
149149 }
150150 }
151151}
0 commit comments