Docs: Document reference.conf appending on gradle+kotlin (#29274)

This commit is contained in:
Arnout Engelen 2020-06-25 10:11:23 +02:00 committed by GitHub
parent 01501148d7
commit b95c82e63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ distributions of any type of application, including Akka applications.
Define sbt version in `project/build.properties` file: Define sbt version in `project/build.properties` file:
```none ```none
sbt.version=0.13.13 sbt.version=1.3.12
``` ```
Add [sbt-native-packager](https://github.com/sbt/sbt-native-packager) in `project/plugins.sbt` file: Add [sbt-native-packager](https://github.com/sbt/sbt-native-packager) in `project/plugins.sbt` file:
@ -43,7 +43,7 @@ to merge all the reference.confs on the build classpath into one.
The plugin configuration might look like this: The plugin configuration might look like this:
``` ```xml
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
@ -92,7 +92,7 @@ To make sure the `reference.conf` resources are correctly merged, you might
use the [Shadow plugin](https://imperceptiblethoughts.com/shadow/), which might use the [Shadow plugin](https://imperceptiblethoughts.com/shadow/), which might
look something like this: look something like this:
``` ```groovy
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
plugins { plugins {
@ -107,3 +107,13 @@ shadowJar {
with jar with jar
} }
``` ```
Or when you use the Kotlin DSL:
```kotlin
tasks.withType<ShadowJar> {
val newTransformer = AppendingTransformer()
newTransformer.resource = "reference.conf"
transformers.add(newTransformer)
}
```