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

Analyze Java without running the build #969

Closed
martinschaef opened this issue Jul 25, 2018 · 3 comments
Closed

Analyze Java without running the build #969

martinschaef opened this issue Jul 25, 2018 · 3 comments

Comments

@martinschaef
Copy link

Is there a way to run infer without executing the javac commands? I have a mechanism in place that creates something like a compilation-database of my java build with all the javac commands and all the arguments. Now, I want to run infer on that data without actually executing the build again. Is there a way to do that?

@jeremydubreil
Copy link
Contributor

Yes, if you know where the source files are and where the build command saved the compiled class files, you can run:

infer --classpath <path to the standard library CLASSPATH used by the build> --generated-classes <path to compiled class> --sourcepath <path to source files>

and Infer will try to match the compiled classes and the source files by matching the package declaration in the bytecode with the path of the files in the filesystem hierarchy.

@martinschaef
Copy link
Author

That works! Thanks. Are these options documented? infer --help didn't report them

@SolomonSun2010
Copy link

Good.

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

No branches or pull requests

3 participants