@@ -15,6 +15,7 @@ import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
1515import org.gradle.jvm.tasks.Jar
1616import org.gradle.plugins.signing.SigningExtension
1717import org.gradle.util.GradleVersion
18+ import org.jetbrains.dokka.gradle.DokkaTask
1819import java.io.File
1920import java.net.URI
2021
@@ -72,7 +73,8 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
7273 project.extensions.configure(PublishingExtension ::class .java) {
7374 // Configure publication (what to publish)
7475 it.publications.withType(MavenPublication ::class .java).configureEach {
75- if (it.name != " pluginMaven" ) {
76+ if (it.name != " pluginMaven" ) {
77+ // TODO: [CACHE] Create variable. Push it outside lambda
7678 it.artifact(project.tasks.getByName(" javadocJar" ))
7779 }
7880
@@ -112,6 +114,7 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
112114 publication.onlyIf {
113115 // publish on sonatype only if the username is configured.
114116 (publication.name.startsWith(" sonatype" ) &&
117+ // TODO: [CACHE] Might need to do something about that.
115118 project.properties[" sonatype.username" ]?.toString()?.isNotBlank() == true ) ||
116119 ! publication.name.startsWith(" sonatype" )
117120 }
@@ -120,12 +123,21 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
120123 }
121124
122125 private fun configureDokka (project : Project ) {
126+ // TODO - [CACHE] Dokka doesn't support Configuration Cache yet
127+ // See: https://github.com/Kotlin/dokka/issues/2231
123128 project.apply { it.plugin(" org.jetbrains.dokka" ) }
124129 project.tasks.register(" javadocJar" , Jar ::class .java) {
125130 it.dependsOn(project.tasks.getByName(" dokkaHtml" ))
126131 it.archiveClassifier.set(" javadoc" )
127132 it.from(project.buildDir.resolve(" dokka" ))
128133 }
134+
135+ project.tasks.withType(DokkaTask ::class .java).whenTaskAdded { dokka ->
136+ dokka.notCompatibleWithConfigurationCache(
137+ " The dokka tasks are not compatible yet " +
138+ " with the configuration cache."
139+ )
140+ }
129141 }
130142
131143 private fun configureProjectRepository (project : Project ) {
@@ -145,6 +157,7 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
145157 project.apply { it.plugin(" org.jlleitschuh.gradle.ktlint" ) }
146158 }
147159
160+ // TODO: [CACHE] Don't pass project any more to the method
148161 private fun copy (project : Project , filename : String , target : File ) {
149162 val content = classLoader.getResourceAsStream(filename) ? : throw MiniGdxException .create(
150163 severity = Severity .GRAVE ,
@@ -169,6 +182,7 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
169182 it.group = " minigdx-dev"
170183 it.description = " Copy default Github workflows inside this project."
171184 it.doLast {
185+ // TODO: [CACHE] Move target outside lambda
172186 val target = it.project.projectDir.resolve(" .github/workflows" )
173187 if (! target.exists()) {
174188 it.project.mkdir(" .github/workflows" )
@@ -189,6 +203,7 @@ class MiniGdxDeveloperPlugin : Plugin<Project> {
189203 it.group = " minigdx-dev"
190204 it.description = " Copy default Makefile inside this project."
191205 it.doLast {
206+ // TODO: [CACHE] move target out of lambda
192207 val target = it.project.projectDir
193208 copy(project, " Makefile" , target)
194209 }
0 commit comments