From df7be9752afb22e8d9d8eef327c10c4d85555def Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 7 May 2014 23:26:48 +0200 Subject: [website] tweaked and reworded contributed instructions for gradle and Android Studio for the website. --- website/setup/android.html | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'website/setup/android.html') diff --git a/website/setup/android.html b/website/setup/android.html index 82f0bea1..2e3eb023 100644 --- a/website/setup/android.html +++ b/website/setup/android.html @@ -46,13 +46,21 @@ to the native libraries present in lombok.jar itself. Unfortunately, android does not (yet) understand the concept of a compile-time-only dependency, so you need to mess with your build files to make it work.

+ Android also does not have a complete JRE library stack; in particular, it does not have the @java.beans.ConstructorProperties annotation, therefore you have to stop lombok from generating these: +

+

The instructions listed below are excerpts from The AndroidAnnotations project cookbook. You may wish to refer to that documentation for complete instructions; lombok is just the equivalent to androidannotations-VERSION.jar; there is no -api aspect.

Eclipse

- In eclipse, create a 'lightweight' lombok jar that contains only the annotations by running: + In eclipse, create a 'lightweight' lombok jar that contains only the annotations by running:

 java -jar lombok.jar publicApi
Then, add the lombok-api.jar file created by running this command @@ -76,48 +84,38 @@ java -jar lombok.jar publicApi (which you can modify in that project's properties page) with lombok-api.jar, as produced in the procedure explained for Eclipse, above.
-

Gradle & Android Studio

+

Gradle

- While there might be other ways, this is how I got lombok working for Gradle and Android Studio. - -

Gradle Setup

-
- NOTE: Android does not have the @java.beans.ConstructorProperties therefor you have to use the - suppressConstructorProperties property when using @XArgsConstructor Annotations. - With Lombok >= 1.12.7 you can use the lombok.config file to enable this property projectwide by adding: -

-
lombok.anyConstructor.suppressConstructorProperties = true
-
-
-

Android Studio

- While the Gradle build already works, Android Studio is not able to see the generated methods. To fix this, you have to install the Lombok Plugin for IntelliJ IDEA/Android Studio. +
+

Android Studio

+
+ Follow the previous instructions (Gradle). In addition to setting up your gradle project correctly, you need to add the Lombok IntelliJ plugin to add lombok support to Android Studio: