-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
83 lines (71 loc) · 2.87 KB
/
build.gradle.kts
File metadata and controls
83 lines (71 loc) · 2.87 KB
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
/*
This file is licensed to you under the Apache License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0) or the MIT license
(http://opensource.org/licenses/MIT), at your option.
Unless required by applicable law or agreed to in writing, this software is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
ANY KIND, either express or implied. See the LICENSE-MIT and LICENSE-APACHE
files for the specific language governing permissions and limitations under
each license.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
id("com.android.library") version "8.13.2" apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
kotlin("jvm") version "2.2.10" apply false
kotlin("plugin.serialization") version "2.2.10" apply false
id("jacoco")
}
tasks.register("clean", Delete::class) { delete(rootProject.layout.buildDirectory) }
val dokkaRuntime by configurations.creating
// Configuration for Dokka plugins (separate from CLI)
val dokkaPlugins by configurations.creating
dependencies {
dokkaRuntime("org.jetbrains.dokka:dokka-cli:2.0.0")
dokkaPlugins("org.jetbrains.dokka:dokka-base:2.0.0")
dokkaPlugins("org.jetbrains.dokka:analysis-kotlin-descriptors:2.0.0")
}
// Task to generate documentation using Dokka CLI
tasks.register<JavaExec>("generateDocs") {
group = "documentation"
description = "Generate API documentation using Dokka CLI"
classpath = dokkaRuntime
mainClass.set("org.jetbrains.dokka.MainKt")
val outputDir = file("$rootDir/build/docs")
val sourceDir = file("$rootDir/library/src/main/kotlin")
val moduleDoc = file("$rootDir/library/MODULE.md")
doFirst {
outputDir.deleteRecursively()
outputDir.mkdirs()
println("Generating documentation...")
println(" Source: $sourceDir")
println(" Module doc: $moduleDoc")
println(" Output: $outputDir")
}
// Build plugin classpath from dokkaPlugins configuration only
val pluginsClasspath = dokkaPlugins.files.joinToString(";") { it.absolutePath }
// Build sourceSet argument with all parameters together
val sourceSetParams = buildList {
add("-src")
add(sourceDir.absolutePath)
if (moduleDoc.exists()) {
add("-includes")
add(moduleDoc.absolutePath)
}
add("-analysisPlatform")
add("jvm")
add("-documentedVisibilities")
add("PUBLIC;PROTECTED;INTERNAL")
add("-sourceSetName")
add("main")
}.joinToString(" ")
args(
"-pluginsClasspath", pluginsClasspath,
"-outputDir", outputDir.absolutePath,
"-moduleName", "c2pa-android",
"-loggingLevel", "INFO",
"-sourceSet", sourceSetParams,
)
}