-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Duplicity in package-info.java when templates are used #921
Comments
If you have a PR with a fix, it's always better :-) |
It looks like FileCompiler.getCompilationUnits() always compiles sources and templates public CompilationUnit[] getCompilationUnits() {
List<SpoonFile> files = new ArrayList<>();
files.addAll(jdtCompiler.sources.getAllJavaFiles());
files.addAll(jdtCompiler.templates.getAllJavaFiles()); but may be it should compile only the required java files - these which are sent as input to JDTBatchCompiler.getUnits(List<SpoonFile> files) I mean stacktrace like this
|
it makes sense |
@monperrus could you please explain the comment "they have to be done all at once"? class JDTBatchCompiler {
...
public CompilationUnitDeclaration[] getUnits(List<SpoonFile> files) {
...
// they have to be done all at once
final CompilationUnitDeclaration[] result = treeBuilderCompiler.buildUnits(getCompilationUnits()); Or can I found some concept of compiler in some documentation/issue/PR? On one side You agree that "it makes sense" to compile only required java files, but on the other side, there is comment |
Hi Pavel, Are you trying to travel from the surface of Spoon to the deepest and As far as I remember, I put this comment after having tried to put the What's sure is that "all at once" referred to the model, not to the |
It is variant which uses non abstract JDTBatchCompiler
It is variant which uses non abstract JDTBatchCompiler
It is variant which uses non abstract JDTBatchCompiler
The package-info.java with this content
prints this not compilable output
when templates are added to the Launcher
See this branch with test to reproduce the problem.
What way do you prefer to contribute new test?
A) branch like this?
B) branch like this + PR?
The text was updated successfully, but these errors were encountered: