Exemplo n.º 1
0
    def capture(self):
        stats = {}

        start_time = timeit.default_timer()
        result = cmdtools.run_cmd(self.build_cmd, self.args)
        # stats['build_time'] = result['time']
        stats['build_time'] = timeit.default_timer() - start_time

        build_out_file = os.path.join(self.args.output_directory,
                                      'build_output.txt')
        with open(build_out_file, 'w') as f:
            f.write(result['output'])

        if result['return_code'] != 0:
            return None

        build_lines = result['output'].split('\n')

        javac_commands = self.get_javac_commands(build_lines)
        target_jars = self.get_target_jars(build_lines)
        jars_with_entry_points = list(map(get_entry_point, target_jars))

        self.record_stats(stats, javac_commands, jars_with_entry_points)

        return [javac_commands, jars_with_entry_points, stats]
Exemplo n.º 2
0
    def capture(self):
        stats = {}

        start_time = timeit.default_timer()
        result = cmdtools.run_cmd(self.build_cmd)
        stats['build_time'] = result['time']

        with open(os.path.join(self.args.output_directory, 'build_output.txt'), 'w') as f:
            f.write(result['output'])

        build_lines = result['output'].split('\n')

        javac_commands = self.get_javac_commands(build_lines)
        target_jars = self.get_target_jars(build_lines)
        jars_with_entry_points = map(get_entry_point, target_jars)

        self.record_stats(stats, javac_commands, jars_with_entry_points)

        return [javac_commands, jars_with_entry_points, stats]