<commit_before>---
layout: post
title: autovalue - create immutable value types using annotation processor support from a Gradle build
category: java
tags: autovalue gradle
published: true
summary: using autovalue
---

# AutoValue - create immutable value types using annotation processor support 

## [https://github.com/google/auto](https://github.com/google/auto)

#### Intro

This is used to create immutable value types using Javac annotation processor support from within the Gradle JavaCompile task.

[Why?, What? and How?](https://docs.google.com/presentation/d/14u_h-lMn7f1rXE1nDiLX0azS3IkgjGl5uxp5jGJ75RE/edit?pli=1#slide=id.g2a5e9c4a8_00)

#### Setup

Gradle 2.1 introduces a simpler plugin specification. This improves project build scaffolding where it can be shared without the copy/pasta blocks of xml (maven) or groovy script.

The Gradle community plugins listing [https://plugins.gradle.org](https://plugins.gradle.org).

The build.gradle below uses the local java plugin and [ewerk auto-value-plugin](https://github.com/ewerk/gradle-plugins/tree/master/auto-value-plugin).
<commit_msg>Update 2014-12-11-Autovalue.md<commit_after>---
layout: post
title: Autovalue - create immutable value types using annotation processor support from a Gradle build
category: java
tags: autovalue gradle
published: true
summary: using autovalue
---

# AutoValue - create immutable value types using annotation processor support 

## [https://github.com/google/auto](https://github.com/google/auto)

#### Intro

This is used to create immutable value types using Javac annotation processor support from within the Gradle JavaCompile task.

[Why?, What? and How?](https://docs.google.com/presentation/d/14u_h-lMn7f1rXE1nDiLX0azS3IkgjGl5uxp5jGJ75RE/edit?pli=1#slide=id.g2a5e9c4a8_00)

#### Setup

Gradle 2.1 introduces a simpler plugin specification. This improves project build scaffolding where it can be shared without the copy/pasta blocks of xml (maven) or groovy script.

The Gradle community plugins listing [https://plugins.gradle.org](https://plugins.gradle.org).

The build.gradle below uses the local java plugin and [ewerk auto-value-plugin](https://github.com/ewerk/gradle-plugins/tree/master/auto-value-plugin).

{'fraction_non_alphanumeric': 0.0997752808988764, 'fraction_numerical': 0.02247191011235955, 'mean_word_length': 5.081967213114754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1856490', 'n_tokens_mistral': 718, 'n_tokens_neox': 669, 'n_words': 213}