Start implementing a subset of Apache Velocity with the intent of migrating AutoValue from Velocity to this reimplementation. The Velocity Template Language is a good way of expressing code generation, especially when using any of the many editors that support it; but Apache Velocity has caused many headaches, especially because of its pervasive use of reflection. In addition to the many workarounds, we have been unable to maven-shade Velocity, which causes problems when other libraries are present that use a different Velocity version. (See https://github.com/google/auto/issues/210.)

I have a complete prototype implementation at https://github.com/eamonnmcmanus/auto/tree/escapevelocity but I am proposing to break it down into somewhat more manageable chunks for code review. This chunk defines the basic API for creating and using templates, but only supports a small subset of the language. The next steps are to add support for expressions and for directives (#if, #set, etc). Support for macros should probably be in a separate step, because of the non-obvious nature of the call-by-name semantics they use. Then the final step will be to switch AutoValue to using the reimplementation, and ditch Velocity.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=94517530
11 files changed
tree: 5a82bba90ec5f137bfdc9dcfbe3351dd58c9c989
  1. common/
  2. factory/
  3. service/
  4. util/
  5. value/
  6. .gitignore
  7. .travis.yml
  8. build-pom.xml
  9. checkstyle.xml
  10. CONTRIBUTING.md
  11. LICENSE.txt
  12. pom.xml
  13. README.md
README.md

Auto

A collection of source code generators for Java.

Auto‽

Java is full of code that is mechanical, repetitive, typically untested and sometimes the source of subtle bugs. Sounds like a job for robots!

The Auto subprojects are a collection of code generators that automate those types of tasks. They create the code you would have written, but without the bugs.

Save time. Save code. Save sanity.

Subprojects

  • AutoFactory - JSR-330-compatible factories

    Latest version: 0.1-beta2

  • AutoService - Provider-configuration files for ServiceLoader

    Latest version: 1.0-rc2

  • AutoValue - Immutable value-type code generation for Java 1.6+.

    Latest version: 1.1

  • Common - Helper utilities for writing annotation processors.

    Latest version: 0.4

License

Copyright 2013 Google, Inc.

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

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.