Beispiel #1
0
def main():
  os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, 'skia'))
  version = common.version()
  build_type = common.build_type()
  machine = common.machine()
  system = common.system()
  classifier = common.classifier()
  os.chdir(os.pardir)

  zip = 'Skia-' + version + '-' + system + '-' + build_type + '-' + machine + classifier + '.zip'
  if not os.path.exists(zip):
    print('Can\'t find "' + zip + '"')
    return 1

  headers = common.github_headers()

  try:
    resp = urllib.request.urlopen(urllib.request.Request('https://api.github.com/repos/olonho/skia-build/releases/tags/' + version, headers=headers)).read()
  except urllib.error.URLError as e:
    data = '{"tag_name":"' + version + '","name":"' + version + '"}'
    resp = urllib.request.urlopen(urllib.request.Request('https://api.github.com/repos/olonho/skia-build/releases', data=data.encode('utf-8'), headers=headers)).read()
  upload_url = re.match('https://.*/assets', json.loads(resp.decode('utf-8'))['upload_url']).group(0)

  print('Uploading', zip, 'to', upload_url)
  headers['Content-Type'] = 'application/zip'
  headers['Content-Length'] = os.path.getsize(zip)
  with open(zip, 'rb') as data:
    urllib.request.urlopen(urllib.request.Request(upload_url + '?name=' + zip, data=data, headers=headers))

  return 0
Beispiel #2
0
def main():
  headers = common.github_headers()
  version = common.version()
  build_type = common.build_type()
  
  try:
    resp = urllib.request.urlopen(urllib.request.Request('https://api.github.com/repos/JetBrains/skia-build/releases/tags/' + version, headers=headers)).read()
    artifacts = [x['name'] for x in json.loads(resp.decode('utf-8'))['assets']]
    zip = 'Skia-' + version + '-' + common.system + '-' + build_type + '-' + common.machine + common.classifier() + '.zip'
    if zip in artifacts:
      print('> Artifact "' + zip + '" exists, stopping')
      return 1
    return 0
  except urllib.error.URLError as e:
    return 0
def main():
    os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, 'skia'))
    version = common.version()
    build_type = common.build_type()
    is_android = common.is_android()
    os.chdir(os.pardir)

    zip = common.archive_name()
    if zip is None:
        print('--android was defined but --android-target-cpu wasn\'t.')

    if not os.path.exists(zip):
        print('Can\'t find "' + zip + '"')
        return 1

    headers = common.github_headers()

    try:
        resp = urllib.request.urlopen(
            urllib.request.Request(
                'https://api.github.com/repos/JetBrains/skia-build/releases/tags/'
                + version,
                headers=headers)).read()
    except urllib.error.URLError as e:
        data = '{"tag_name":"' + version + '","name":"' + version + '"}'
        resp = urllib.request.urlopen(
            urllib.request.Request(
                'https://api.github.com/repos/JetBrains/skia-build/releases',
                data=data.encode('utf-8'),
                headers=headers)).read()
    upload_url = re.match('https://.*/assets',
                          json.loads(
                              resp.decode('utf-8'))['upload_url']).group(0)

    print('Uploading', zip, 'to', upload_url)
    headers['Content-Type'] = 'application/zip'
    headers['Content-Length'] = os.path.getsize(zip)
    with open(zip, 'rb') as data:
        urllib.request.urlopen(
            urllib.request.Request(upload_url + '?name=' + zip,
                                   data=data,
                                   headers=headers))

    return 0
Beispiel #4
0
def main():
    headers = common.github_headers()
    version = common.version()
    build_type = common.build_type()

    try:
        resp = urllib.request.urlopen(
            urllib.request.Request(
                'https://api.github.com/repos/JetBrains/skia-build/releases/tags/'
                + version,
                headers=headers)).read()
        artifacts = [
            x['name'] for x in json.loads(resp.decode('utf-8'))['assets']
        ]
        zip = common.archive_name()
        if zip is None:
            print('--android was specified but --android-target-cpu was not.')
            return -1
        if zip in artifacts:
            print('> Artifact "' + zip + '" exists, stopping')
            return 1
        return 0
    except urllib.error.URLError as e:
        return 0
