typetools / checker-framework-inference

Inference of pluggable types for Java
10 stars 33 forks source link

Intellij support for checker framework inference #93

Open shashiranjan opened 5 years ago

shashiranjan commented 5 years ago

Also where can I specify project name or project source path for which I want to run inference script ? I ran the below command and it failed.

 ./scripts/inference --logLevel FINE --mode TYPECHECK --checker ostrusted.OsTrustedChecker --solver checkers.inference.solver.PropagationSolver -afud [source_file_path_for_which_I_want_to_run_this_script]

--- Typechecking ---

javac: invalid flag: source_file_path_for_which_I_want_to_run_this_script
Usage: javac <options> <source files>
use -help for a list of possible options

--- Typechecking failed ---

I couldn't find any step by step instructions with example for running this tool on command line or on intellij. Suppose I have a java project on intellij how do I run this tool to auto generate type inference code from command line or from intellij?

Thanks, Shashi

jyluo commented 5 years ago

Hi @shashiranjan ,

As the readme says, the correct command structure is

./scripts/inference --log-level FINE --mode MODE --checker CHECKER --solver SOLVER -afud /path/to/Annotation/File/Utilities/output/directory [List of files]

The path given after -afud is where CFI will output annotated source code. The list of files following the AFUD path is the list of java source files for which CFI will perform type check or inference on depending on the mode chosen.

If you only intend to run in typecheck mode, then -afud and the path can be omitted.

There isn't an Intellij plugin for CFI, but you might be able to configure Intellij to run scripts/inference as a shell script with the command line options and supply the list of Java files.