Skip to content

Commit

Permalink
lightbendGH-97 Add an example how to invoke plugin from gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilx committed Apr 23, 2019
1 parent 1f6ab9e commit a2aa9b1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@ GenJavadoc can also be integrated into a Maven build (inspired by [this answer o
</profile>
~~~

You can integrate genjavadoc with gradle build:

~~~ groovy
apply plugin: 'scala'
configurations {
scalaCompilerPlugin
}
dependencies {
// ...
scalaCompilerPlugin "com.typesafe.genjavadoc:genjavadoc-plugin_${scalaFullVersion}:0.13"
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.with {
additionalParameters = [
"-Xplugin:" + configurations.scalaCompilerPlugin.asPath,
"-P:genjavadoc:out=$buildDir/generated/java".toString()
]
}
}
tasks.withType(Javadoc) {
dependsOn("compileScala")
source = [sourceSets.main.allJava, "$buildDir/generated/java"]
}
~~~

### Translation of Scaladoc comments

Comments found within the Scala sources are transferred to the corresponding Java sources including some modifications. These are necessary since Scaladoc supports different mark-up elements than Javadoc. The modifications are:
Expand Down

0 comments on commit a2aa9b1

Please sign in to comment.