Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokka Gradle Plugin 2 #2839

Draft
wants to merge 174 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
174 commits
Select commit Hold shift click to select a range
da79426
rename DokkaPlugin file
aSemy Oct 11, 2022
3f77497
try setting up buildSrc convention plugins
aSemy Oct 11, 2022
907fd7a
apply kotlin-dsl plugin, update code to use idiomatic Gradle API (clo…
aSemy Oct 11, 2022
fa2d7e5
Merge branch 'fix/rename_dokkaplugin_file' into feat/apply_kotlin_dsl…
aSemy Oct 11, 2022
bd82041
move Gradle tasks into task package
aSemy Oct 11, 2022
b184405
remove the 'by' helper function
aSemy Oct 11, 2022
f16d5ae
use Gradle filesystem types on task properties. Move some task conven…
aSemy Oct 11, 2022
c83aa9b
Merge remote-tracking branch 'fork/aSemy/feat/apply_kotlin_dsl_plugin…
aSemy Oct 13, 2022
4de8616
replace reflection access with a Gradle BuildService that uses javaex…
aSemy Oct 13, 2022
9f1db10
Merge remote-tracking branch 'origin/master' into feat/apply_kotlin_d…
aSemy Oct 13, 2022
bb31a7f
Merge remote-tracking branch 'origin/master' into feat/move_tasks_int…
aSemy Oct 13, 2022
ac61520
add deprecated backwards compatibility for moved Dokka tasks
aSemy Oct 13, 2022
e47f1ec
Merge remote-tracking branch 'origin/master' into feat/remove_propert…
aSemy Oct 13, 2022
b05e81f
enable Gradle build cache by default
aSemy Oct 13, 2022
cd990de
add concurrency cancellation for test/build actions
aSemy Oct 13, 2022
f4f2fe8
rm accidentally committed GHA .m2 cache update
aSemy Oct 13, 2022
d02b88b
add caching of .m2 files in Maven action, by re-using gradle-build-ac…
aSemy Oct 13, 2022
79d88bf
try and fix 'Cannot fingerprint input property' issue
aSemy Oct 13, 2022
899632f
update API spec
aSemy Oct 13, 2022
e02001d
mark DokkaExecutorService as @Internal on task input
aSemy Oct 13, 2022
76df6b4
use usesService to register DokkaExecutorService
aSemy Oct 13, 2022
b591e34
finish creating buildSrc plugins
aSemy Oct 13, 2022
16657a2
Merge remote-tracking branch 'origin/master' into feat/buildsrc_conve…
aSemy Oct 13, 2022
a8abe34
create MavenProjectLocal helper
aSemy Oct 13, 2022
2dd31cf
dokka-gradle-plugin: warn on duplicate resources
aSemy Oct 13, 2022
58bc1c8
dokka-gradle-plugin: fix kotlin-dsl compatibility
aSemy Oct 13, 2022
89a504f
disable empty subproject :plugins:base:search-component
aSemy Oct 13, 2022
7a1a430
formatting
aSemy Oct 13, 2022
968a123
re-add dependencies that were in :dokka:plugins subproject {} block
aSemy Oct 13, 2022
63a7da4
re-add project(":integration-tests") dependency to integration-tests …
aSemy Oct 13, 2022
766af55
fix dokka-integration-test integrationTest configurations
aSemy Oct 13, 2022
770a27b
replace println with logger.lifecycle
aSemy Oct 18, 2022
ae0f4e1
update description for base plugin (else it provides a default descri…
aSemy Oct 18, 2022
bba37c7
rm commented out code
aSemy Oct 18, 2022
549c11c
update test code after applying kotlin-dsl plugin
aSemy Oct 18, 2022
9bfedff
tidy up gradle-plugin build.gradle.kts
aSemy Oct 18, 2022
54e68e3
add repositoriesMode
aSemy Oct 18, 2022
a1cfab1
move repositories to settings.gradle.kts
aSemy Oct 18, 2022
d2e05d0
Declare the Node.js & Yarn download repositories
aSemy Oct 18, 2022
572494c
[gradle plugin] revert applying kotlin-dsl plugin, do that in #2702
aSemy Oct 18, 2022
99bf10b
remove gradle/gradle-build-action in maven-only step
aSemy Oct 19, 2022
14719e7
Merge branch 'master' into feat/move_tasks_into_task_package
aSemy Oct 25, 2022
42b4978
replace DokkaExecutorService with Gradle Worker, for executing DokkaG…
aSemy Nov 4, 2022
f8be7b4
Merge remote-tracking branch 'origin/master' into feat/gradle_dokka_w…
aSemy Nov 4, 2022
ebdb4e7
Merge remote-tracking branch 'origin/master' into feat/apply_kotlin_d…
aSemy Nov 4, 2022
e96e87b
Merge branch 'master' into feat/gradle_dokka_worker_daemon
aSemy Nov 28, 2022
c829043
include plugins in worker classpath
aSemy Nov 28, 2022
0ff2edc
expose finalizeCoroutines as an option on Gradle tasks
aSemy Nov 28, 2022
fb08197
Merge branch 'feat/apply_kotlin_dsl_plugin' into feat/expose_finalize…
aSemy Nov 28, 2022
bdb6092
expose finalizeCoroutines as a Gradle Task option
aSemy Nov 28, 2022
99e4b54
Merge branch 'feat/expose_finalizeCoroutines_in_gradle' into feat/gra…
aSemy Nov 29, 2022
e2c8f61
set finalizeCoroutines=false in serialization/coroutines integration …
aSemy Nov 30, 2022
2af1dcd
--init -> --init-script
aSemy Nov 30, 2022
5751ca1
publish dokka plugin before integration tests
aSemy Nov 30, 2022
3f5b27e
try fixing plugin version
aSemy Nov 30, 2022
db21caf
try fixing plugin publishing
aSemy Nov 30, 2022
cba6b41
try fixing plugin publishing
aSemy Nov 30, 2022
e9cd257
try fixing plugin publishing for integration tests...
aSemy Nov 30, 2022
fa05900
try fixing plugin publishing for integration tests...
aSemy Nov 30, 2022
c7ee570
try fixing plugin publishing for integration tests...
aSemy Nov 30, 2022
6f7c9cd
try fixing plugin publishing for integration tests...
aSemy Nov 30, 2022
ff7d888
Merge branch 'feat/expose_finalizeCoroutines_in_gradle' into feat/gra…
aSemy Nov 30, 2022
6db86ca
update qodana
aSemy Nov 30, 2022
cb05319
update qodana
aSemy Nov 30, 2022
8ed35b1
Merge branch 'feat/expose_finalizeCoroutines_in_gradle' into feat/gra…
aSemy Nov 30, 2022
4c5e343
rm qodana code-finder (fails on pipeline: Unable to find image 'jetbr…
aSemy Nov 30, 2022
ccd7d94
rm qodana code-finder (fails on pipeline: Unable to find image 'jetbr…
aSemy Nov 30, 2022
ba73452
Merge branch 'feat/expose_finalizeCoroutines_in_gradle' into feat/gra…
aSemy Dec 1, 2022
fe386b7
Merge branch 'master' into feat/gradle_dokka_worker_daemon
aSemy Dec 13, 2022
14d7a6b
fix mistake during merge
aSemy Dec 13, 2022
8818b67
fix mistake during merge
aSemy Dec 13, 2022
e3c47c5
format gradle args
aSemy Dec 13, 2022
dbd6ebd
Merge branch 'master' into feat/expose_finalizeCoroutines_in_gradle
aSemy Dec 13, 2022
27a478d
Merge branch 'master' into feat/gradle_dokka_worker_daemon
aSemy Dec 15, 2022
744598d
Merge branch 'master' into feat/expose_finalizeCoroutines_in_gradle
aSemy Dec 15, 2022
4892e4b
Merge remote-tracking branch 'fork/aSemy/feat/gradle_dokka_worker_dae…
aSemy Jan 1, 2023
ae95fed
Merge branch 'master' into feat/buildsrc_convention_plugins
aSemy Jan 9, 2023
4f808b8
Merge remote-tracking branch 'origin/master' into feat/apply_kotlin_d…
aSemy Jan 28, 2023
616a093
Merge remote-tracking branch 'origin/master' into feat/buildsrc_conve…
aSemy Jan 28, 2023
3517a6e
Merge remote-tracking branch 'fork/aSemy/feat/apply_kotlin_dsl_plugin…
aSemy Jan 28, 2023
49db2ad
replaced subclasses with typealiases
aSemy Jan 28, 2023
c800ad0
Merge remote-tracking branch 'fork/aSemy/feat/move_tasks_into_task_pa…
aSemy Jan 28, 2023
6435f5a
Merge remote-tracking branch 'fork/aSemy/feat/apply_kotlin_dsl_plugin…
aSemy Jan 28, 2023
767843f
Merge remote-tracking branch 'fork/aSemy/feat/remove_property_by_sett…
aSemy Jan 28, 2023
d59f7ea
fix tests
aSemy Jan 29, 2023
675e167
formatting
aSemy Jan 29, 2023
27008e7
Merge remote-tracking branch 'origin/master' into feat/gha_concurrency
aSemy Jan 29, 2023
e49ece8
Merge remote-tracking branch 'origin/master' into feat/gradle_dokka_w…
aSemy Jan 29, 2023
7b29c6c
Merge branch 'feat/apply_kotlin_dsl_plugin' into feat/gradle_dokka_wo…
aSemy Jan 29, 2023
7362027
make cast() an expression body fn
aSemy Jan 29, 2023
a4172fc
minor fixes regarding naming/spellings
aSemy Jan 29, 2023
8273693
make cast() an expression body fn
aSemy Jan 29, 2023
01496ab
replace getSafe() with get()/orNull, safeProperty() with property(), …
aSemy Jan 29, 2023
1683ef8
update API dump
aSemy Jan 29, 2023
7cf2f39
maintain API compatibility for moduleName
aSemy Jan 29, 2023
24b4b98
Merge remote-tracking branch 'fork/aSemy/feat/apply_kotlin_dsl_plugin…
aSemy Jan 29, 2023
c5730de
Merge remote-tracking branch 'fork/aSemy/feat/expose_finalizeCoroutin…
aSemy Jan 29, 2023
b2687f8
Merge branch 'feat/buildsrc_convention_plugins' into feat/gradle-plug…
aSemy Jan 29, 2023
e8096ac
Merge branch 'feat/enable_gradle_build_cache' into feat/gradle-plugin-2
aSemy Jan 29, 2023
aee75cd
Merge branch 'feat/expose_finalizeCoroutines_in_gradle' into feat/gra…
aSemy Jan 29, 2023
9f021bf
Merge branch 'feat/gha_concurrency' into feat/gradle-plugin-2
aSemy Jan 29, 2023
cb56b03
Merge branch 'feat/gradle_dokka_worker_daemon' into feat/gradle-plugin-2
aSemy Jan 29, 2023
731dfbf
Merge branch 'feat/move_tasks_into_task_package' into feat/gradle-plu…
aSemy Jan 29, 2023
6a6c9a7
Merge branch 'feat/remove_property_by_setter' into feat/gradle-plugin-2
aSemy Jan 29, 2023
28deaee
Merge branch 'feat/update_gradle_utils_with_kotlin_dsl' into feat/gra…
aSemy Jan 29, 2023
49b22c7
rm commented out config
aSemy Jan 29, 2023
730dadf
Merge branch 'feat/use_gradle_filesystem_types' into feat/gradle-plug…
aSemy Jan 29, 2023
41809d8
re-import gradle-plugin-2
aSemy Jan 29, 2023
dad28f6
additional docs
aSemy Jan 29, 2023
9ea58d5
annotate tasks as Cacheable
aSemy Jan 29, 2023
68c47f2
implement unit and functional tests
aSemy Jan 29, 2023
67cd9e5
add functional tests for dokka configurations/variants
aSemy Jan 29, 2023
6ca6f23
refactor the TestKit utils
aSemy Jan 29, 2023
8afadc1
spell fix, add more util functions
aSemy Jan 29, 2023
adbf010
increase test logging
aSemy Jan 29, 2023
3bb0233
rm debug println()
aSemy Jan 29, 2023
7de0536
log the dokkaConfiguration in DokkaGenerateTask
aSemy Jan 29, 2023
b3a52e5
fix kdoc
aSemy Jan 29, 2023
323b78b
replace mapNotNull with filterIsInstance
aSemy Jan 29, 2023
8022456
fix plugins classpath
aSemy Jan 29, 2023
a2adc64
WIP multi-module test
aSemy Jan 29, 2023
182aecb
collapse package structure
aSemy Jan 29, 2023
55dc849
fix Gradle config
aSemy Jan 29, 2023
7649f67
register task outputs for maven tasks
aSemy Jan 29, 2023
a0f0544
rm empty ./runners/build.gradle.kts
aSemy Jan 29, 2023
6d4ce4d
update binary-compat validator, and refactor config
aSemy Jan 29, 2023
903a08f
move docs into task descriptions
aSemy Jan 29, 2023
1369a6a
use Kotest assertions, and fix Dokka Configurations test
aSemy Jan 30, 2023
397729e
try extending runtime from plugins, so transitives are included...
aSemy Jan 30, 2023
175bb4a
add a bit of docs, add more logging
aSemy Jan 30, 2023
21fb74f
fix subproject generation test, and start setting up aggregation test
aSemy Jan 30, 2023
45863bc
make module includes optional
aSemy Jan 30, 2023
657d1d8
* tidy up docs and config
aSemy Jan 31, 2023
3dc7788
add some docs, and do a wee little bit of refactoring
aSemy Jan 31, 2023
03297c5
api dump
aSemy Jan 31, 2023
30e8cdc
doc the sample projects dir
aSemy Jan 31, 2023
376e066
WIP: start adapting the Dokka Configuration DSL Builders from the cur…
aSemy Feb 1, 2023
63ad54e
WIP: start adapting the Dokka Configuration DSL Builders from the cur…
aSemy Feb 1, 2023
7fa25bf
Merge remote-tracking branch 'origin/master' into feat/gradle-plugin-2
aSemy Feb 2, 2023
89886ab
copying over more of the existing plugin's DSL...
aSemy Feb 3, 2023
d546c9e
laying groundwork for non-task based DSL
aSemy Feb 3, 2023
a25d871
setup buildSrc, experiment with plugin variants
aSemy Feb 3, 2023
02ddfde
create specialised plugin for configuring Dokka when a Kotlin plugin …
aSemy Feb 3, 2023
03f39c2
tweak build config (some stuff broke after Gradle 7.6)
aSemy Feb 3, 2023
eee20fd
updates for the new DSL, test Kotlin auto-config
aSemy Feb 3, 2023
fc524c1
tidy up DokkaKotlinAdapter
aSemy Feb 3, 2023
161e031
tidy up refactor of GradleTestKitUtils.kt
aSemy Feb 3, 2023
0104588
import the integration test projects
aSemy Feb 3, 2023
bd01066
refactor properties to be Gradle compliant
aSemy Feb 3, 2023
ab2b8d9
add integration test suite, move common test util to testFixtures
aSemy Feb 3, 2023
fb972a1
add adapters to help migrate from old plugin to the new
aSemy Feb 3, 2023
d8e7879
fix old plugin source code after a bad merge
aSemy Feb 3, 2023
064acfa
format & update config in it-basic
aSemy Feb 4, 2023
602fc9d
update logger to be threadsafe
aSemy Feb 4, 2023
4174098
use relative test maven dir
aSemy Feb 4, 2023
c1aaabd
replace kotlin.time.measureTime with manual measure (measureTime has …
aSemy Feb 4, 2023
dccac43
improve DokkaConfigs classes to be more Gradle compatible, and to raw…
aSemy Feb 4, 2023
d08d96e
refactor Gradle Configurations and Attributes so cross-project sharin…
aSemy Feb 4, 2023
e1e122b
remove raw json encode... it's supposed to be escaped
aSemy Feb 4, 2023
ba61ba1
tidy up refactoring, and fix HTML site styles :tada:
aSemy Feb 4, 2023
9dc205a
print config in current dokka plugin
aSemy Feb 5, 2023
7e37fb3
formatting
aSemy Feb 5, 2023
167d02b
setup configuration comparison testing
aSemy Feb 5, 2023
7a5b12e
use @LocalState for cache dirs
aSemy Feb 5, 2023
89386d6
make cacheDir optional, default to null
aSemy Feb 5, 2023
c7a46d8
update integration test to use JSON parsing and compare the actual Do…
aSemy Feb 5, 2023
0c5c1a0
(old plugin) make displayName optional
aSemy Feb 5, 2023
3b8bef9
refactor DokkaKotlinAdapter, and add some conventions for dokkaSource…
aSemy Feb 5, 2023
2cdda8f
fix kotlinSourceSet {} DSL adapter
aSemy Feb 5, 2023
2d3c95c
fix dokkaSourceSet filtering
aSemy Feb 5, 2023
64f4d45
fix DokkaConfigurations conventions
aSemy Feb 5, 2023
8e2c4de
rename DokkaPluginSettings to DokkaExtension
aSemy Feb 5, 2023
a8c146a
rm unnecessary vals
aSemy Feb 5, 2023
203050c
big ol' refactor to allow for multiple Dokka formats
aSemy Feb 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
big ol' refactor to allow for multiple Dokka formats
- create DokkaPublication to handle each Dokka output
- for each DokkaPublication, create format specific tasks/configurations/etc
- create specific plugins for each Dokka output format
- do a tonne of refactoring to get conventions working...
- add @nested to some task props
- group Gradle utils in a file
  • Loading branch information
aSemy committed Feb 6, 2023
commit 203050c2d10f369662fc31ac8a6b393b2c1e750b
18 changes: 18 additions & 0 deletions runners/gradle-plugin-2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@ plugins {
`java-test-fixtures`

`jvm-test-suite`
`test-report-aggregation`

idea

Expand Down Expand Up @@ -47,6 48,20 @@ gradlePlugin {
implementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin"
isAutomatedPublishing = true
}

fun registerDokkaPlugin(format: String, cls: String) {
plugins.create("dokka${format.capitalize()}Plugin") {
id = "org.jetbrains.dokka2.$format"
displayName = "Dokka plugin 2 - $format"
description = "Dokka, the Kotlin documentation tool"
implementationClass = "org.jetbrains.dokka.gradle.formats.$cls"
isAutomatedPublishing = true
}
}
registerDokkaPlugin("gfm", "DokkaGfmPublicationPlugin")
registerDokkaPlugin("html", "DokkaHtmlPublicationPlugin")
registerDokkaPlugin("javadoc", "DokkaJavadocPublicationPlugin")
registerDokkaPlugin("jekyll", "DokkaJekyllPublicationPlugin")
}

pluginBundle {
Expand Down Expand Up @@ -183,6 198,9 @@ testing.suites {


tasks.withType<Test>().configureEach {

mustRunAfter(tasks.withType<AbstractPublishToMaven>())

testLogging {
events = setOf(
TestLogEvent.STARTED,
Expand Down
60 changes: 26 additions & 34 deletions runners/gradle-plugin-2/src/main/kotlin/DokkaExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 2,51 @@ package org.jetbrains.dokka.gradle

import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Property
import org.jetbrains.dokka.gradle.dokka_configuration.DokkaModuleDescriptionGradleBuilder
import org.jetbrains.dokka.gradle.dokka_configuration.DokkaPublication
import org.jetbrains.dokka.gradle.dokka_configuration.DokkaSourceSetGradleBuilder
import javax.inject.Inject

/**
* Configure the behaviour of the [DokkaPlugin].
*/
abstract class DokkaExtension @Inject constructor(
private val objects: ObjectFactory
) {
abstract class DokkaExtension {

/** Default version used for Dokka dependencies */
abstract val dokkaVersion: Property<String>

/** Directory into which [DokkaPublication]s will be produced */
abstract val dokkaPublicationDirectory: DirectoryProperty

abstract val dokkaConfigurationsDirectory: DirectoryProperty

/** Default Dokka cache directory */
abstract val dokkaCacheDirectory: DirectoryProperty

// abstract val dokkaConfigurations: NamedDomainObjectContainer<DokkaConfigurationGradleBuilder>

abstract val moduleNameDefault: Property<String>
abstract val moduleVersionDefault: Property<String>

/**
* Dokka Source Sets describe the source code that should be included in a Dokka Publication.
*
* Dokka will not generate documentation at least there is at least one Dokka Source Set.
*
* Only source sets that are contained within _this project_ should be included here.
* To merge source sets from other projects, use the Gradle dependencies block.
* String used to discriminate between source sets that originate from different Gradle subprojects
*
* ```kotlin
* dependencies {
* // merge :other-project into this project's Dokka Configuration
* dokka(project(":other-project"))
* }
* ```
*
* Or, to include other Dokka Publications as a Module use
* Defaults to [the path of the subproject][org.gradle.api.Project.getPath].
*/
abstract val sourceSetScopeDefault: Property<String>

/**
* Configuration for creating Dokka Publications.
*
* ```kotlin
* dependencies {
* // include :other-project as a module in this project's Dokka Configuration
* dokkaModule(project(":other-project"))
* }
* ```
* Each publication will generate one Dokka site based on the included Dokka Source Sets.
*
* Dokka will merge Dokka Source Sets from other subprojects.
* The type of site is determined by the Dokka Plugins. By default, an HTML site will be generated.
*/
abstract val dokkaSourceSets: NamedDomainObjectContainer<DokkaSourceSetGradleBuilder>
abstract val dokkaPublications: NamedDomainObjectContainer<DokkaPublication>

/**
* Dokka Module Descriptions describe an independent Dokka publication, and these
* descriptions are used by _other_ Dokka Configurations.
* Dokka Source Sets that describe source code in the local project (not subprojects)
*
* Only add a module if you want the Dokka Publication produced by _this project_ to be
* included in the Dokka Publication of _another_ project.
* These source sets will be added to all [dokkaPublications].
*/
abstract val dokkaModules: NamedDomainObjectContainer<DokkaModuleDescriptionGradleBuilder>

abstract val dokkaSourceSets: NamedDomainObjectContainer<DokkaSourceSetGradleBuilder>
}
Loading