|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2012-2023 the original author or authors. |
|
|
|
* Copyright 2012-2024 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -19,7 +19,10 @@ package org.springframework.boot.build; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import dev.adamko.dokkatoo.DokkatooExtension; |
|
|
|
|
|
|
|
import dev.adamko.dokkatoo.formats.DokkatooHtmlPlugin; |
|
|
|
import org.gradle.api.Project; |
|
|
|
import org.gradle.api.Project; |
|
|
|
|
|
|
|
import org.gradle.api.tasks.SourceSet; |
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions; |
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions; |
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile; |
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile; |
|
|
|
|
|
|
|
|
|
|
|
@ -44,9 +47,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile; |
|
|
|
class KotlinConventions { |
|
|
|
class KotlinConventions { |
|
|
|
|
|
|
|
|
|
|
|
void apply(Project project) { |
|
|
|
void apply(Project project) { |
|
|
|
project.getPlugins() |
|
|
|
project.getPlugins().withId("org.jetbrains.kotlin.jvm", (plugin) -> { |
|
|
|
.withId("org.jetbrains.kotlin.jvm", |
|
|
|
project.getTasks().withType(KotlinCompile.class, this::configure); |
|
|
|
(plugin) -> project.getTasks().withType(KotlinCompile.class, this::configure)); |
|
|
|
configureDokkatoo(project); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void configure(KotlinCompile compile) { |
|
|
|
private void configure(KotlinCompile compile) { |
|
|
|
@ -60,4 +64,12 @@ class KotlinConventions { |
|
|
|
compile.getKotlinOptions().setFreeCompilerArgs(freeCompilerArgs); |
|
|
|
compile.getKotlinOptions().setFreeCompilerArgs(freeCompilerArgs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void configureDokkatoo(Project project) { |
|
|
|
|
|
|
|
project.getPlugins().apply(DokkatooHtmlPlugin.class); |
|
|
|
|
|
|
|
DokkatooExtension dokkatoo = project.getExtensions().getByType(DokkatooExtension.class); |
|
|
|
|
|
|
|
dokkatoo.getDokkatooSourceSets() |
|
|
|
|
|
|
|
.named(SourceSet.MAIN_SOURCE_SET_NAME) |
|
|
|
|
|
|
|
.configure((spec) -> spec.getSourceRoots().setFrom(project.file("src/main/kotlin"))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|