#888 Add configuration snippets for Gradle to reference guide and to the readme.

This commit is contained in:
Andreas Gudian 2016-09-06 20:55:47 +02:00
parent c8a9592bc9
commit 13d54320a7
2 changed files with 52 additions and 0 deletions

View File

@ -102,6 +102,26 @@ Also make sure that your project is using Java 1.6 or later (project properties
It will not work with older versions. It will not work with older versions.
==== ====
.Gradle configuration
====
[source, groovy, linenums]
[subs="verbatim,attributes"]
----
...
plugins {
...
id 'net.ltgt.apt' version '0.8'
}
dependencies {
...
compile 'org.mapstruct:mapstruct-jdk8:{mapstructVersion}'
apt 'org.mapstruct:mapstruct-processor:{mapstructVersion}'
}
...
----
====
[[configuration-options]] [[configuration-options]]
=== Configuration options === Configuration options
@ -143,6 +163,22 @@ When invoking javac directly, these options are passed to the compiler in the fo
---- ----
==== ====
.Gradle configuration
====
[source, groovy, linenums]
[subs="verbatim,attributes"]
----
...
compileJava {
options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true',
'-Amapstruct.suppressGeneratorVersionInfoComment=true'
]
}
...
----
====
The following options exist: The following options exist:
.MapStruct processor options .MapStruct processor options

View File

@ -72,6 +72,22 @@ For Maven based projects add the following to your POM file in order to use MapS
... ...
``` ```
For Gradle, you need something along the following lines:
```groovy
plugins {
...
id 'net.ltgt.apt' version '0.8'
}
dependencies {
...
compile 'org.mapstruct:mapstruct:1.0.0.Final' // OR use this with Java 8 and beyond: org.mapstruct:mapstruct-jdk8:...
apt 'org.mapstruct:mapstruct-processor:1.0.0.Final'
}
...
```
Alternatively, a distribution bundle is available from SourceForge. Alternatively, a distribution bundle is available from SourceForge.
## Licensing ## Licensing