Skip to content

Commit a0f3a41

Browse files
jyluowmdietl
authored andcommitted
Fix inference-dev script and update Eclipse project config (#78)
1 parent 63373da commit a0f3a41

File tree

6 files changed

+49
-24
lines changed

6 files changed

+49
-24
lines changed

.classpath

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" path="src"/>
4-
<classpathentry kind="src" path="tests"/>
5-
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
6-
<classpathentry combineaccessrules="false" kind="src" path="/annotation-file-utilities"/>
7-
<classpathentry combineaccessrules="false" kind="src" path="/dataflow"/>
8-
<classpathentry combineaccessrules="false" kind="src" path="/jsr308-langtools"/>
9-
<classpathentry combineaccessrules="false" kind="src" path="/scene-lib"/>
10-
<classpathentry combineaccessrules="false" kind="src" path="/checker"/>
11-
<classpathentry combineaccessrules="false" kind="src" path="/framework"/>
12-
<classpathentry combineaccessrules="false" kind="src" path="/javacutil"/>
13-
<classpathentry combineaccessrules="false" kind="src" path="/plume-lib"/>
14-
<classpathentry kind="lib" path="dist/gson-1.7.2.jar"/>
15-
<classpathentry kind="lib" path="dist/json-simple-1.1.1.jar"/>
16-
<classpathentry kind="lib" path="dist/mockito-all-1.8.4.jar"/>
17-
<classpathentry kind="lib" path="dist/org.ow2.sat4j.core-2.3.4.jar"/>
18-
<classpathentry kind="lib" path="dist/org.ow2.sat4j.core-2.3.4-tests.jar"/>
19-
<classpathentry kind="lib" path="dist/org.ow2.sat4j.maxsat-2.3.4.jar"/>
20-
<classpathentry kind="lib" path="dist/org.ow2.sat4j.pb-2.3.4.jar"/>
21-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
22-
<classpathentry kind="output" path="bin"/>
3+
<classpathentry kind="src" output="build/classes/java/main" path="src"/>
4+
<classpathentry kind="src" output="build/classes/java/test" path="tests"/>
5+
<classpathentry kind="src" path="/checker"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
7+
<classpathentry kind="lib" path="dist/dependencies.jar"/>
8+
<classpathentry kind="output" path="build/default"/>
239
</classpath>

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ tags
3030
*.orig
3131
.DS_Store
3232

33+
# Gradle outputs
34+
/build/

.travis-build.sh

+3
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ set -e
77
export SHELLOPTS
88

99
. ./.travis-build-without-test.sh
10+
11+
./gradlew testCheckerInferenceDevScript
12+
1013
./gradlew test

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,30 @@ https://drive.google.com/drive/u/1/folders/0B7vOZvme6aAOfjQ0bWlFU1VoeVZCVjExVmJL
2727
That information is being moved to here in the repository.
2828

2929

30-
Requirements
30+
Configure Eclipse to edit Checker Framework Inference
3131
------------
3232

33+
The instructions here assumes you have cloned this project into a folder called `checker-framework-inference`.
34+
35+
1) Follow the instructions in the [Checker Framework Manual](https://checkerframework.org/manual/#building-eclipse)
36+
to download, build, and configure Eclipse to edit the Checker Framework. The Checker Framework Inference Eclipse
37+
project depends on the eclipse projects from Checker Framework.
38+
39+
2) Follow the instructions below to build Checker Framework Inference
40+
41+
3) Build the dependencies jar file:
42+
43+
````
44+
gradle dependenciesJar
45+
````
46+
47+
4) Enter the main Eclipse working screen and in the “File” menu, select “Import” -> “General” -> “Existing Projects into workspace”.
48+
After the “Import Projects” window appears, select “Select Root Directory”, and select the `checker-framework-inference` directory.
49+
Eclipse should successfully build all the imported projects.
50+
51+
Requirements
52+
===============
53+
3354
You will need a JDK (version 8) and gradle.
3455

3556
Following the instructions in the Checker Framework manual to install the Checker Framework from source.

build.gradle

+11-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dependencies {
4545
compile files("${checkerJar}")
4646
compile 'org.plumelib:options:0.3.1'
4747
// Serialize constraints
48-
compile 'com.googlecode.json-simple:json-simple:1.1.1'
48+
compile 'com.googlecode.json-simple:json-simple:1.1'
4949
// Pretty print serialized constraints
5050
compile 'com.google.code.gson:gson:1.7.2'
5151

@@ -148,6 +148,7 @@ task dependenciesJar(type: Jar) {
148148
description 'Create a jar file with all the dependencies.'
149149
from {
150150
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
151+
configurations.testCompile.collect { it.isDirectory() ? it : zipTree(it) }
151152
}
152153
archiveName 'dependencies.jar'
153154
destinationDir file("${projectDir}/dist/")
@@ -192,6 +193,15 @@ task release(type: Zip) {
192193
baseName = 'release'
193194
}
194195

196+
task testCheckerInferenceDevScript(type: Exec, dependsOn: [dist, dependenciesJar]) {
197+
description 'Basic sanity check of scripts/inference-dev'
198+
executable './scripts/inference-dev'
199+
args = ['--mode', 'INFER',
200+
'--checker', 'interning.InterningChecker',
201+
'--solver', 'checkers.inference.solver.MaxSat2TypeSolver',
202+
'testdata/interning/MapAssignment.java']
203+
}
204+
195205
/// Commented out because plugins section is commented out
196206
// /* Configuration for formatting */
197207
// googleJavaFormat {

scripts/inference-dev

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ annoToolsDir="$ROOT"/annotation-tools
2424
stubparserDir="$ROOT"/stubparser
2525
cfDir="$ROOT"/checker-framework
2626
cfiDir="$ROOT"/checker-framework-inference
27+
afuDir="${annoToolsDir}"/annotation-file-utilities
28+
classes="build/classes/java"
29+
resources="build/resources/main"
2730

2831
distDir="$cfiDir"/dist
2932

30-
jdkPaths="${cfDir}"/jdk/annotated
33+
jdkPaths="${cfDir}"/checker/dist/jdk8.jar
3134

32-
CFBuild="${langtoolsDir}"/build/classes:"${annoToolsDir}"/scene-lib/bin:"${cfDir}"/dataflow/build:"${cfDir}"/javacutil/build:"${stubparserDir}"/stubparser.jar:"${cfDir}"/framework/build:"${cfDir}"/checker/build
35+
CFBuild="${cfDir}"/dataflow/"${classes}":"${cfDir}"/javacutil/"${classes}":"${cfDir}"/framework/"${classes}":"${cfDir}"/framework/"${resources}":"${cfDir}"/checker/"${classes}":"${cfDir}"/checker/"${resources}":"${annoToolsDir}"/scene-lib/bin:"${langtoolsDir}"/build/classes:"${stubparserDir}"/javaparser-core/stubparser.jar:"${afuDir}"/lib/options-all-0.3.1.jar:"${afuDir}"/lib/plume-util-0.0.1.jar:"${afuDir}"/lib/guava-20.0.jar
3336

3437
CFIBuild="${cfiDir}/build/classes/java/main"
3538

0 commit comments

Comments
 (0)