def add_lizard_to_path_variable(): # TODO: fix versioning lizard_dir = os.path.join(util.get_softwipe_directory(), 'lizard-1.17.7') if os.path.isdir(lizard_dir): add_to_path_variable(lizard_dir) else: automatic_tool_installation.handle_lizard_download() add_to_path_variable(lizard_dir)
def add_kwstyle_to_path_variable(): """ Adjusts the PATH variable by adding KWStyle to the PATH if it is contained in the softwipe directory (which it is if the user did the auto-installation of it). """ kwstyle_dir = os.path.join(util.get_softwipe_directory(), 'KWStyle') if os.path.isdir(kwstyle_dir): add_to_path_variable( os.path.join(kwstyle_dir, strings.SOFTWIPE_BUILD_DIR_NAME))
def handle_infer_download(): print("Downloading Infer... (this might take a while)") softwipe_dir = util.get_softwipe_directory() # TODO: properly select newest version version = '0.17.0' url = "https://github.com/facebook/infer/releases/download/v{v}/infer-linux64-v{v}.tar.xz".format(v=version) process = subprocess.Popen(('curl', '-sSL', url), stdout=subprocess.PIPE) output = subprocess.Popen(('tar', "-C", softwipe_dir, "-xJ"), stdin=process.stdout) output.wait()
def handle_lizard_download(): softwipe_dir = util.get_softwipe_directory() version = '1.17.7' url = "https://github.com/terryyin/lizard/archive/{v}.tar.gz".format(v=version) print("Downloading lizard...") process = subprocess.Popen(('curl', '-sSL', url), cwd=softwipe_dir, stdout=subprocess.PIPE) output = subprocess.Popen(('tar', "-C", softwipe_dir, "-xz"), stdin=process.stdout) output.wait() print("Done!\n")
def add_infer_to_path_variable(): # TODO: fix versioning infer_dir = os.path.join(util.get_softwipe_directory(), 'infer-linux64-v0.17.0') infer_dir = os.path.join(infer_dir, "lib/infer/infer/bin") automatic_tool_installation.install_apt_package_if_needed("libtinfo5") if os.path.isdir(infer_dir): add_to_path_variable(infer_dir) else: automatic_tool_installation.handle_infer_download()
def handle_kwstyle_download(): git_link = 'https://github.com/Kitware/KWStyle.git' git_clone_command = ['git', 'clone', git_link] softwipe_dir = util.get_softwipe_directory() subprocess.run(git_clone_command, cwd=softwipe_dir) kwstyle_dir = os.path.join(softwipe_dir, 'KWStyle') print('Building KWStyle...') compile_phase.compile_program_cmake( kwstyle_dir, 1, dont_check_for_warnings=True, compiler_flags="", excluded_paths=()) # The argument lines_of_code does not matter here print('Done!') print()