Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Gradle incremental annotation processing #2193

Open
WonderCsabo opened this issue Jan 17, 2019 · 2 comments

Comments

@smaugho

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

@WonderCsabo just checking the code in the PrefHandler I found this:

Set<? extends Element> sharedPrefElements = getEnvironment().getValidatedElements().getRootAnnotatedElements(SharedPref.class.getName());
for (Element sharedPrefElement : sharedPrefElements) {
	GeneratedClassHolder sharedPrefHolder = getEnvironment().getGeneratedClassHolder(sharedPrefElement);
	String sharedPrefName = sharedPrefHolder.getGeneratedClass().name();

	if (elementTypeName.equals(sharedPrefName)) {
		prefClass = sharedPrefHolder.getGeneratedClass();
		break;
	}
}

This code assumes that all the @SharedPref annotated classes are being processed in the environment. This would be no that different that what we were talking on #1520. This should break with incremental compilations, since there is no guarantee that the @SharedPref annotated classes would be processed when using incremental compilation.

@WonderCsabo

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2019

We have to check it. The docs says we can access the elements in the annotated elements AST, but i am not sure we will reach it trought the validated elements, maybe we have to do otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.