diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-06-19 23:55:24 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-06-19 23:56:44 +0200 |
commit | ec6c61d82ac9ac4d8421fdc31176d373d8042e92 (patch) | |
tree | 1cf4344beda042ff76a2c8734dc4b39b05b329fb /website/templates | |
parent | 077ab5aed59a344902f4a6255f6aa686a9698533 (diff) | |
download | lombok-ec6c61d82ac9ac4d8421fdc31176d373d8042e92.tar.gz lombok-ec6c61d82ac9ac4d8421fdc31176d373d8042e92.tar.bz2 lombok-ec6c61d82ac9ac4d8421fdc31176d373d8042e92.zip |
Added pages for build tools, and updated the android instructions.
Diffstat (limited to 'website/templates')
-rw-r--r-- | website/templates/_scaffold.html | 5 | ||||
-rw-r--r-- | website/templates/setup/android.html | 15 | ||||
-rw-r--r-- | website/templates/setup/ant.html | 29 | ||||
-rw-r--r-- | website/templates/setup/gradle.html | 59 | ||||
-rw-r--r-- | website/templates/setup/kobalt.html | 20 | ||||
-rw-r--r-- | website/templates/setup/maven.html | 32 |
6 files changed, 151 insertions, 9 deletions
diff --git a/website/templates/_scaffold.html b/website/templates/_scaffold.html index 1f4322eb..cc7b0838 100644 --- a/website/templates/_scaffold.html +++ b/website/templates/_scaffold.html @@ -85,6 +85,11 @@ ga('send', 'pageview'); <li class="target"><a href="/setup/javac">Javac</a></li> <li class="target"><a href="/setup/ecj">ecj</a></li> <li class="divider"></li> + <li class="header">Build tools</li> + <li class="target"><a href="/setup/maven">maven</a></li> + <li class="target"><a href="/setup/gradle">gradle</a></li> + <li class="target"><a href="/setup/ant">ant</a></li> + <li class="target"><a href="/setup/kobalt">kobalt</a></li> <li class="header">IDEs</li> <li class="target"><a href="/setup/eclipse">Eclipse</a></li> <li class="target"><a href="/setup/intellij">IntelliJ IDEA</a></li> diff --git a/website/templates/setup/android.html b/website/templates/setup/android.html index 3ff857e5..8762d355 100644 --- a/website/templates/setup/android.html +++ b/website/templates/setup/android.html @@ -16,16 +16,13 @@ <ul><li> Make sure that the version of your android plugin is <code>>= 0.4.3</code> </li><li> - Add Lombok to your application's <code>dependencies</code> block:<br /><br /> -<pre> - provided "org.projectlombok:lombok:${version}" -</pre> + Use the <a href="https://github.com/franzbecker/gradle-lombok">gradle-lombok</a> plugin. </li><li> - When using <a href="https://bitbucket.org/hvisser/android-apt">android-apt</a>, you also have to specify Lombok as an annotation processor (with the <code>apt</code> directive) in the <code>dependencies</code> block:<br /><br /> + If you don't want to use the plugin, add Lombok to your application's <code>dependencies</code> block (requires Gradle v2.12 or newer):<br /><br /> <pre> - provided "org.projectlombok:lombok:${version}" - apt "org.projectlombok:lombok:${version}" -</pre> +dependencies { + compileOnly "org.projectlombok:lombok:${version}" +}</pre> </li></ul> </p> </@s.section> @@ -58,7 +55,7 @@ java -jar lombok.jar publicApi</pre> <@s.section title="Maven"> <p> - You should be able to just follow the normal <a href="../mavenrepo/index.html">lombok with maven instructions</a>.<br /> + You should be able to just follow the normal <a href="maven">integrate lombok with maven instructions</a>.<br /> Note that if you use android, eclipse, and maven together you may have to replace <code>lombok.jar</code> in your eclipse android project's build path (which you can modify in that project's properties page) with <code>lombok-api.jar</code>, as produced in the procedure explained for <em>Eclipse</em>, above. </p> </@s.section> diff --git a/website/templates/setup/ant.html b/website/templates/setup/ant.html new file mode 100644 index 00000000..3781e01d --- /dev/null +++ b/website/templates/setup/ant.html @@ -0,0 +1,29 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Ant+ivy"> + <@s.introduction> + <p> + This page explains how to compile your code when you use the <a href="https://ant.apache.org/">Apache Ant</a> build tool. We suggest you use <a href="http://ant.apache.org/ivy/">ivy</a>, the ant add-on that lets you fetch dependencies from the internet automatically. + </p><p> + 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 <code><javac></code> task. + </p> + </@s.introduction> + + <@s.section title="Just ant"> + <p> + Assuming that you've put <code>lombok.jar</code> in a <code>lib</code> dir, your javac task would have to look like:<pre> +<javac srcdir="src" destdir="build" source="1.8"> + <classpath location="lib/lombok.jar" /> +</javac></pre> + </p> + </@s.section> + + <@s.section title="Ant with Ivy"> + <p> + Lombok is available in Maven Central, so you can tell ivy to fetch lombok like so (assuming you have a configuration named <code>build</code>:<pre> +<dependencies> + <dependency org="org.projectlombok" name="lombok" rev="${version}" conf="build->master" /> +</dependencies></pre> + </p> + </@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> + <p> + 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 <a href="https://gradle.org/">Gradle build tool</a>. + </p><p> + Lombok is available in maven central, so telling Gradle to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="The Lombok Gradle Plugin"> + <p> + 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 <a href="https://github.com/franzbecker/gradle-lombok">about the gradle-lombok plugin</a>. + </p><p> + Note, to tell the <code>gradle-lombok</code> 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 <code>build.gradle</code> file:<pre> +lombok { + version = ${version} + sha256 = "" +}</pre> + </p> + </@s.section> + + <@s.section title="Gradle v2.12 and up"> + <p> + If you don't want to use the plugin, gradle has the built-in <code>compileOnly</code> scope, which can be used to tell gradle to add lombok only during compilation. Your <code>build.gradle</code> will look like:<pre> +repositories { + mavenCentral() +} + +dependencies { + compileOnly 'org.projectlombok:lombok:${version}' +}</pre> + </p><p> + Remember that you still have to download <code>lombok.jar</code> (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. + </p> + </@s.section> + <@s.section title="Gradle prior to v2.12"> + <p> + 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 <code>war</code> plugin has the <code>providedCompile</code> scope, and the <a href="https://github.com/nebula-plugins/gradle-extra-configurations-plugin">Gradle Extra Configurations Plugin</a> supports the <code>provided</code> scope. With these plugins, your <code>build.gradle</code> file will look something like this:<pre> +apply plugin: 'java' +apply plugin: 'nebula.provided-base' + +repositories { + mavenCentral() +} + +dependencies { + provided 'org.projectlombok:lombok:${version}' +}</pre> + </p> + </@s.section> + + <@s.section title="Android development"> + <p> + Complete instructions for integrating lombok with your android development is available on our <a href="android">Using lombok for android development</a> page. + </p> + </@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> + <p> + 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 <a href="http://beust.com/kobalt/home/index.html">Kobalt</a> buid tool. + </p><p> + Lombok is available in maven central, so telling Kobalt to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="Configuring Kobalt"> + <p> + To add lombok as a 'provided' dependency to your project, write your <code>Built.kt</code> like so:<pre> +dependencies { + provided("org.projectlombok:lombok:${version}") +}</pre> + </p> + </@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> + <p> + 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 <a href="https://maven.apache.org/">Apache Maven</a> build tool. + </p><p> + Lombok is available in maven central, so telling Maven to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="Adding lombok to your pom file"> + <p> + To include lombok as a 'provided' dependency, add it to your <code><dependencies></code> block like so:<pre> +<dependencies> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${version}</version> + <scope>provided</scope> + </dependency> +</dependencies> +</pre> + </p> + </@s.section> + + <@s.section title="Delomboking: The Lombok Maven Plugin"> + <p> + 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 <em>after</em> lombok has been applied, or if you want to generate javadoc. The plugin is open source. Read more <a href="http://awhitford.github.io/lombok.maven/lombok-maven-plugin/">about the lombok maven plugin</a>. + </p> + </@s.section> +</@s.scaffold> |