Skip to content

Commit

Permalink
Made NucleusProcessor extend BasicAnnotationProcessor of Google auto-…
Browse files Browse the repository at this point in the history
  • Loading branch information
erikhofer committed May 16, 2017
1 parent f7d6148 commit 7581f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.+'
}

Expand All @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions src/main/groovy/com/xinra/nucleus/apt/NucleusProcessor.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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).
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7581f77

Please sign in to comment.