• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8
9"""Create the asset."""
10
11
12import argparse
13import common
14import os
15import subprocess
16import utils
17
18
19CLANG_REVISION = '318667'
20CLANG_SUB_REVISION = '1'
21CLANG_PKG_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
22GS_URL = ('https://commondatastorage.googleapis.com/chromium-browser-clang'
23          '/Win/clang-%s.tgz' % CLANG_PKG_VERSION)
24
25
26def create_asset(target_dir):
27  """Create the asset."""
28  with utils.chdir(target_dir):
29    tarball = 'clang.tgz'
30    subprocess.check_call(['wget', '-O', tarball, GS_URL])
31    subprocess.check_call(['tar', 'zxvf', tarball])
32    os.remove(tarball)
33
34
35def main():
36  parser = argparse.ArgumentParser()
37  parser.add_argument('--target_dir', '-t', required=True)
38  args = parser.parse_args()
39  create_asset(args.target_dir)
40
41
42if __name__ == '__main__':
43  main()
44