aboutsummaryrefslogtreecommitdiff
path: root/core/migration_guide.md
blob: b8ff7893cac2a719ee59c17edda2fb345409ea8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
## Changes between 0.10.x and 0.11.0

There are two main changes between dokka 0.10.x and 0.11.0

The first is the introduction of plugability - new documentation creating process is divided into several steps and each step provides extension points to be used. To learn more about new dokka pipeline and possible plugins, please read Developer's guide.

Second difference comes with the change with the subject of dokka pass. Previously, separate dokka passes where set for every targeted platform, now every source set has its own pass.

### Gradle

With changing the approach from platform-based to sourceset-based, we replace `multiplatform` block with `dokkaSourceSets`. It's still a collection of dokka passes configuration, so the structure stays as it was.

#### Old
```groovy
    dokka {
        outputFormat = 'html'
        outputDirectory = "$buildDir/dokka"
        multiplatform {
            js {
                includes = ["src/jsMain/resources/doc.md"]
                samples = ["src/jsMain/resources/Samples.kt"]
                sourceLink {
                    path = "src/jsMain/kotlin"
                    url = "https:/dokka.documentation.com/jsMain/kotlin"
                    lineSuffix = "#L"
                }
            }
            jvm {
                includes = ["src/jvmMain/resources/doc.md"]
                samples = ["src/jsMain/resources/Samples.kt"]
                sourceLink {
                    path = "src/jvmMain/kotlin"
                    url = "https:/dokka.documentation.com/jvmMain/kotlin"
                    lineSuffix = "#L"
                }
            }
    }
}
```
#### New
```groovy
    dokka {
        outputFormat = 'html'
        outputDirectory = "$buildDir/dokka"

        dokkaSourceSets {
            commonMain {}
            jsMain {
                includes = ["src/jsMain/resources/doc.md"]
                samples = ["src/jsMain/resources/Samples.kt"]
                sourceLink {
                    path = "src/jsMain/kotlin"
                    url = "https:/dokka.documentation.com/jsMain/kotlin"
                    lineSuffix = "#L"
                }
            }

            val jvmMain by creating {
                includes = ["src/jvmMain/resources/doc.md"]
                samples = ["src/jsMain/resources/Samples.kt"]
                sourceLink {
                    path = "src/jvmMain/kotlin"
                    url = "https:/dokka.documentation.com/jvmMain/kotlin"
                    lineSuffix = "#L"
                }
            }
        }
    }
```

#### Multimodule page

There is a new task, `dokkaMultimodule`, that creates an index page for all documented subprojects. It is available only for top-level project.

```groovy
dokkaMultimodule {
    // File to be used as an excerpt for each subprojects
    documentationFileName = "README.md"
    // output format for rendering multimodule page (accepts the same values as regular dokka task)
    outputFormat = "html"
    // output directory for page
    outputDirectory = "$buildDir/dokka"
}
```

### Maven

There are no changes in maven configuration API for dokka, so all previous configurations should work without issues.