示例#1
0
depsArgs = [
  '--root_with_prefix=lib ../../../lib',
  '--root_with_prefix=third_party/closure ../../../third_party/closure'
]

def genDeps(_):
  print 'Generating Closure dependencies...'

  # Make the dist/ folder, ignore errors.
  base = shakaBuildHelpers.getSourceBase()
  try:
    os.mkdir(os.path.join(base, 'dist'))
  except OSError:
    pass
  os.chdir(base)
  depsWriter = os.path.join('third_party', 'closure', 'deps', 'depswriter.py')

  try:
    cmdLine = ['python', depsWriter] + depsArgs
    shakaBuildHelpers.printCmdLine(cmdLine)
    deps = subprocess.check_output(cmdLine)
    with open(os.path.join(base, 'dist', 'deps.js'), 'w') as f:
      f.write(deps)
    return 0
  except subprocess.CalledProcessError as e:
    return e.returncode

if __name__ == '__main__':
  shakaBuildHelpers.runMain(genDeps)
示例#2
0
    '--root_with_prefix=third_party/closure ../../../third_party/closure'
]


def genDeps(_):
    print 'Generating Closure dependencies...'

    # Make the dist/ folder, ignore errors.
    base = shakaBuildHelpers.getSourceBase()
    try:
        os.mkdir(os.path.join(base, 'dist'))
    except OSError:
        pass
    os.chdir(base)
    depsWriter = os.path.join('third_party', 'closure', 'deps',
                              'depswriter.py')

    try:
        cmdLine = ['python', depsWriter] + depsArgs
        shakaBuildHelpers.printCmdLine(cmdLine)
        deps = subprocess.check_output(cmdLine)
        with open(os.path.join(base, 'dist', 'deps.js'), 'w') as f:
            f.write(deps)
        return 0
    except subprocess.CalledProcessError as e:
        return e.returncode


if __name__ == '__main__':
    shakaBuildHelpers.runMain(genDeps)
示例#3
0
# limitations under the License.

"""Builds the documentation from the source code.  This deletes the old
documentation first.
"""

import os
import shakaBuildHelpers
import shutil
import subprocess
import sys

def buildDocs(_):
  base = shakaBuildHelpers.getSourceBase()
  shutil.rmtree(os.path.join(base, 'docs', 'api'), ignore_errors=True)
  os.chdir(base)

  if shakaBuildHelpers.isWindows() or shakaBuildHelpers.isCygwin():
    # Windows has a different command name.  The Unix version does not seem to
    # work on Cygwin, but the windows one does.
    jsdoc = os.path.join('third_party', 'jsdoc', 'jsdoc.cmd')
  else:
    jsdoc = os.path.join('third_party', 'jsdoc', 'jsdoc')

  cmdLine = [jsdoc, '-c', 'jsdoc.conf.json']
  shakaBuildHelpers.printCmdLine(cmdLine)
  return subprocess.call(cmdLine)

if __name__ == '__main__':
  shakaBuildHelpers.runMain(buildDocs)
示例#4
0
    cmdLine = cmd + ['--browsers', browsers]
    shakaBuildHelpers.printCmdLine(cmdLine)
    return subprocess.call(cmdLine)
  else:
    # Run with command-line arguments from the user.
    if '--browsers' not in args:
      print 'No --browsers specified.'
      print 'In this mode, browsers must be manually connected to karma.'
    cmdLine = cmd + args
    shakaBuildHelpers.printCmdLine(cmdLine)
    return subprocess.call(cmdLine)


def _GetBrowsers():
  """Uses the platform name to configure which browsers will be tested."""
  browsers = None
  if shakaBuildHelpers.isLinux():
    # For MP4 support on Linux Firefox, install gstreamer1.0-libav.
    # Opera on Linux only supports MP4 for Ubuntu 15.04+, so it is not in the
    # default list of browsers for Linux at this time.
    browsers = 'Chrome,Firefox'
  elif shakaBuildHelpers.isDarwin():
    browsers = 'Chrome,Firefox,Safari'
  elif shakaBuildHelpers.isWindows() or shakaBuildHelpers.isCygwin():
    browsers = 'Chrome,Firefox,IE'
  return browsers


if __name__ == '__main__':
  shakaBuildHelpers.runMain(runTests)
示例#5
0
        cmdLine = cmd + ['--browsers', browsers]
        shakaBuildHelpers.printCmdLine(cmdLine)
        return subprocess.call(cmdLine)
    else:
        # Run with command-line arguments from the user.
        if '--browsers' not in args:
            print 'No --browsers specified.'
            print 'In this mode, browsers must be manually connected to karma.'
        cmdLine = cmd + args
        shakaBuildHelpers.printCmdLine(cmdLine)
        return subprocess.call(cmdLine)


