From ec6c61d82ac9ac4d8421fdc31176d373d8042e92 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot >= 0.4.3
dependencies
block:
-
- provided "org.projectlombok:lombok:${version}"
-
+ Use the gradle-lombok plugin.
apt
directive) in the dependencies
block:
+ If you don't want to use the plugin, add Lombok to your application's dependencies
block (requires Gradle v2.12 or newer):
- provided "org.projectlombok:lombok:${version}"
- apt "org.projectlombok:lombok:${version}"
-
+dependencies {
+ compileOnly "org.projectlombok:lombok:${version}"
+}
- You should be able to just follow the normal lombok with maven instructions.
+ You should be able to just follow the normal integrate lombok with maven instructions.
Note that if you use android, eclipse, and maven together you may have to replace lombok.jar
in your eclipse android project's build path (which you can modify in that project's properties page) with lombok-api.jar
, as produced in the procedure explained for Eclipse, above.
+ This page explains how to compile your code when you use the Apache Ant build tool. We suggest you use ivy, the ant add-on that lets you fetch dependencies from the internet automatically. +
+ Lombok just needs to be on the classpath when you compile your code to do its work, so all you have to ensure, is that lombok is on the classpath in your <javac>
task.
+
+ Assuming that you've put lombok.jar
in a lib
dir, your javac task would have to look like:
+<javac srcdir="src" destdir="build" source="1.8"> + <classpath location="lib/lombok.jar" /> +</javac>+ + @s.section> + + <@s.section title="Ant with Ivy"> +
+ Lombok is available in Maven Central, so you can tell ivy to fetch lombok like so (assuming you have a configuration named build
:
+<dependencies> + <dependency org="org.projectlombok" name="lombok" rev="${version}" conf="build->master" /> +</dependencies>+ + @s.section> +@s.scaffold> diff --git a/website/templates/setup/gradle.html b/website/templates/setup/gradle.html new file mode 100644 index 00000000..579aa6a2 --- /dev/null +++ b/website/templates/setup/gradle.html @@ -0,0 +1,59 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Gradle"> + <@s.introduction> +
+ To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Gradle build tool. +
+ Lombok is available in maven central, so telling Gradle to download lombok is easy. +
+ @s.introduction> + + <@s.section title="The Lombok Gradle Plugin"> ++ There is a plugin for gradle that we recommend you use; it makes deployment a breeze, works around shortcomings of gradle prior to v2.12, and makes it easy to do additional tasks, such as running the lombok eclipse installer or delomboking. The plugin is open source. Read more about the gradle-lombok plugin. +
+ Note, to tell the gradle-lombok
plugin to use the latest version of lombok, you need to explicitly tell it about the latest version number and the SHA-256. For our current latest version, put this in your build.gradle
file:
+lombok { + version = ${version} + sha256 = "" +}+ + @s.section> + + <@s.section title="Gradle v2.12 and up"> +
+ If you don't want to use the plugin, gradle has the built-in compileOnly
scope, which can be used to tell gradle to add lombok only during compilation. Your build.gradle
will look like:
+repositories { + mavenCentral() +} + +dependencies { + compileOnly 'org.projectlombok:lombok:${version}' +}+
+ Remember that you still have to download lombok.jar
(or find it in gradle's caches) and run it as a jarfile, if you wish to program in eclipse. The plugin makes that part easier.
+
+ If you don't want to use the plugin and you're on gradle prior to v2.12, there's a bit of problem: Gradle didn't introduce the 'provided' concept until v2.12. The concept is added by a few well known plugins: The gradle war
plugin has the providedCompile
scope, and the Gradle Extra Configurations Plugin supports the provided
scope. With these plugins, your build.gradle
file will look something like this:
+apply plugin: 'java' +apply plugin: 'nebula.provided-base' + +repositories { + mavenCentral() +} + +dependencies { + provided 'org.projectlombok:lombok:${version}' +}+ + @s.section> + + <@s.section title="Android development"> +
+ Complete instructions for integrating lombok with your android development is available on our Using lombok for android development page. +
+ @s.section> +@s.scaffold> diff --git a/website/templates/setup/kobalt.html b/website/templates/setup/kobalt.html new file mode 100644 index 00000000..26adf23d --- /dev/null +++ b/website/templates/setup/kobalt.html @@ -0,0 +1,20 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Kobalt"> + <@s.introduction> ++ To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Kobalt buid tool. +
+ Lombok is available in maven central, so telling Kobalt to download lombok is easy. +
+ @s.introduction> + + <@s.section title="Configuring Kobalt"> +
+ To add lombok as a 'provided' dependency to your project, write your Built.kt
like so:
+dependencies { + provided("org.projectlombok:lombok:${version}") +}+ + @s.section> +@s.scaffold> diff --git a/website/templates/setup/maven.html b/website/templates/setup/maven.html new file mode 100644 index 00000000..5ca09126 --- /dev/null +++ b/website/templates/setup/maven.html @@ -0,0 +1,32 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Maven"> + <@s.introduction> +
+ To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Apache Maven build tool. +
+ Lombok is available in maven central, so telling Maven to download lombok is easy. +
+ @s.introduction> + + <@s.section title="Adding lombok to your pom file"> +
+ To include lombok as a 'provided' dependency, add it to your <dependencies>
block like so:
+<dependencies> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${version}</version> + <scope>provided</scope> + </dependency> +</dependencies> ++ + @s.section> + + <@s.section title="Delomboking: The Lombok Maven Plugin"> +
+ There is a plugin for Maven that we recommend you use if you want to delombok via maven. Useful if you want to run source analysis tools on your source after lombok has been applied, or if you want to generate javadoc. The plugin is open source. Read more about the lombok maven plugin. +
+ @s.section> +@s.scaffold> -- cgit