Java: Update the Java model re-generate script.

This commit is contained in:
Michael Nebel
2022-12-01 19:24:16 +01:00
parent 243b94b54a
commit a9ba964be4

View File

@@ -5,19 +5,17 @@
from pathlib import Path
import json
import os
import requests
import shutil
import subprocess
import tempfile
import sys
defaultModelPath = "java/ql/lib/semmle/code/java/frameworks"
lgtmSlugToModelFile = {
# "apache/commons-beanutils": "apache/BeanUtilsGenerated.qll",
# "apache/commons-codec": "apache/CodecGenerated.qll",
# "apache/commons-lang": "apache/Lang3Generated.qll",
"apache/commons-io": "apache/IOGenerated.qll",
"apache/commons-io": "org.apache.commons.io",
}
@@ -36,13 +34,12 @@ def regenerateModel(lgtmSlug, extractedDb):
print("ERROR: slug " + lgtmSlug +
" is not mapped to a model file in script " + sys.argv[0])
sys.exit(1)
modelFile = defaultModelPath + "/" + lgtmSlugToModelFile[lgtmSlug]
modelFile = lgtmSlugToModelFile[lgtmSlug]
codeQlRoot = findGitRoot()
targetModel = codeQlRoot + "/" + modelFile
subprocess.check_call([codeQlRoot + "/java/ql/src/utils/model-generator/GenerateFlowModel.py",
"--with-summaries", "--with-sinks",
extractedDb, targetModel])
print("Regenerated " + targetModel)
"--with-summaries", "--with-sinks", "--with-negative-summaries",
extractedDb, modelFile])
print("Regenerated " + modelFile)
shutil.rmtree(tmpDir)