-
Notifications
You must be signed in to change notification settings - Fork 2
Setting Up the Development Environment
-
The following instructions are useful when working with a version of the checker framework other than a released version. The instructions should be adapted to the mirrored git repositories of the checker framework project. Install the Checker Framework from source.
cd ~/hg
hg clone https://code.google.com/p/jsr308-langtools/ jsr308-langtools
hg clone https://code.google.com/p/checker-framework/ checker-framework
hg clone https://code.google.com/p/annotation-tools/ annotation-tools
export JAVA_HOME=${JAVA_HOME:-$(dirname $(dirname $(dirname $(readlink -f $(/usr/bin/which java)))))}
- Ensure that
echo $JAVA_HOME
prints the path to an installation of Java 8. cd ~/hg/jsr308-langtools/make
ant clean-and-build-all-tools
export PATH=$HOME/hg/jsr308-langtools/dist/bin:${PATH}
cd ~/hg/annotation-tools
ant
cd ~/hg/checker-framework/checkers
ant
ant all-tests
-
Clone the Eclipse plug-ins for inferring type qualifiers.
cd ~/git/cascade
git clone [email protected]:reprogrammer/cascade.git
cd ~/git/cascade
git submodule init
git submodule update
-
Install Eclipse Kepler SR2 with Java 8 Support or a later version of Eclipse with Java 8 support.
-
Change the JDK compliance level of the Eclipse workspace to 1.8.
-
Set the Eclipse Java formatter to
checker-framework/checkers/eclipse/checker-framework-formatter.xml
. -
Import the Eclipse projects from the following folders into Eclipse.
deps/checker-framework/eclipse
~/git/cascade/plugins
-
If Eclipse reports problems in the form
Package X does not exist in this plug-in
in fileMANIFEST.MF
ofchecker-framework-eclipse-plugin
, do the following.- Apply the patch at
patches/checker-framework.diff
using the commandgit apply ../../patches/checker-framework.diff
. This patches makes these changes:- Add the JAR files that you copied to the build path of the enclosing Eclipse project.
- Ensure that list of packages in the field
Export-Package
are correct.
- Copy the JAR files listed in attribute
Bundle-ClassPath
fromdeps/checker-framework-releases/checker-framework/checkers/binary
todeps/checker-framework/eclipse/checker-framework-eclipse-plugin/lib
.
- Apply the patch at
-
Your workspace should look like the screenshot below after importing the above projects.
-
Create an Eclipse launch configuration as shown below to run the inference tool.
-
This step should be safe to skip with the latest release of Eclipse that supports Java 8. To use Java 8 syntax in an Eclipse project, create a folder called
.settings
in the project. Then, add a file to this folder with nameorg.eclipse.jdt.core.prefs
and the following contents:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8