def checkout(self, ref, ref_is_sha, pull_after_update,
              stdout=sys.stdout, stderr=sys.stderr):
     if not os.path.exists(self.root_path):
         common.check_execute(['mkdir', '-p', self.root_path],
                              stdout=stdout, stderr=stderr)
     path = os.path.join(self.root_path, self.project['path'])
     if self.project['repository'] == 'Git':
         if os.path.exists(path):
             if ref_is_sha:
                 common.git_update(self.project['url'], ref, path,
                                   incremental=self.skip_clean,
                                   stdout=stdout, stderr=stderr)
             else:
                 if not self.skip_clean:
                     common.git_clean(path, stdout=stdout, stderr=stderr)
                 common.git_checkout(ref, path,
                                     force=True,
                                     stdout=stdout, stderr=stderr)
             if pull_after_update:
                 common.git_pull(path, stdout=stdout, stderr=stderr)
         else:
             common.git_clone(self.project['url'], path, ref,
                              stdout=stdout, stderr=stderr)
     else:
         raise common.Unreachable('Unsupported repository: %s' %
                                  self.project['repository'])
def checkout(root_path, repo, commit):
    """Checkout an indexed repository."""
    path = os.path.join(root_path, repo['path'])
    if repo['repository'] == 'Git':
        if os.path.exists(path):
            return common.git_update(repo['url'], commit, path)
        else:
            return common.git_clone(repo['url'], path, tree=commit)
    raise common.Unreachable('Unsupported repository: %s' % repo['repository'])
updates the corresponding JSON message files in Blockly iOS.
(NOTE: `git` needs to be installed for this script to run.)"""

    # Parse command-line args
    parser = argparse.ArgumentParser(description=script_description)
    parser.add_argument(
        "--branch",
        help=
        "The git branch to use from the Blockly web repo. Defaults to 'master'.",
        default="master")
    args = parser.parse_args()

    script_dir = path.dirname(path.realpath(sys.argv[0]))
    blockly_ios_root = path.realpath(path.join(script_dir, ".."))

    # Create temp dir
    temp_dir = path.realpath(path.join(script_dir, "temp"))
    if (path.exists(temp_dir)):
        shutil.rmtree(temp_dir)

    # Clone master branch of blockly
    git_clone(temp_dir, "https://github.com/google/blockly.git",
              "--branch " + args.branch + " --depth 1")
    blockly_web_root = path.join(temp_dir, "blockly")

    # Update i18n messages with the cloned repo
    update_i18n_messages(blockly_ios_root, blockly_web_root)

    # Clean up temp dir
    shutil.rmtree(temp_dir)
Esempio n. 4
0
import common

print('oneiric dependency installer')

# Header only libs
common.git_clone('https://github.com/phresnel/tukan.git', 'tukan')
common.download_file(
    'https://github.com/catchorg/Catch2/releases/download/v2.4.2/catch.hpp',
    'catchorg/catch2/catch.hpp')

common.download_file(
    'https://raw.githubusercontent.com/nothings/stb/master/stb_image.h',
    'stb/stb/stb_image.h')
common.download_file(
    'https://raw.githubusercontent.com/nothings/stb/master/stb_image_resize.h',
    'stb/stb/stb_image_resize.h')
common.download_file(
    'https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h',
    'stb/stb/stb_image_write.h')
common.download_file(
    'https://raw.githubusercontent.com/nothings/stb/master/stb_perlin.h',
    'stb/stb/stb_perlin.h')

# Boost
common.download_file(
    'https://netcologne.dl.sourceforge.net/project/boost/boost/1.67.0/boost_1_67_0.zip',
    'boost_1_67_0.zip')
common.unzip('boost_1_67_0.zip', 'boost_1_67_0')
common.start_in_folder('bootstrap.bat',
                       where='boost_1_67_0/boost_1_67_0/',
                       if_not_exists='project-config.jam')