Beispiel #5
0
def main():
  os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, 'skia'))

  build_type = common.build_type()
  machine = common.machine()
  system = common.system()
  ndk = common.ndk()  

  if build_type == 'Debug':
    args = ['is_debug=true']
  else:
    args = ['is_official_build=true']

  args += [
    'target_cpu="' + machine + '"',
    'skia_use_system_expat=false',
    'skia_use_system_libjpeg_turbo=false',
    'skia_use_system_libpng=false',
    'skia_use_system_libwebp=false',
    'skia_use_system_zlib=false',
    'skia_use_sfntly=false',
    'skia_use_freetype=true',
    'skia_use_system_freetype2=false',
    # 'skia_use_harfbuzz=true',
    'skia_use_system_harfbuzz=false',
    'skia_pdf_subset_harfbuzz=true',
    # 'skia_use_icu=true',
    'skia_use_system_icu=false',
    # 'skia_enable_skshaper=true',
    # 'skia_enable_svg=true',
    'skia_enable_skottie=true'
  ]

  if 'macos' == system:
    args += [
      # 'skia_enable_gpu=true',
      # 'skia_use_gl=true',
      'skia_use_metal=true',
      'extra_cflags_cc=["-frtti"]'
    ]
    if 'arm64' == machine:
      args += ['extra_cflags=["-stdlib=libc++"]']
    else:
      args += ['extra_cflags=["-stdlib=libc++", "-mmacosx-version-min=10.13"]']
  elif 'linux' == system:
    args += [
      # 'skia_enable_gpu=true',
      # 'skia_use_gl=true',
      'extra_cflags_cc=["-frtti", "-D_GLIBCXX_USE_CXX11_ABI=0"]',
      'cxx="g++-9"',
    ]
  elif 'windows' == system:
    args += [
      # 'skia_use_angle=true',
      'skia_use_direct3d=true',
      'extra_cflags=["-DSK_FONT_HOST_USE_SYSTEM_SETTINGS"]',
    ]
  elif 'android' == system:
    args += [
      'ndk="'+ ndk + '"'
    ]

  out = os.path.join('out', build_type + '-' + machine)
  gn = 'gn.exe' if 'windows' == system else 'gn'
  subprocess.check_call([os.path.join('bin', gn), 'gen', out, '--args=' + ' '.join(args)])
  ninja = 'ninja.exe' if 'windows' == system else 'ninja'
  subprocess.check_call([os.path.join('..', 'depot_tools', ninja), '-C', out, 'skia', 'modules'])

  return 0
def main():
    os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, 'skia'))

    build_type = common.build_type()
    version = common.version()
    is_android = common.is_android()

    target = common.archive_name()
    if target is None:
        print('--android was defined but --android-target-cpu wasn\'t.')
        return -1

    if is_android:
        target_cpu = common.android_target_cpu()
        globs = [
            'out/' + build_type + '-android-' + target_cpu + '/*.a',
            'out/' + build_type + '-android-' + target_cpu + '/*.lib',
            'out/' + build_type + '-android-' + target_cpu + '/icudtl.dat',
        ]
    else:
        globs = [
            'out/' + build_type + '-' + common.machine + '/*.a',
            'out/' + build_type + '-' + common.machine + '/*.lib',
            'out/' + build_type + '-' + common.machine + '/icudtl.dat',
        ]

    globs += [
        'modules/particles/include/*.h', 'modules/skottie/include/*.h',
        'modules/skottie/src/*.h', 'modules/skottie/src/animator/*.h',
        'modules/skottie/src/effects/*.h', 'modules/skottie/src/layers/*.h',
        'modules/skottie/src/layers/shapelayer/*.h',
        'modules/skottie/src/text/*.h', 'modules/skparagraph/include/*.h',
        'modules/skplaintexteditor/include/*.h',
        'modules/skresources/include/*.h', 'modules/sksg/include/*.h',
        'modules/skshaper/include/*.h', 'modules/skshaper/src/*.h',
        'modules/svg/include/*.h', 'src/core/*.h', 'src/gpu/gl/*.h',
        'src/utils/*.h', 'third_party/externals/angle2/LICENSE',
        'third_party/externals/angle2/include/**/*',
        'third_party/externals/freetype/docs/FTL.TXT',
        'third_party/externals/freetype/docs/GPLv2.TXT',
        'third_party/externals/freetype/docs/LICENSE.TXT',
        'third_party/externals/freetype/include/**/*',
        'third_party/externals/icu/source/common/**/*.h',
        'third_party/externals/libpng/LICENSE',
        'third_party/externals/libpng/*.h',
        'third_party/externals/libwebp/COPYING',
        'third_party/externals/libwebp/PATENTS',
        'third_party/externals/libwebp/src/dec/*.h',
        'third_party/externals/libwebp/src/dsp/*.h',
        'third_party/externals/libwebp/src/enc/*.h',
        'third_party/externals/libwebp/src/mux/*.h',
        'third_party/externals/libwebp/src/utils/*.h',
        'third_party/externals/libwebp/src/webp/*.h',
        'third_party/externals/harfbuzz/COPYING',
        'third_party/externals/harfbuzz/src/*.h',
        'third_party/externals/swiftshader/LICENSE.txt',
        'third_party/externals/swiftshader/include/**/*',
        'third_party/externals/zlib/LICENSE', 'third_party/externals/zlib/*.h',
        "third_party/icu/*.h"
    ]

    print('> Writing', target)

    with zipfile.ZipFile(os.path.join(os.pardir, target),
                         'w',
                         compression=zipfile.ZIP_DEFLATED) as zip:
        dirs = set()
        for glob in globs:
            for path in pathlib.Path().glob(glob):
                if not path.is_dir():
                    for dir in parents(path):
                        if not dir in dirs:
                            zip.write(str(dir))
                            dirs.add(dir)
                    zip.write(str(path))

    return 0
