Exemplo n.º 1
0
 def run_pylint(self, path):
     finder = PathFinder(FileSystem())
     executive = Executive()
     env = os.environ.copy()
     env['PYTHONPATH'] = os.pathsep.join([
         get_blink_tools_dir(),
         finder.path_from_blink_source('build', 'scripts'),
         get_blinkpy_thirdparty_dir(),
         finder.path_from_blink_source('bindings', 'scripts'),
         finder.path_from_chromium_base('build', 'android'),
         finder.path_from_chromium_base('third_party', 'catapult', 'devil'),
         finder.path_from_chromium_base('third_party', 'pymock'),
     ])
     return executive.run_command([
         sys.executable,
         finder.path_from_depot_tools_base('pylint.py'),
         '--output-format=parseable',
         '--rcfile=' + finder.path_from_blink_tools('blinkpy', 'pylintrc'),
         path,
     ],
                                  env=env,
                                  error_handler=executive.ignore_error)
Exemplo n.º 2
0
def main():
    return typ.main(top_level_dirs=[
        path_finder.get_blink_tools_dir(),
        os.path.join(path_finder.get_source_dir(), 'build', 'scripts')
    ],
                    path=[path_finder.get_blinkpy_thirdparty_dir()])
Exemplo n.º 3
0
    def move(self, apply_only=None):
        """Move Blink source files.

        Args:
            apply_only: If it's None, move all affected files. Otherwise,
                it should be a set of file paths and this function moves
                only the files in |apply_only|.
        """
        _log.info('Planning renaming ...')
        file_pairs = plan_blink_move(self._fs, [])

        if apply_only:
            file_pairs = [
                (src, dest) for (src, dest) in file_pairs
                if 'third_party/WebKit/' + src.replace('\\', '/') in apply_only
            ]
        _log.info('Will move %d files', len(file_pairs))

        git = self._create_git()
        files_set = self._get_checked_in_files(git)
        for i, (src, dest) in enumerate(file_pairs):
            src_from_repo = self._fs.join('third_party', 'WebKit', src)
            if src_from_repo.replace('\\', '/') not in files_set:
                _log.info('%s is not in the repository', src)
                continue
            dest_from_repo = self._fs.join('third_party', 'blink', dest)
            self._fs.maybe_make_directory(self._repo_root, 'third_party',
                                          'blink', self._fs.dirname(dest))
            if self._options.run_git:
                git.move(src_from_repo, dest_from_repo)
                _log.info('[%d/%d] Git moved %s', i + 1, len(file_pairs), src)
            else:
                self._fs.move(
                    self._fs.join(self._repo_root, src_from_repo),
                    self._fs.join(self._repo_root, dest_from_repo))
                _log.info('[%d/%d] Moved %s', i + 1, len(file_pairs), src)
        if apply_only:
            return

        self._update_single_file_content('build/get_landmines.py', [(
            '\ndef main',
            '  print \'The Great Blink mv for source files (crbug.com/768828)\'\n\ndef main'
        )])

        _log.info('Run run_bindings_tests.py ...')
        Executive().run_command([
            'python',
            self._fs.join(get_blink_tools_dir(), 'run_bindings_tests.py'),
            '--reset-results'
        ],
                                cwd=self._repo_root)

        if self._options.run_git:
            _log.info('Make a local commit ...')
            git.commit_locally_with_message(
                """The Great Blink mv for source files, part 2.

Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
""")