make sure that the Infer out directory is empty before generating the models

Summary:
public
While playing with the type environment for Java, I realised that the types in models.jar where not re-generated when modifying Infer. As a consequence, some changes in Infer where surprisingly having no effect. This diff forces the type environment to be absent when analyzing the models.

Reviewed By: sblackshear

Differential Revision: D2802517

fb-gh-sync-id: 1c2673a
master
jrm 9 years ago committed by facebook-github-bot-5
parent f2240395dd
commit 51cd3ded47

@ -28,9 +28,11 @@ all: $(MODELS_JAR)
clean: clean:
@rm -fr $(MODELS_OUT) @rm -fr $(MODELS_OUT)
@rm -f $(MODELS_JAR)
@rm -f $(DEPLOYED_MODELS_JAR) @rm -f $(DEPLOYED_MODELS_JAR)
$(INFER_REPORT): $(ANDROID_JAR) $(JACKSON_JAR) $(JAVA_SOURCES) $(JAVA_DEPS) $(INFER_REPORT): $(ANDROID_JAR) $(JACKSON_JAR) $(JAVA_SOURCES) $(JAVA_DEPS)
@rm -fr $(MODELS_OUT)
mkdir -p $(MODELS_OUT) mkdir -p $(MODELS_OUT)
@rm -f $(DEPLOYED_MODELS_JAR) @rm -f $(DEPLOYED_MODELS_JAR)
$(INFER) -- javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(JACKSON_JAR) $(JAVA_SOURCES) $(INFER) -- javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(JACKSON_JAR) $(JAVA_SOURCES)

@ -123,6 +123,12 @@ let load_tenv program =
begin begin
match Sil.load_tenv_from_file tenv_filename with match Sil.load_tenv_from_file tenv_filename with
| None -> Sil.create_tenv () | None -> Sil.create_tenv ()
| Some _ when Config.analyze_models ->
let error_msg =
"Unexpected tenv file "
^ (DB.filename_to_string tenv_filename)
^ " found while generating the models" in
failwith error_msg
| Some tenv -> tenv | Some tenv -> tenv
end end
else else

Loading…
Cancel
Save