Skip to content

Commit eac21e8

Browse files
committed
dokka tasks improved.
1 parent 632f657 commit eac21e8

3 files changed

Lines changed: 38 additions & 19 deletions

File tree

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ kotlinx-io = "0.8.2"
2424
ktor = "3.3.3"
2525
mavenPublish = "0.35.0"
2626
mockito-android = "5.20.0"
27-
mockk = "1.14.6"
27+
mockk = "1.14.7"
2828
multipaz = "0.94.0" # 0.95.0
2929
nimbus-sdk = "11.30.1"
3030
play-services-identity-credentials = "16.0.0-alpha08"
3131
robolectric = "4.16"
32-
sonarqube = "7.1.0.6387"
32+
sonarqube = "7.2.0.6526"
3333
test-core = "1.7.0"
3434
test-rules = "1.7.0"
3535
test-runner = "1.7.0"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#Thu Sep 12 17:12:58 EEST 2024
1818
distributionBase=GRADLE_USER_HOME
19-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
19+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
2020
distributionPath=wrapper/dists
2121
zipStorePath=wrapper/dists
2222
zipStoreBase=GRADLE_USER_HOME

wallet-core/build.gradle.kts

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import com.android.build.gradle.internal.tasks.factory.dependsOn
1718
import com.github.jk1.license.filter.DependencyFilter
1819
import com.github.jk1.license.filter.ExcludeTransitiveDependenciesFilter
1920
import com.github.jk1.license.filter.LicenseBundleNormalizer
@@ -169,7 +170,6 @@ dependencies {
169170
}
170171

171172
// Dependency check
172-
173173
dependencyCheck {
174174
formats = listOf("XML", "HTML")
175175
nvd.apiKey = System.getenv("NVD_API_KEY") ?: properties["nvdApiKey"]?.toString() ?: ""
@@ -180,34 +180,53 @@ dependencyCheck {
180180
// Dokka generation
181181
dokka {
182182
dokkaSourceSets.configureEach {
183+
dokkaPublications.javadoc {
184+
outputDirectory.set(rootProject.file("docs/javadoc"))
185+
}
183186
dokkaPublications.html {
184-
outputDirectory.set(rootProject.file("docs"))
187+
outputDirectory.set(rootProject.file("docs/html"))
185188
}
186189
externalDocumentationLinks.register("android") {
187190
url("https://developer.android.com/reference")
188191
packageListUrl("https://developer.android.com/reference/kotlin/package-list")
189192
}
190-
externalDocumentationLinks.register("java") {
191-
url("https://docs.oracle.com/en/java/javase/17/docs/api/")
192-
packageListUrl("https://docs.oracle.com/en/java/javase/17/docs/api/allpackages-index.html")
193-
}
194193
}
195194
}
196195

197-
val dokkaHtmlJar by tasks.registering(Jar::class) {
198-
group = "documentation"
196+
val dokkaGenerateJavadocJar by tasks.registering(Jar::class) {
197+
group = "dokka"
198+
dependsOn(tasks.dokkaGeneratePublicationJavadoc)
199+
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
200+
archiveClassifier.set("javadoc")
201+
description = "Assembles a JAR containing the Javadoc-style documentation generated by Dokka."
202+
}
203+
204+
val dokkaGenerateHtmlJar by tasks.registering(Jar::class) {
205+
group = "dokka"
199206
dependsOn(tasks.dokkaGeneratePublicationHtml)
200207
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
201208
archiveClassifier.set("html-docs")
202209
description = "Assembles a JAR containing the HTML documentation generated by Dokka."
203210
}
204211

205-
val dokkaJavadocJar by tasks.registering(Jar::class) {
206-
group = "documentation"
207-
dependsOn(tasks.dokkaGeneratePublicationJavadoc)
208-
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
209-
archiveClassifier.set("javadoc")
210-
description = "Assembles a JAR containing the Javadoc-style documentation generated by Dokka."
212+
val dokkaCleanJavadoc by tasks.registering(Delete::class) {
213+
group = "dokka"
214+
delete = setOf(rootProject.file("docs/javadoc"))
215+
description = "It removes the documentation generated by Dokka."
216+
}
217+
218+
val dokkaCleanHtml by tasks.registering(Delete::class) {
219+
group = "dokka"
220+
delete = setOf(rootProject.file("docs/html"))
221+
description = "It removes the documentation generated by Dokka."
222+
}
223+
224+
tasks.dokkaGeneratePublicationJavadoc.dependsOn(dokkaCleanJavadoc)
225+
tasks.dokkaGeneratePublicationHtml.dependsOn(dokkaCleanHtml)
226+
227+
val dokkaClean by tasks.registering {
228+
group = "dokka"
229+
dependsOn(dokkaCleanJavadoc, dokkaCleanHtml)
211230
}
212231

213232
// Third-party licenses report
@@ -236,8 +255,8 @@ tasks.generateLicenseReport.configure {
236255
// Build documentation and license report
237256
tasks.register<Task>("buildDocumentation") {
238257
group = "documentation"
239-
dependsOn("dokkaGfm", "generateLicenseReport")
240-
description = "Aggregates all documentation tasks (Dokka GFM, License Report)."
258+
dependsOn("dokkaGenerate", "generateLicenseReport")
259+
description = "Aggregates all documentation tasks (Dokka, License Report)."
241260
}
242261
tasks.assemble.configure {
243262
finalizedBy("buildDocumentation")

0 commit comments

Comments
 (0)