diff --git a/build.gradle b/build.gradle index 3022aea..d291d21 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'com.novoda.bintray-release' sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = '0.1.1' +version = '0.2.0' jar { manifest { @@ -30,6 +30,7 @@ dependencies { compile 'com.squareup:javapoet:1.7.0' compile 'com.google.guava:guava:21.0' compile 'org.codehaus.groovy:groovy:2.4.7' + compile 'com.google.auto:auto-common:0.8' testCompile group: 'junit', name: 'junit', version: '4.+' } @@ -38,7 +39,7 @@ publish { repoName = 'nucleus' groupId = 'com.xinra.nucleus' artifactId = 'nucleus-apt' - publishVersion = '0.1.1' + publishVersion = '0.2.0' licences = ['BSD 3-Clause'] desc = 'Library for creating annotation processors ' website = 'https://github.com/xinra-nucleus/nucleus-apt' diff --git a/src/main/groovy/com/xinra/nucleus/apt/NucleusProcessor.java b/src/main/groovy/com/xinra/nucleus/apt/NucleusProcessor.java index 1993b12..22cb495 100644 --- a/src/main/groovy/com/xinra/nucleus/apt/NucleusProcessor.java +++ b/src/main/groovy/com/xinra/nucleus/apt/NucleusProcessor.java @@ -1,10 +1,10 @@ package com.xinra.nucleus.apt; +import com.google.auto.common.BasicAnnotationProcessor; import com.squareup.javapoet.AnnotationSpec; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import javax.annotation.Generated; -import javax.annotation.processing.AbstractProcessor; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.tools.Diagnostic; @@ -14,7 +14,7 @@ * * @author Erik Hofer */ -public abstract class NucleusProcessor extends AbstractProcessor { +public abstract class NucleusProcessor extends BasicAnnotationProcessor { /** * Emits an error message (will be displayed in the IDE). @@ -47,7 +47,7 @@ public AnnotationSpec getGeneratedAnnotation(String comments) { AnnotationSpec.Builder builder = AnnotationSpec.builder(Generated.class) .addMember("value", "$S", this.getClass().getName()) .addMember("date", "$S", ZonedDateTime.now().format(DateTimeFormatter.ISO_INSTANT)); - if(comments != null) { + if (comments != null) { builder.addMember("comments", "$S", comments); } return builder.build();