|
|
@ -5,10 +5,10 @@
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import jwlib
|
|
|
|
|
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import util
|
|
|
|
import util
|
|
|
|
import logging
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
import tempfile
|
|
|
|
import tempfile
|
|
|
|
|
|
|
|
|
|
|
|
MODULE_NAME = __name__
|
|
|
|
MODULE_NAME = __name__
|
|
|
@ -19,7 +19,7 @@ Analysis examples:
|
|
|
|
infer -- gradle build
|
|
|
|
infer -- gradle build
|
|
|
|
infer -- ./gradlew build'''
|
|
|
|
infer -- ./gradlew build'''
|
|
|
|
|
|
|
|
|
|
|
|
FILELISTS = 'filelists'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def gen_instance(*args):
|
|
|
|
def gen_instance(*args):
|
|
|
|
return GradleCapture(*args)
|
|
|
|
return GradleCapture(*args)
|
|
|
@ -37,7 +37,7 @@ class GradleCapture:
|
|
|
|
self.build_cmd = [cmd[0], '--debug'] + cmd[1:]
|
|
|
|
self.build_cmd = [cmd[0], '--debug'] + cmd[1:]
|
|
|
|
# That contains javac version as well
|
|
|
|
# That contains javac version as well
|
|
|
|
version_str = util.run_cmd_ignore_fail([cmd[0], '--version'])
|
|
|
|
version_str = util.run_cmd_ignore_fail([cmd[0], '--version'])
|
|
|
|
path = os.path.join(self.args.infer_out, FILELISTS)
|
|
|
|
path = os.path.join(self.args.infer_out, jwlib.FILELISTS)
|
|
|
|
if not os.path.exists(path):
|
|
|
|
if not os.path.exists(path):
|
|
|
|
os.mkdir(path)
|
|
|
|
os.mkdir(path)
|
|
|
|
logging.info("Running with:\n" + version_str)
|
|
|
|
logging.info("Running with:\n" + version_str)
|
|
|
@ -60,7 +60,7 @@ class GradleCapture:
|
|
|
|
mode='w',
|
|
|
|
mode='w',
|
|
|
|
suffix='.txt',
|
|
|
|
suffix='.txt',
|
|
|
|
prefix='gradle_',
|
|
|
|
prefix='gradle_',
|
|
|
|
dir=os.path.join(self.args.infer_out, FILELISTS),
|
|
|
|
dir=os.path.join(self.args.infer_out, jwlib.FILELISTS),
|
|
|
|
delete=False) as sources:
|
|
|
|
delete=False) as sources:
|
|
|
|
sources.write("\n".join(java_files))
|
|
|
|
sources.write("\n".join(java_files))
|
|
|
|
sources.flush()
|
|
|
|
sources.flush()
|
|
|
|