def _GetBrowsers():
    """Uses the platform name to configure which browsers will be tested."""
    browsers = None
    if shakaBuildHelpers.isLinux():
        # For MP4 support on Linux Firefox, install gstreamer1.0-libav.
        # Opera on Linux only supports MP4 for Ubuntu 15.04+, so it is not in the
        # default list of browsers for Linux at this time.
        browsers = 'Chrome,Firefox'
    elif shakaBuildHelpers.isDarwin():
        browsers = 'Chrome,Firefox,Safari'
    elif shakaBuildHelpers.isWindows() or shakaBuildHelpers.isCygwin():
        browsers = 'Chrome,Firefox,IE'
    return browsers


if __name__ == '__main__':
    shakaBuildHelpers.runMain(runTests)
示例#6
0
    if args[i] == '--name':
      i = i + 1
      if i == len(args):
        print >> sys.stderr, '--name requires an argument'
        return 1
      name = args[i]
    elif args[i] == '--force':
      rebuild = True
    elif args[i] == '--help':
      usage()
      return 0
    elif args[i].startswith('--'):
      print >> sys.stderr, 'Unknown option', args[i]
      usage()
      return 1
    else:
      lines.append(args[i])
    i = i + 1

  if len(lines) == 0:
    lines = ['+@complete']

  customBuild = Build()
  if not customBuild.parseBuild(lines, os.getcwd()):
    return 1
  return 0 if customBuild.buildLibrary(name, rebuild) else 1

if __name__ == '__main__':
  shakaBuildHelpers.runMain(main)

示例#7
0
            i = i + 1
            if i == len(args):
                print >> sys.stderr, '--name requires an argument'
                return 1
            name = args[i]
        elif args[i] == '--force':
            rebuild = True
        elif args[i] == '--help':
            usage()
            return 0
        elif args[i].startswith('--'):
            print >> sys.stderr, 'Unknown option', args[i]
            usage()
            return 1
        else:
            lines.append(args[i])
        i = i + 1

    if len(lines) == 0:
        lines = ['+@complete']

    print 'Compiling the library...'
    customBuild = Build()
    if not customBuild.parseBuild(lines, os.getcwd()):
        return 1
    return 0 if customBuild.buildLibrary(name, rebuild) else 1


if __name__ == '__main__':
    shakaBuildHelpers.runMain(main)
示例#8
0
  print 'changelog version:', changelog

  ret = 0
  if 'dirty' in git:
    print >> sys.stderr, 'Git version is dirty.'
    ret = 1
  if 'unknown' in git:
    print >> sys.stderr, 'Git version is not a tag.'
    ret = 1
  if not re.match(r'^v[0-9]+\.[0-9]+\.[0-9]+(?:-[a-z0-9]+)?$', git):
    print >> sys.stderr, 'Git version is a malformed release version.'
    print >> sys.stderr, 'It should be a \'v\', followed by three numbers'
    print >> sys.stderr, 'separated by dots, optionally followed by a hyphen'
    print >> sys.stderr, 'and a pre-release identifier.  See http://semver.org/'
    ret = 1

  if 'v' + npm != git:
    print >> sys.stderr, 'NPM version does not match git version.'
    ret = 1
  if player != git + '-debug':
    print >> sys.stderr, 'Player version does not match git version.'
    ret = 1
  if 'v' + changelog != git:
    print >> sys.stderr, 'Changelog version does not match git version.'
    ret = 1

  return ret

if __name__ == '__main__':
  shakaBuildHelpers.runMain(checkVersion)
示例#9
0
"""Builds the documentation from the source code.  This deletes the old
documentation first.
"""

import os
import shakaBuildHelpers
import shutil
import subprocess
import sys


def buildDocs(_):
    base = shakaBuildHelpers.getSourceBase()
    shutil.rmtree(os.path.join(base, 'docs', 'api'), ignore_errors=True)
    os.chdir(base)

    if shakaBuildHelpers.isWindows() or shakaBuildHelpers.isCygwin():
        # Windows has a different command name.  The Unix version does not seem to
        # work on Cygwin, but the windows one does.
        jsdoc = os.path.join('third_party', 'jsdoc', 'jsdoc.cmd')
    else:
        jsdoc = os.path.join('third_party', 'jsdoc', 'jsdoc')

    cmdLine = [jsdoc, '-c', 'jsdoc.conf.json']
    shakaBuildHelpers.printCmdLine(cmdLine)
    return subprocess.call(cmdLine)


if __name__ == '__main__':
    shakaBuildHelpers.runMain(buildDocs)