Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,31 @@ In Maven, you can write:
</plugins>
```

Alternatively, you can include the processor itself (which transitively depends
on the annotation) in your compile-time classpath. (However, note that doing so
may pull unnecessary classes into your runtime classpath.)
Previous versions of these instructions suggested an alternative configuration,
where the `com.google.auto.service:auto-service` dependency itself was an
`optional` dependency. We no longer recommend that configuration. (It may pull
unnecessary classes into your runtime classpath, and it may produce
[warnings or errors][JDK-8321319] under recent versions of Java.)

```xml
<dependencies>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${version}</version>
<optional>true</optional>
</dependency>
</dependencies>
```
[JDK-8321319]: https://bugs.openjdk.org/browse/JDK-8321319

## License

Copyright 2013 Google LLC
```
Copyright 2013 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

[java]: https://en.wikipedia.org/wiki/Java_(programming_language)
[sl]: http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html
26 changes: 10 additions & 16 deletions value/userguide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ abstract class Animal {
The constructor parameters correspond, in order, to the abstract accessor
methods.

**For a nested class**, see ["How do I use AutoValue with a nested class"](howto.md#nested).
**For a nested class**, see
["How do I use AutoValue with a nested class"](howto.md#nested).

Note that in real life, some classes and methods would presumably be public and
have Javadoc. We're leaving these off in the User Guide only to keep the
Expand Down Expand Up @@ -138,19 +139,11 @@ For `auto-value` (the annotation processor), you can write this:
</build>
```

Alternatively, you can include the processor itself in your compile-time
classpath. Doing so may pull unnecessary classes into your runtime classpath.

```xml
<dependencies>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
```
Previous versions of these instructions suggested an alternative configuration,
where the `com.google.auto.value:auto-value` dependency itself was an
`optional` dependency. We no longer recommend that configuration. (It may pull
unnecessary classes into your runtime classpath, and it may produce
[warnings or errors][JDK-8321319] under recent versions of Java.)

### With Gradle

Expand All @@ -169,6 +162,7 @@ instead of `compileOnly`. If you are using a version prior to 4.6, you must
apply an annotation processing plugin
[as described in these instructions][tbroyer-apt].

[JDK-8321319]: https://bugs.openjdk.org/browse/JDK-8321319
[tbroyer-apt]: https://plugins.gradle.org/plugin/net.ltgt.apt

### <a name="usage"></a>Usage
Expand Down Expand Up @@ -214,8 +208,8 @@ extends your abstract class, having:
Your hand-written code, as shown above, delegates its factory method call to the
generated constructor and voilà!

For the `Animal` example shown above, here is [typical code AutoValue might
generate](generated-example.md).
For the `Animal` example shown above, here is
[typical code AutoValue might generate](generated-example.md).

Note that *consumers* of your value class *don't need to know any of this*. They
just invoke your provided factory method and get a well-behaved instance back.
Expand Down
Loading