mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#888 Add configuration snippets for Gradle to reference guide and to the readme.
This commit is contained in:
parent
c8a9592bc9
commit
13d54320a7
@ -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.
|
||||
====
|
||||
|
||||
.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
|
||||
|
||||
@ -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:
|
||||
|
||||
.MapStruct processor options
|
||||
|
16
readme.md
16
readme.md
@ -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.
|
||||
|
||||
## Licensing
|
||||
|
Loading…
x
Reference in New Issue
Block a user