Skip to content

Commit

Permalink
注解驱动器中当找不到 @keep@nonnull 注解的时候的错误提示优化
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Dec 5, 2020
1 parent 02e767a commit da34b00
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ public synchronized void init(ProcessingEnvironment processingEnvironment) {
TypeElement keepTypeElement = mElements.getTypeElement(ComponentConstants.ANDROID_ANNOTATION_KEEP);
TypeElement nonNullTypeElement = mElements.getTypeElement(ComponentConstants.ANDROID_ANNOTATION_NONNULL);

// androidx 和 非 androidx 的两个注解
mClassNameKeep = ClassName.get(keepTypeElement);
mClassNameNonNull = ClassName.get(nonNullTypeElement);

if (mClassNameKeep == null || mClassNameNonNull == null) {
if (keepTypeElement == null || nonNullTypeElement == null) {
String addDependencyTip = getAddDependencyTip(Arrays.asList(
ComponentConstants.ANDROID_ANNOTATION_KEEP,
ComponentConstants.ANDROID_ANNOTATION_NONNULL
Expand All @@ -139,6 +135,10 @@ public synchronized void init(ProcessingEnvironment processingEnvironment) {
"\n else see https://github.com/xiaojinzi123/Component/wiki/%E4%BE%9D%E8%B5%96%E5%92%8C%E9%85%8D%E7%BD%AE");
}

// androidx 和 非 androidx 的两个注解
mClassNameKeep = ClassName.get(keepTypeElement);
mClassNameNonNull = ClassName.get(nonNullTypeElement);

}

protected String getAddDependencyTip(List<String> classPathList, boolean isOr) {
Expand Down

0 comments on commit da34b00

Please sign in to comment.