-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Dokkatoo into Dokka Gradle Plugin (#3695)
Initial Dokkatoo import - merge DGP-classic into dokka-gradle-plugin - add flag to toggle between DPG-classic and Dokkatoo - Update Dokkatoo code to be Java-8 compatible - update dokkatoo package name - stop using `org.jetbrains.dokka.gradle.utils.sourceLink_` - weird class-not-found compilation issue - update TaskPathCollector workaround - fix LogHtmlPublicationLinkTask - use Http instead of Https connection - Specify language/api as Kotlin 1.4 for dokka-gradle-plugin (to be compatible with Gradle 7) - update api dump - update formatting, add copyright header - remove duplicated 'Isolation' from WorkerIsolation subtypes, & fix test - renaming 'Dokkatoo' to 'Dokka'... - fix process isolation worker jvm args - add 'min supported Gradle' warning - lazily fetch DokkaGradlePluginMode from `project.extra.properties` - fixing KotlinNativeDistributionAccessor... - fix DGP group/version - add copyright header - Change BCV to official BCV - fix `toLowerCase()` deprecation - remove `dokka-gradle-plugin` from `libs.versions.toml` (it's no longer used) - remove duplicated plugin website/vcsUrl, move tags into specific Dokka plugin - exclude Gradle's embedded-dependencies from DGP - remove extraneous leftover groups
- Loading branch information
Showing
160 changed files
with
10,473 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
build-logic/src/main/kotlin/dokkabuild/tasks/GenerateDokkaGradlePluginConstants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package dokkabuild.tasks | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.file.FileSystemOperations | ||
import org.gradle.api.provider.MapProperty | ||
import org.gradle.api.tasks.CacheableTask | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import javax.inject.Inject | ||
|
||
@CacheableTask | ||
abstract class GenerateDokkaGradlePluginConstants @Inject constructor( | ||
private val fs: FileSystemOperations | ||
) : DefaultTask() { | ||
|
||
@get:OutputDirectory | ||
abstract val destinationDir: DirectoryProperty | ||
|
||
@get:Input | ||
abstract val properties: MapProperty<String, String> | ||
|
||
init { | ||
group = project.name | ||
} | ||
|
||
@TaskAction | ||
fun action() { | ||
val properties = properties.get() | ||
|
||
// prepare temp dir | ||
fs.delete { delete(temporaryDir) } | ||
|
||
// generate file | ||
val vals = properties.entries | ||
.sortedBy { it.key } | ||
.joinToString("\n") { (k, v) -> | ||
"""const val $k = "$v"""" | ||
}.prependIndent(" ") | ||
|
||
temporaryDir.resolve("DokkaConstants.kt").apply { | ||
parentFile.mkdirs() | ||
writeText( | ||
""" | ||
|/* | ||
| * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
| */ | ||
|package org.jetbrains.dokka.gradle.internal | ||
| | ||
|@DokkaInternalApi | ||
|object DokkaConstants { | ||
|$vals | ||
|} | ||
| | ||
""".trimMargin() | ||
) | ||
} | ||
|
||
// sync file to output dir | ||
fs.sync { | ||
from(temporaryDir) { | ||
into("org/jetbrains/dokka/gradle/internal/") | ||
} | ||
into(destinationDir) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.