diff --git a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc index 24b81e34c..d6efc9492 100644 --- a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc +++ b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc @@ -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 diff --git a/readme.md b/readme.md index dba4dab29..c4569943c 100644 --- a/readme.md +++ b/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