Skip to content

Instantly share code, notes, and snippets.

View zskamljic's full-sized avatar

Žan Skamljič zskamljic

View GitHub Profile
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE)
public @interface Depend {
}
// Android gradle plugin 3.0+
compileOnly project(':annotations')
// Android gradle plugin < 3.0
provided project(':annotations')
@Depend
protected String name;
com.equaleyes.processor.DependProcessor
@Override
public Set getSupportedAnnotationTypes() {
return new LinkedHashSet() {{
add(Depend.class.getCanonicalName());
}};
}
Map<Element, List> dependants = new HashMap<>();
Set<? extends Element> fields = roundEnvironment.getElementsAnnotatedWith(Depend.class);
field.getModifiers().contains(Modifier.PRIVATE)
Element parent = field.getEnclosingElement();
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
super.init(processingEnvironment);
elementUtils = processingEnvironment.getElementUtils();
filer= processingEnvironment.getFiler();
messager= processingEnvironment.getMessager();
}