@@ -22,11 +22,16 @@ _Automatic generation of the Builder pattern for Java 1.6+_
22
22
- [ Nested buildable types] ( #nested-buildable-types )
23
23
- [ Builder construction] ( #builder-construction )
24
24
- [ Partials] ( #partials )
25
- - [ IDEs] ( #ides )
26
25
- [ GWT] ( #gwt )
27
- - [ Troubleshooting] ( #troubleshooting )
28
- - [ Javac] ( #javac )
26
+ - [ Build tools and IDEs] ( #build-tools-and-ides )
27
+ - [ javac] ( #javac )
28
+ - [ Maven] ( #maven )
29
+ - [ Gradle] ( #gradle )
29
30
- [ Eclipse] ( #eclipse )
31
+ - [ IntelliJ] ( #intellij )
32
+ - [ Troubleshooting] ( #troubleshooting )
33
+ - [ Troubleshooting javac] ( #troubleshooting-javac )
34
+ - [ Troubleshooting Eclipse] ( #troubleshooting-eclipse )
30
35
- [ Online resouces] ( #online-resouces )
31
36
- [ Alternatives] ( #alternatives )
32
37
- [ AutoValue vs ` @FreeBuilder ` ] ( #autovalue-vs-freebuilder )
@@ -71,18 +76,8 @@ How to use `@FreeBuilder`
71
76
72
77
### Quick start
73
78
74
- Add the ` @FreeBuilder ` artifact as an optional dependency to your Maven POM:
75
-
76
- ``` xml
77
- <dependencies >
78
- <dependency >
79
- <groupId >org.inferred</groupId >
80
- <artifactId >freebuilder</artifactId >
81
- <version >1.0-rc5</version >
82
- <optional >true</optional >
83
- </dependency >
84
- </dependencies >
85
- ```
79
+ _ See [ Build tools and IDEs] ( #build-tools-and-ides ) for how to add ` @FreeBuilder `
80
+ to your project's build and/or IDE._
86
81
87
82
Create your value type (e.g. ` Person ` ) as an interface or abstract class,
88
83
containing an abstract accessor method for each desired field. This accessor
@@ -319,15 +314,6 @@ suite, allowing you to add new required fields or other constraints to an
319
314
existing value type without breaking swathes of test code.
320
315
321
316
322
- ### IDEs
323
-
324
- Follow your IDE's annotation processing instructions [[ Eclipse instructions] [ ] ;
325
- [ IntelliJ instructions] [ ]] .
326
-
327
- [ Eclipse instructions ] : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Fguide%2Fjdt_apt_getting_started.htm
328
- [ IntelliJ instructions ] : http://www.jetbrains.com/idea/webhelp/configuring-annotation-processing.html
329
-
330
-
331
317
### GWT
332
318
333
319
To enable [ GWT] [ ] serialization of the generated Value subclass, just add
@@ -339,11 +325,80 @@ and ensure all necessary types are whitelisted.
339
325
[ CustomFieldSerializer ] : http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/rpc/CustomFieldSerializer.html
340
326
341
327
328
+ Build tools and IDEs
329
+ --------------------
330
+
331
+ ### javac
332
+
333
+ Download [ freebuilder-1.0-rc5.jar] [ ] and add it to the classpath (or
334
+ processorpath, if you supply one) on the command line.
335
+
336
+ [ freebuilder-1.0-rc5.jar ] : http://repo1.maven.org/maven2/org/inferred/freebuilder/1.0-rc5/freebuilder-1.0-rc5.jar
337
+
338
+ ### Maven
339
+
340
+ Add the ` @FreeBuilder ` artifact as an optional dependency to your Maven POM:
341
+
342
+ ``` xml
343
+ <dependencies >
344
+ <dependency >
345
+ <groupId >org.inferred</groupId >
346
+ <artifactId >freebuilder</artifactId >
347
+ <version >1.0-rc5</version >
348
+ <optional >true</optional >
349
+ </dependency >
350
+ </dependencies >
351
+ ```
352
+
353
+ ### Gradle
354
+
355
+ Add the following line to your dependencies:
356
+
357
+ ```
358
+ compile 'org.inferred:freebuilder:1.0-rc5'
359
+ ```
360
+
361
+ ### Eclipse
362
+
363
+ _ Condensed from [ Eclipse Indigo's documentation] [ ] ._
364
+
365
+ Download [ freebuilder-1.0-rc5.jar] [ ] and add it to your project. Right-click it
366
+ and select ** Build path > Add to Build path** .
367
+
368
+ In your projects properties dialog, go to ** Java Compiler > Annotation
369
+ Processing** and ensure ** Enable annotation processing** is checked.
370
+ Next, go to ** Java Compiler > Annotation Processing > Factory Path** , select
371
+ ** Add JARs** , and select ` freebuilder-1.0-rc5.jar ` .
372
+
373
+ [ Eclipse Indigo's documentation ] : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Fguide%2Fjdt_apt_getting_started.htm
374
+
375
+ ### IntelliJ
376
+
377
+ _ Condensed from the [ IntelliJ 14.0.3 documentation] [ ] and [ Auto Issue #106 ] [ ] ._
378
+
379
+ Download [ freebuilder-1.0-rc5.jar] [ ] , add it to your project, right-click it and
380
+ select ** Use as Project Library** .
381
+
382
+ In your Settings, go to ** Build, Execution, Deployment > Compiler > Annotation
383
+ Processors** and ensure ** Enable annotation processing** is selected, and
384
+ ** Store generated sources relative to** is set to * Module content root* .
385
+ (If you have specified a processor path, ensure you add the new JAR to it.
386
+ Similarly, if you choose to specify processors explicitly, add
387
+ ` org.inferred.freebuilder.processor.Processor ` to the list.)
388
+
389
+ Run ** Build > Rebuild Project** , then right-click the new ` generated ` folder
390
+ (this may have a different name if you have changed the ** Production sources
391
+ directory** setting) and select ** Mark Directory As > Generated Sources Root** .
392
+
393
+ [ IntelliJ 14.0.3 documentation ] : http://www.jetbrains.com/idea/webhelp/configuring-annotation-processing.html
394
+ [ Auto Issue #106 ] : https://github.com/google/auto/issues/106
395
+
396
+
342
397
Troubleshooting
343
398
---------------
344
399
345
400
346
- ### Javac
401
+ ### Troubleshooting javac
347
402
348
403
If you make a mistake in your code (e.g. giving your value type a private
349
404
constructor), ` @FreeBuilder ` is designed to output a Builder superclass anyway,
@@ -362,7 +417,7 @@ string "@FreeBuilder type"; nearly all errors include this in their text.
362
417
363
418
[ issue 3 ] : https://github.com/google/FreeBuilder/issues/3
364
419
365
- ### Eclipse
420
+ ### Troubleshooting Eclipse
366
421
367
422
Eclipse manages, somehow, to be worse than ` javac ` here. It will never output
368
423
annotation processor errors unless there is another error of some kind; and,
0 commit comments