diff options
Diffstat (limited to 'website/templates/setup')
-rw-r--r-- | website/templates/setup/_setup.html | 28 | ||||
-rw-r--r-- | website/templates/setup/android.html | 77 | ||||
-rw-r--r-- | website/templates/setup/ant.html | 29 | ||||
-rw-r--r-- | website/templates/setup/ecj.html | 31 | ||||
-rw-r--r-- | website/templates/setup/eclipse.html | 26 | ||||
-rw-r--r-- | website/templates/setup/gradle.html | 59 | ||||
-rw-r--r-- | website/templates/setup/gwt.html | 16 | ||||
-rw-r--r-- | website/templates/setup/intellij.html | 22 | ||||
-rw-r--r-- | website/templates/setup/javac.html | 15 | ||||
-rw-r--r-- | website/templates/setup/kobalt.html | 20 | ||||
-rw-r--r-- | website/templates/setup/maven.html | 32 | ||||
-rw-r--r-- | website/templates/setup/netbeans.html | 16 |
12 files changed, 371 insertions, 0 deletions
diff --git a/website/templates/setup/_setup.html b/website/templates/setup/_setup.html new file mode 100644 index 00000000..e5c2c007 --- /dev/null +++ b/website/templates/setup/_setup.html @@ -0,0 +1,28 @@ +<#import "/_scaffold.html" as main> + +<#macro introduction> + <div class="row"> + <#nested> + </div> +</#macro> + +<#macro section title> + <div class="row"> + <h3>${title}</h3> + + <#nested> + </div> +</#macro> + +<#macro scaffold title load=[]> + <@main.scaffold load> + <div class="page-header top5" id="featureContent"> + <div class="row text-center"> + <div class="header-group"> + <h1>${title}</h1> + </div> + </div> + <#nested> + </div> + </@main.scaffold> +</#macro> diff --git a/website/templates/setup/android.html b/website/templates/setup/android.html new file mode 100644 index 00000000..8762d355 --- /dev/null +++ b/website/templates/setup/android.html @@ -0,0 +1,77 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Android"> + <@s.introduction> + <p> + Android development with lombok is easy and won't make your android application any 'heavier' because lombok is a compile-time only library. It is important to configure your android project properly to make sure lombok doesn't end up in your application and waste precious space on android devices. + </p><p> + The instructions listed below are excerpts from <a href="https://github.com/excilys/androidannotations/wiki/Cookbook">The + AndroidAnnotations project cookbook</a>. You may wish to refer to that documentation for complete instructions; lombok is just + the equivalent to <code>androidannotations-VERSION.jar</code>; there is no <code>-api</code> aspect. + </p> + </@s.introduction> + + <@s.section title="Gradle"> + <p> + <ul><li> + Make sure that the version of your android plugin is <code>>= 0.4.3</code> + </li><li> + Use the <a href="https://github.com/franzbecker/gradle-lombok">gradle-lombok</a> plugin. + </li><li> + 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> +dependencies { + compileOnly "org.projectlombok:lombok:${version}" +}</pre> + </li></ul> + </p> + </@s.section> + + <@s.section title="Android Studio"> + <p> + Follow the previous instructions (<em>Gradle</em>). In addition to setting up your gradle project correctly, you need to add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support to Android Studio: + <ul><li> + Go to <code>File > Settings > Plugins</code> + </li><li> + Click on <code>Browse repositories...</code> + </li><li> + Search for <code>Lombok Plugin</code> + </li><li> + Click on <code>Install plugin</code> + </li><li> + Restart Android Studio + </li></ul> + </p> + </@s.section> + + <@s.section title="Eclipse"> + <p> + In eclipse, create a 'lightweight' lombok jar that contains only the annotations by running:<br /><br /> + <pre> +java -jar lombok.jar publicApi</pre> + Then, add the <code>lombok-api.jar</code> file created by running this command to your android project instead of the complete <code>lombok.jar</code>, and, as usual, install lombok into eclipse by double-clicking <code>lombok.jar</code>. + </p> + </@s.section> + + <@s.section title="Maven"> + <p> + 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> + + <@s.section title="Ant"> + <p> + <ul><li> + Find <code>build.xml</code> in <code>${r"${ANDROID_SDK_ROOT}"}/tools/ant/build.xml</code> and copy the <code>-compile</code> target into the paste buffer. + </li><li> + Copy this to the <code>build.xml</code> of your own project, right before the <code><import file="${r"${sdk.dir}"}/tools/ant/build.xml"></code> line. + </li><li> + Create a <code>compile-libs</code> directory in your own project and copy the complete <code>lombok.jar</code> to it. + </li><li> + Now modify the <code><classpath></code> entry inside the <code><javac></code> task in the <code>-compile</code> target you just copied:<br /> + add <code><fileset dir="compile-libs" includes="*.jar" /></code> to it. + </li></ul> + </p> + </@s.section> +</@s.scaffold> 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/ecj.html b/website/templates/setup/ecj.html new file mode 100644 index 00000000..9d56a085 --- /dev/null +++ b/website/templates/setup/ecj.html @@ -0,0 +1,31 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="ecj"> + <@s.introduction> + <p> + ecj (the eclipse standalone compiler) is compatible with lombok. Use the following command line to enable lombok with ecj: + <pre>java <strong>-javaagent:lombok.jar=ECJ</strong> -jar ecj.jar -cp lombok.jar -source 1.8 <em class="note">(rest of arguments)</em></pre> + </p><p> + You may have to add the following VM argument, if you're using an older version of lombok or java: + <pre><strong>-Xbootclasspath/p:lombok.jar</strong></pre> + </p><p> + If you're using a tool based on ecj, adding these VM arguments and adding lombok.jar to the classpath should work. + </p> + </@s.introduction> + + <@s.section title="Maven"> + <p> + It is possible to <a href="/files/pom.xml">configure</a> <code>maven-compiler-plugin</code> with <code>maven-dependency-plugin</code> and <code>plexus-compiler-eclipse</code>. + </p><p> + Before the <code>compile</code> phase, you will have to set your <code>MAVEN_OPTS</code> environment variable to include the <code>javaagent</code> argument. In the example below, <code>target</code> is your <code>${r"${project.build.directory}"}</code>. + </p><p> + Use the following commands in sequence to enable lombok with ecj in your Maven build: +<pre> +mvn clean <strong>dependency:copy@get-lombok</strong> +set MAVEN_OPTS=<strong>-javaagent:target/lombok.jar=ECJ</strong> <em class="note">(or your OS's equivalent)</em> +mvn install +set MAVEN_OPTS= <em class="note">(or your OS's equivalent)</em> +</pre> + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/eclipse.html b/website/templates/setup/eclipse.html new file mode 100644 index 00000000..85304c83 --- /dev/null +++ b/website/templates/setup/eclipse.html @@ -0,0 +1,26 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Eclipse, Spring Tool Suite, (Red Hat) JBoss Developer Studio, MyEclipse"> + <@s.introduction> + <p> + The <a href="https://eclipse.org/">Eclipse</a> editor is compatible with lombok. Eclipse offshoots are also compatible with lombok, specifically: + <ul><li> + <a href="https://www.genuitec.com/products/myeclipse/">MyEclipse</a> + </li><li> + <a href="https://developers.redhat.com/products/devstudio/overview/">Red Hat JBoss Developer Studio</a> + </li><li> + <a href="https://tools.jboss.org/downloads/devstudio/">JBoss Developer Studio (JBDS)</a> + </li><li> + <a href="https://spring.io/tools">Spring Tools Suite (STS)</a> + </li></ul> + </p><p> + Double-click lombok.jar (downloadable from this site, or from your maven repository; it's the same jar). This starts the eclipse installer which will find eclipse (and eclipse variants as listed above), and offers to install lombok into these eclipse installations. The same tool can also uninstall lombok: <br /> + + <img src="/img/lombok-installer.png" /> + </p><p> + You can check if your eclipse installation is lombok-enabled in eclipse's about dialog. The lombok version will be listed at the end of the copyright text:<br /><br /> + + <img src="/img/eclipse-about.png" /> + </p> + </@s.introduction> +</@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/gwt.html b/website/templates/setup/gwt.html new file mode 100644 index 00000000..142362ac --- /dev/null +++ b/website/templates/setup/gwt.html @@ -0,0 +1,16 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="GWT"> + <@s.introduction> + <p> + <a href="http://www.gwtproject.org/">GWT (Google Web Toolkit)</a> is compatible with lombok. + </p><p> + Edit your <code>proj-debug</code> and <code>proj-compile</code> batch scripts to add the following VM arguments: +<pre> +java <strong>-javaagent:lombok.jar=ECJ</strong> <em>(rest of arguments)</em> +</pre> + </p><p> + Thanks to Stephen Haberman for figuring this out. + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/intellij.html b/website/templates/setup/intellij.html new file mode 100644 index 00000000..989986e5 --- /dev/null +++ b/website/templates/setup/intellij.html @@ -0,0 +1,22 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="IntelliJ IDEA"> + <@s.introduction> + <p> + The <a href="https://www.jetbrains.com/idea/">Jetbrains IntelliJ IDEA</a> editor is compatible with lombok. + </p><p> + Add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support IntelliJ: + <ul><li> + Go to <code>File > Settings > Plugins</code> + </li><li> + Click on <code>Browse repositories...</code> + </li><li> + Search for <code>Lombok Plugin</code> + </li><li> + Click on <code>Install plugin</code> + </li><li> + Restart IntelliJ IDEA + </li></ul> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/javac.html b/website/templates/setup/javac.html new file mode 100644 index 00000000..9cc9a560 --- /dev/null +++ b/website/templates/setup/javac.html @@ -0,0 +1,15 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="JavaC"> + <@s.introduction> + <p> + Just put lombok on the classpath when compiling with any javac (version 1.6 - 1.8): <code>javac -cp lombok.jar ....</code> + </p> + </@s.introduction> + + <@s.section title="JDK 9"> + <p> + Support for JDK9 is ongoing. You need to set up some configuration to make lombok play nice with jigsaw (the JDK9 module system). The <a href="https://github.com/rzwitserloot/lombok/issues/985">github issue about JDK9 support for Lombok</a> has the details on how to set it up. + </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> diff --git a/website/templates/setup/netbeans.html b/website/templates/setup/netbeans.html new file mode 100644 index 00000000..eccd9e93 --- /dev/null +++ b/website/templates/setup/netbeans.html @@ -0,0 +1,16 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Netbeans"> + <@s.introduction> + <p> + The <a href="https://netbeans.org/">Netbeans</a> editor is compatible with lombok. + <ol><li> + Add <code>lombok.jar</code> to the project libraries. + </li><li> + In the project properties, in the section <code>Build – Compiling</code>, check the <code>'Enable Annotation Processing in Editor'</code> checkbox. + </li></ol> + + <img src="/img/netbeans-enable-annotation-processing-in-editor.png" /> + </p> + </@s.introduction> +</@s.scaffold> |