help="The name of the implemts", default=None) args = parser.parse_args() print("[%s] Start %s" % (datetime.now().strftime("%d/%m/%Y %H:%M:%S"), args.url), flush=True) working_directory = tempfile.mkdtemp() project = Project(args.url) print("[%s] [STARTED] Clone %s" % (datetime.now().strftime("%d/%m/%Y %H:%M:%S"), project.name), flush=True) status = project.clone(working_directory) print("[%s] [FINISHED] Clone %s (status: %s)" % (datetime.now().strftime("%d/%m/%Y %H:%M:%S"), project.name, status), flush=True) print("[%s] [STARTED] Checkout %s %s" % (datetime.now().strftime("%d/%m/%Y %H:%M:%S"), project.name, args.commit), flush=True) project.checkout_commit(args.commit) print("[%s] [FINISHED] Checkout %s %s" % (datetime.now().strftime("%d/%m/%Y %H:%M:%S"), project.name, project.get_commit()), flush=True) project_path = working_directory log_path = os.path.join(project_path, "output.log")
required=True, help="The commit of the lib to debloat") parser.add_argument("-r", "--results", required=True, help="The result folder") parser.add_argument("--timeout", help="Execution timeout of mvn compile/test/package", default=None) args = parser.parse_args() working_directory = tempfile.mkdtemp() project = Project(args.url) project.clone(working_directory) project.checkout_commit(args.commit) project.install(stdout="install.log", timeout=args.timeout) if len(project.pom.poms) == 0: os._exit(os.EX_OK) to_instrument = set() cl = project.classpath() for p in cl: for dep in p.split(":"): for lib in json_libs: if lib.replace(".", "/").replace(":", "/") in dep: to_instrument.add(dep)