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

Comments

Projects
None yet
3 participants
@msteinbeck
Contributor

msteinbeck commented Mar 17, 2017

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

This comment has been minimized.

Show comment
Hide comment
@monperrus

monperrus Mar 17, 2017

Collaborator
Collaborator

monperrus commented Mar 17, 2017

@msteinbeck

This comment has been minimized.

Show comment
Hide comment
@msteinbeck

msteinbeck Mar 17, 2017

Contributor

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

Contributor

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 surli closed this in #1232 Mar 21, 2017

surli added a commit that referenced this issue Mar 21, 2017

Add 'getBinaryFiles' to CompilationUnit. Fixes #1230. (#1232)
* 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