Silence the JavacFiler warning 'compiler.warn.proc.unclosed.type.files' #1084
Conversation
I can't reproduce the failure of the Travis CI build locally. Is this a maven-android-plugin issue? |
I never experienced this warning before. What is your platform etc. |
I use androidannotations in Android Studio-0.82 gradle scripts with help from newest android-apt. On OS X 10.9.4. This warning can be seen in other androidannotations issues: and a quick google search turns up quite a few hits: |
It was also suggested that an issue should be opened for this: #676 (comment) |
I confirm the warning using gradle with OSX. |
I am not sure it is the good idea to pollute the generated class folder with these files. What is the source of the issue, maybe a gradle bug? |
I changed the patch so as to avoid creating the dummy file. Files created via the createResource method are not registered for annotation |
Nice, i like this way much better. I do not know what's the problem with the Travis build. Can you please add |
Here is a Travis build with The same problem is discussed in these issues: |
I suspect what could be the problem. Travis does not install the build tools SDK component by default anymore. Unfortunetaly i cannot try that out because i am AFK for some time, can you create another PR with exlicitly installing build-tools in the Travis script? |
This prevents warnings like: warning: Unclosed files for the types '[dummy1407426008266]'; these types will not undergo annotation processing Files created via the createResource method are not registered for annotation processing (as opposed to files created by the createSourceFile method), so we avoid the JavacFiler warning and we don't have to open/close a stream.
I tested this PR, and i found no regressions with command line maven or with Eclipse. @yDelouis can you try with a gradle project so the root issue is indeed resolved? |
Silence the JavacFiler warning 'compiler.warn.proc.unclosed.type.files'
Tested with gradle on mac. The warning disappeared and the compilation works fine. |
Actually i found out this also happened with maven. At least with |
Great job 👍 I was wondering how to resolve this for a while |
This prevents warnings like:
warning: Unclosed files for the types '[dummy1407426008266]'; these types will not undergo annotation processing
originating from com.sun.tools.javac.processing.JavacFiler.warnIfUnclosedFiles.
It works by opening and closing an OutputStream on the dummy JavaFileObject,
thereby clearing the dummy filename from the JavacFilers internal openTypeNames set.
Note, this will result in a an empty dummy file, e.g. build/generated/source/apt/debug/dummy1407426008266.java