aboutsummaryrefslogtreecommitdiff
path: root/gradle-plugin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-09-11 16:45:11 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-09-11 16:45:11 +0200
commit757f72db456cf4dd12b0cfdbf312752d5951f166 (patch)
treee616cee86448fc9ae12c9cf67f27abecef0755f1 /gradle-plugin
parente67ee4136f69ad2c8ef65c4978465f43717517d2 (diff)
downloaddokka-757f72db456cf4dd12b0cfdbf312752d5951f166.tar.gz
dokka-757f72db456cf4dd12b0cfdbf312752d5951f166.tar.bz2
dokka-757f72db456cf4dd12b0cfdbf312752d5951f166.zip
M13 code cleanup
Diffstat (limited to 'gradle-plugin')
-rw-r--r--gradle-plugin/src/main/kotlin/main.kt38
1 files changed, 19 insertions, 19 deletions
diff --git a/gradle-plugin/src/main/kotlin/main.kt b/gradle-plugin/src/main/kotlin/main.kt
index 418af00f..e56b2371 100644
--- a/gradle-plugin/src/main/kotlin/main.kt
+++ b/gradle-plugin/src/main/kotlin/main.kt
@@ -15,29 +15,29 @@ import java.util.ArrayList
public open class DokkaPlugin : Plugin<Project> {
override fun apply(project: Project) {
- val ext = project.getExtensions().create("dokka", javaClass<DokkaExtension>())
- project.getTasks().create("dokka", javaClass<DokkaTask>())
+ val ext = project.extensions.create("dokka", DokkaExtension::class.java)
+ project.tasks.create("dokka", DokkaTask::class.java)
- ext.moduleName = project.getName()
- ext.outputDirectory = File(project.getBuildDir(), "dokka").getAbsolutePath()
+ ext.moduleName = project.name
+ ext.outputDirectory = File(project.buildDir, "dokka").absolutePath
}
}
public open class DokkaTask : DefaultTask() {
init {
- setGroup(JavaBasePlugin.DOCUMENTATION_GROUP)
- setDescription("Generates dokka documentation for Kotlin")
+ group = JavaBasePlugin.DOCUMENTATION_GROUP
+ description = "Generates dokka documentation for Kotlin"
}
- TaskAction
+ @TaskAction
fun generate() {
- val project = getProject()
- val conf = getProject().getExtensions().getByType(javaClass<DokkaExtension>())
- val javaPluginConvention = getProject().getConvention().getPlugin(javaClass<JavaPluginConvention>())
+ val project = project
+ val conf = project.extensions.getByType(DokkaExtension::class.java)
+ val javaPluginConvention = project.convention.getPlugin(JavaPluginConvention::class.java)
- val sourceSets = javaPluginConvention.getSourceSets()?.findByName(SourceSet.MAIN_SOURCE_SET_NAME)
- val sourceDirectories = sourceSets?.getAllSource()?.getSrcDirs()?.filter { it.exists() } ?: emptyList()
- val allConfigurations = getProject().getConfigurations()
+ val sourceSets = javaPluginConvention.sourceSets?.findByName(SourceSet.MAIN_SOURCE_SET_NAME)
+ val sourceDirectories = sourceSets?.allSource?.srcDirs?.filter { it.exists() } ?: emptyList()
+ val allConfigurations = project.configurations
val classpath =
conf.processConfigurations
@@ -45,20 +45,20 @@ public open class DokkaTask : DefaultTask() {
.flatMap { it }
if (sourceDirectories.isEmpty()) {
- getLogger().warn("No source directories found: skipping dokka generation")
+ logger.warn("No source directories found: skipping dokka generation")
return
}
DokkaGenerator(
- DokkaGradleLogger(getLogger()),
- classpath.map { it.getAbsolutePath() },
- sourceDirectories.map { it.getAbsolutePath() },
+ DokkaGradleLogger(logger),
+ classpath.map { it.absolutePath },
+ sourceDirectories.map { it.absolutePath },
conf.samples,
conf.includes,
conf.moduleName,
conf.outputDirectory,
conf.outputFormat,
- conf.linkMappings.map { SourceLinkDefinition(project.file(it.dir).getAbsolutePath(), it.url, it.suffix) },
+ conf.linkMappings.map { SourceLinkDefinition(project.file(it.dir).absolutePath, it.url, it.suffix) },
false
).generate()
}
@@ -76,7 +76,7 @@ public open class DokkaExtension {
fun linkMapping(closure: Closure<Any?>) {
val mapping = LinkMapping()
- closure.setDelegate(mapping)
+ closure.delegate = mapping
closure.call()
if (mapping.dir.isEmpty()) {