Beispiel #7
0
def main():
    os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, 'skia'))

    build_type = common.build_type()
    version = common.version()
    machine = common.machine()
    system = common.system()
    classifier = common.classifier()

    globs = [
        'out/' + build_type + '-' + machine + '/*.a',
        'out/' + build_type + '-' + machine + '/*.lib',
        'out/' + build_type + '-' + machine + '/icudtl.dat', 'include/**/*',
        'modules/particles/include/*.h', 'modules/skottie/include/*.h',
        'modules/skottie/src/*.h', 'modules/skottie/src/animator/*.h',
        'modules/skottie/src/effects/*.h', 'modules/skottie/src/layers/*.h',
        'modules/skottie/src/layers/shapelayer/*.h',
        'modules/skottie/src/text/*.h', 'modules/skparagraph/include/*.h',
        'modules/skplaintexteditor/include/*.h',
        'modules/skresources/include/*.h', 'modules/sksg/include/*.h',
        'modules/skshaper/include/*.h', 'modules/skshaper/src/*.h',
        'modules/svg/include/*.h', 'src/core/*.h', 'src/gpu/gl/*.h',
        'src/utils/*.h', 'third_party/externals/angle2/LICENSE',
        'third_party/externals/angle2/include/**/*',
        'third_party/externals/freetype/docs/FTL.TXT',
        'third_party/externals/freetype/docs/GPLv2.TXT',
        'third_party/externals/freetype/docs/LICENSE.TXT',
        'third_party/externals/freetype/include/**/*',
        'third_party/externals/icu/source/common/**/*.h',
        'third_party/externals/libpng/LICENSE',
        'third_party/externals/libpng/*.h',
        'third_party/externals/libwebp/COPYING',
        'third_party/externals/libwebp/PATENTS',
        'third_party/externals/libwebp/src/dec/*.h',
        'third_party/externals/libwebp/src/dsp/*.h',
        'third_party/externals/libwebp/src/enc/*.h',
        'third_party/externals/libwebp/src/mux/*.h',
        'third_party/externals/libwebp/src/utils/*.h',
        'third_party/externals/libwebp/src/webp/*.h',
        'third_party/externals/harfbuzz/COPYING',
        'third_party/externals/harfbuzz/src/*.h',
        'third_party/externals/swiftshader/LICENSE.txt',
        'third_party/externals/swiftshader/include/**/*',
        'third_party/externals/zlib/LICENSE', 'third_party/externals/zlib/*.h',
        "third_party/icu/*.h"
    ]

    target = 'Skia-' + version + '-' + system + '-' + build_type + '-' + machine + classifier + '.zip'
    print('> Writing', target)

    with zipfile.ZipFile(os.path.join(os.pardir, target),
                         'w',
                         compression=zipfile.ZIP_DEFLATED) as zip:
        dirs = set()
        for glob in globs:
            for path in pathlib.Path().glob(glob):
                if not path.is_dir():
                    for dir in parents(path):
                        if not dir in dirs:
                            zip.write(str(dir))
                            dirs.add(dir)
                    zip.write(str(path))

    return 0