proton

Utilities to help testing annotation processors

APACHE-2.0 License

Stars
2
Committers
1

Bot releases are hidden (Show)

proton - v0.43

Published by realityforge over 4 years ago

Changes in this release:

  • Add the method assertDiagnostic(...) that accepts a compilation, a diagnostic and a message contents to the AbstractProcessorTest class. Also added assertErrorDiagnostic(...) and assertWarningDiagnostic(...) helper methods to make testing the most common diagnostic error messages easy. Deprecated the existing assertDiagnosticPresent(...) method as it's functionality has been subsumed by the new methods.
proton - v0.42

Published by realityforge over 4 years ago

Changes in this release:

  • Extract the AbstractStandardProcessor.getNewTypeElementsToProcess() utility method.
proton - v0.41

Published by realityforge over 4 years ago

Changes in this release:

  • Add AbstractProcessorTest.newSynthesizingProcessor(...) helper methods that create an annotation processor that will "generate" source in a particular processor round. The generation actually just consists of reading a fixture from the filesystem and passing it to the compiler. This utility is useful when testing annotation processors that defer processing until later rounds based on whether the types that they are acting on are fully resolved or have unknown elements present.
proton - v0.40

Published by realityforge over 4 years ago

Changes in this release:

  • Import TypesUtil class that contain helper methods that work solely on types.
proton - v0.39

Published by realityforge over 4 years ago

Changes in this release:

  • Add some additional debugging when actually performing an action on an TypeElement.
  • Add AbstractProcessorTest.assertDiagnosticPresent method to help when performing explicit staged compiled during testing.
proton - v0.38

Published by realityforge over 4 years ago

Changes in this release:

  • Refactor AbstractStandardProcessor.processTypeElements() to work when the annotation processor is responsible for processing multiple different top-level types.
  • Add helper method AbstractStandardProcessor.readBooleanOption(...) that simplifies reading boolean annotation options.
  • Cache resolution of annotation properties in AbstractStandardProcessor.init(...).
  • Mark AbstractStandardProcessor.errorIfProcessingOverAndDeferredTypesUnprocessed(...) as private as should never be invoked by subclasses.
  • Add support for a debug annotation option that prints out debug messages based on whether types are processed in a round. Add a method AbstractStandardProcessor.debug(...) that can be used by downstream libraries to emit debug messages.
proton - v0.37

Published by realityforge over 4 years ago

Changes in this release:

  • Fix incorrect annotation name in the AnnotationsUtil.hasNullableAnnotation(...) helper method.
proton - v0.36

Published by realityforge over 4 years ago

Changes in this release:

  • Change the way that that AbstractStandardProcessor handles deferring of unresolved types. Previously the code assumed that the annotation processors would only have a single call to AbstractStandardProcessor.processTypeElements() within each annotation processor which meant that there was only one callback that was ever invoked so that deferred types could be added if they have been resolved since the last processor round. However toolkits such as Sting that process multiple different categories of top-level TypeElement instances would have get have resolved types from incorrect categories processed in incorrect callbacks. This is a breaking change that will result in rework of downstream libraries.
  • Remove the deprecated AnnotationUtils.getAnnotationValue() method and rename the AnnotationUtils._getAnnotationValue() to AnnotationUtils.getAnnotationValue(). This backwards incompatible change was made in this version so all incompatible changes are made in a single release.
  • Migrate GeneratorUtil.getPackageElement(...) to ElementsUtil.
  • Migrate GeneratorUtil.areTypesInDifferentPackage(...) to ElementsUtil.
  • Migrate GeneratorUtil.areTypesInSamePackage(...) to ElementsUtil.
  • Add AnnotationsUtil.hasNullableAnnotation(...) helper method.
  • Move and rename nullability annotation classname constants to AnnotationsUtil.
proton - v0.35

Published by realityforge over 4 years ago

Changes in this release:

  • Add ElementsUtil.isSynthetic(Element) and ElementsUtil.isNotSynthetic(Element) helper methods.
proton - v0.34

Published by realityforge over 4 years ago

Changes in this release:

  • Expose GeneratorUtil.ANNOTATION_WHITELIST as a public field.
proton - v0.33

Published by realityforge over 4 years ago

Changes in this release:

  • Add some additional utility methods MemberChecks.must(...) and MemberChecks.mustNot(...).
proton - v0.32

Published by realityforge over 4 years ago

Changes in this release:

  • Make AnnotationsUtil.findAnnotationValue() public.
  • Deprecate AnnotationsUtil.getAnnotationValue(...) in favour of AnnotationsUtil.getAnnotationValueValue(...) as a future version of the library will add a AnnotationsUtil.getAnnotationValue(...) that returns an AnnotationValue.
proton - v0.31

Published by realityforge over 4 years ago

Changes in this release:

  • Upgrade the com.google.truth artifact to version 0.45.
  • Upgrade the com.google.testing.compile artifact to version 0.18-rf.
  • Enhance ProcessorException so that it accepts optional AnnotationMirror and AnnotationValue parameters.
proton - v0.30

Published by realityforge over 4 years ago

Changes in this release:

  • Add AbstractProcessorTest.input(...) helper method.
  • Add AbstractProcessorTest.assertCompilationUnsuccessful(...) helper method.
proton - v0.29

Published by realityforge over 4 years ago

Changes in this release:

  • Add ElementsUtil.isElementDeprecated(Element) helper method.
  • Add ElementsUtil.isEffectivelyPublic(Element) helper method.
  • Add AbstractStandardProcessor.errorIfProcessingOverAndDeferredTypesUnprocessed() helper method.
proton - v0.27

Published by realityforge over 4 years ago

Changes in this release:

  • Improve compatibility with other javac compilers by using TypeMirror.getKind() to get the kind of the TypeMirror rather than using instanceof DeclaredType etc as some compiler have TypeMirror implement interfaces even if they are not of that type.
  • Fix a bug where deprecated methods may not be detected and may not have appropriate suppressions added in SuppressWarningsUtil
proton - v0.26

Published by realityforge over 4 years ago

Changes in this release:

  • Extract AbstractProcessorTest.processors() to simplify getting complete set of processors in downstream projects.
  • Extract AbstractProcessorTest.compiler() to simplify setup of compiler.
  • In the AbstractStandardProcessor class, stop emitting duplicate error messages if the error is about an Element that was not part of the current compilation round.
  • Add a new annotation processor parameter myprefix.verbose_out_of_round.errors that controls whether Element that were not compiled in the current round that cause errors will produce verbose error messages to make it easier for IDE users to locate the source of the errors.
proton - v0.25

Published by realityforge over 4 years ago

Changes in this release:

  • Add AbstractProcessorTest.buildClasspath(File...), AbstractProcessorTest.describeFailureDiagnostics(Compilation) and AbstractProcessorTest.assertCompilationSuccessful(Compilation) to make it easier for downstream tests to support multi-stage compilations while still generating useful errors when failures occur.
proton - v0.24

Published by realityforge over 4 years ago

Changes in this release:

  • Add AbstractProcessorTest.outputFiles(...) overloaded method that omits the filter under the assumption that all files are emitted to the target directory. This is useful when building up multi-stage compiles and all output should be written to the target directory so that it can be picked up by a subsequent compile stage
proton - v0.23

Published by realityforge over 4 years ago

Changes in this release:

  • Refactor AbstractProcessorTest.outputFile() and invoke it from existing test infrastructure.