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

CompilationUnit: Get path of .class file from CompilationUnit #1230

Closed
msteinbeck opened this issue Mar 17, 2017 · 2 comments · Fixed by #1232
Closed

CompilationUnit: Get path of .class file from CompilationUnit #1230

msteinbeck opened this issue Mar 17, 2017 · 2 comments · Fixed by #1232
Labels

Comments

@msteinbeck
Copy link
Contributor

Is it possible to get the file path of the class file of a compilation unit? If not, would you mind if I would add such a feature?

@monperrus
Copy link
Collaborator

monperrus commented Mar 17, 2017 via email

@msteinbeck
Copy link
Contributor Author

msteinbeck commented Mar 17, 2017

I'm looking for a method like this:

...
public List<File> getBinaryFiles() {
    // for each type declaration return .class file
}
...

This allows me to delete outdated .class files with ease. I need this for my incremental compilation approach where I'm extracting outdated files and compile them by adding the unchanged .class files to the classpath. Since a single .java file might be compiled to several .class files, getBinaryFiles should return a list of files.

Edit: This issue is related to #1175

msteinbeck pushed a commit to msteinbeck/spoon that referenced this issue Mar 17, 2017
@surli surli added the feature label Mar 20, 2017
surli pushed a commit that referenced this issue Mar 21, 2017
* Add 'getBinaryFiles' to CompilationUnit. Fixes #1230.

* Add tests for 'getBinaryFiles'.

* Remove unsued imports.

* Add test for anonymous classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants