Permalink
Browse files

Android work around for module package look up issue

  • Loading branch information...
npurushe committed Dec 3, 2018
1 parent e209295 commit d6d17c08c4ec498eb7efd3c1b2d8039cc3eb3fd9
@@ -27,6 +27,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import java.util.Arrays;
import java.util.Map;
import java.util.Optional;

/**
@@ -44,14 +45,24 @@
private final EntityDescriptor entity;
private final ProcessingEnvironment processingEnvironment;
private final boolean observable;
private final String modulePackage;
private String modulePackage;

AndroidObservableExtension(EntityDescriptor entity,
ProcessingEnvironment processingEnvironment) {
this.entity = entity;
this.processingEnvironment = processingEnvironment;
this.observable = isObservable();
this.modulePackage = processingEnvironment.getOptions().get(MODULE_PACKAGE_OPTION);

// this shouldn't be happening
if (modulePackage == null) {
for(Map.Entry<String, String> entry : processingEnvironment.getOptions().entrySet()) {
if (entry.getKey().endsWith("databinding.modulePackage")) {
modulePackage = entry.getValue();
break;
}
}
}
}

private boolean isObservable() {

0 comments on commit d6d17c0

Please sign in to comment.