Skip to content

Commit

Permalink
#31 provide example for delombok task with kotlin dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
franzbecker committed Feb 15, 2019
1 parent a4bf9d8 commit a79bec3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/README.md
Expand Up @@ -19,3 +19,13 @@ Run it with:
./gradlew :delombok-gradle-groovy:javadoc

And open up [Greeting.html](delombok-gradle-groovy/build/docs/javadoc/com/example/Greeting.html) in your browser.

## delombok-gradle-kotlin

Demonstrates how the delombok task can be used to generate JavaDoc with Kotlin as the Gradle script language.

Run it with:

./gradlew :delombok-gradle-kotlin:javadoc

And open up [Greeting.html](delombok-gradle-kotlin/build/docs/javadoc/com/example/Greeting.html) in your browser.
26 changes: 26 additions & 0 deletions examples/delombok-gradle-kotlin/build.gradle.kts
@@ -0,0 +1,26 @@
import io.franzbecker.gradle.lombok.task.DelombokTask

tasks {

val delombok by registering(DelombokTask::class)
delombok {
dependsOn(compileJava)
val outputDir by extra { file("$buildDir/delombok") }
outputs.dir(outputDir)
sourceSets.getByName("main").java.srcDirs.forEach {
inputs.dir(it)
args(it, "-d", outputDir)
}
doFirst {
outputDir.delete()
}
}

javadoc {
dependsOn(delombok)
val outputDir: File by delombok.get().extra
source = fileTree(outputDir)
isFailOnError = false
}

}
@@ -0,0 +1,9 @@
package com.example;

import lombok.Data;

@Data
public class Greeting {

private String message;
}
1 change: 1 addition & 0 deletions examples/settings.gradle
Expand Up @@ -5,3 +5,4 @@ rootProject.name = 'examples'

include 'hello-world'
include 'delombok-gradle-groovy'
include 'delombok-gradle-kotlin'

0 comments on commit a79bec3

Please sign in to comment.