Beispiel #1
0
def BuildDartdocAPIDocs(dirname):
    dart_sdk = BuildRootPath('dart-sdk')
    dart_exe = os.path.join(dart_sdk, 'bin', 'dart')
    dartdoc_dart = os.path.join(bot_utils.DART_DIR, 'third_party', 'pkg',
                                'dartdoc', 'bin', 'dartdoc.dart')
    footer_file = os.path.join(bot_utils.DART_DIR, 'tools', 'bots',
                               'dartdoc_footer.html')
    url = 'https://api.dartlang.org/stable'
    with bot.BuildStep('Build API docs by dartdoc'):
        bot_utils.run([
            dart_exe, dartdoc_dart, '--sdk-docs', '--output', dirname,
            '--footer', footer_file, '--rel-canonical-prefix=' + url
        ])
Beispiel #2
0
def BuildDartdocAPIDocs(dirname):
  dart_sdk = os.path.join(bot_utils.DART_DIR,
                          utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
                          'dart-sdk')
  dart_exe =  os.path.join(dart_sdk, 'bin', 'dart')
  dartdoc_dart = os.path.join(bot_utils.DART_DIR,
                              'third_party', 'pkg' , 'dartdoc' , 'bin' , 
                              'dartdoc.dart')
  footer_file = os.path.join(bot_utils.DART_DIR,
                              'tools', 'bots', 'dartdoc_footer.html')
  url = 'https://api.dartlang.org/stable'
  with bot.BuildStep('Build API docs by dartdoc'):
    bot_utils.run([dart_exe, dartdoc_dart,
                  '--sdk-docs','--output', dirname, '--footer' , footer_file,
                  '--rel-canonical-prefix=' + url])
Beispiel #3
0
def SrcSteps():
    version = utils.GetVersion()
    builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS),
                            'src_and_installation')

    if not os.path.exists(builddir):
        os.makedirs(builddir)
    tarfilename = 'dart-%s.tar.gz' % version
    tarfile = os.path.join(builddir, tarfilename)

    print('Validating that we are on debian jessie')
    args = ['cat', '/etc/os-release']
    (stdout, stderr, exitcode) = bot_utils.run(args)
    if exitcode != 0:
        print("Could not find linux system, exiting")
        sys.exit(1)
    if not "jessie" in stdout:
        print("Trying to build debian bits but not on debian Jessie")
        print("You can't fix this, please contact dart-engprod@")
        sys.exit(1)

    print('Building src tarball')
    Run([
        sys.executable, './tools/create_tarball.py', '--tar_filename', tarfile
    ])

    print('Building Debian packages')
    Run([
        sys.executable, './tools/create_debian_packages.py', '--tar_filename',
        tarfile, '--out_dir', builddir
    ])

    if os.path.exists('/usr/bin/dart') or os.path.exists(
            '/usr/lib/dart/bin/dart2js'):
        print("Dart already installed, removing")
        UninstallDart()
    TestInstallation(assume_installed=False)

    InstallFromDep(builddir)
    TestInstallation(assume_installed=True)

    # We build the runtime target to get everything we need to test the
    # standalone target.
    Run([sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime'])
    # Copy in the installed binary to avoid poluting /usr/bin (and having to
    # run as root)
    Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart'])

    # Sanity check dart2js and the analyzer against a hello world program
    with utils.TempDir() as temp_dir:
        test_file = CreateDartTestFile(temp_dir)
        Run(['/usr/lib/dart/bin/dart2js', test_file])
        Run(['/usr/lib/dart/bin/dartanalyzer', test_file])
        Run(['/usr/lib/dart/bin/dart', test_file])

    # Sanity check that pub can start up and print the version
    Run(['/usr/lib/dart/bin/pub', '--version'])

    UninstallDart()
    TestInstallation(assume_installed=False)
Beispiel #4
0
def BuildDartdocAPIDocs(dirname):
  dart_sdk = os.path.join(bot_utils.DART_DIR,
                          utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
                          'dart-sdk')
  dart_exe =  os.path.join(dart_sdk, 'bin', 'dart')
  dartdoc_dart = os.path.join(bot_utils.DART_DIR,
                              'third_party', 'pkg' , 'dartdoc' , 'bin' , 
                              'dartdoc.dart')
  packages_dir = os.path.join(bot_utils.DART_DIR,
                              utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
                              'packages')
  footer_file = os.path.join(bot_utils.DART_DIR,
                              'tools', 'bots', 'dartdoc_footer.html')
  url = 'https://api.dartlang.org/stable'
  with bot.BuildStep('Build API docs by dartdoc'):
    bot_utils.run([dart_exe, '--package-root=' + packages_dir, dartdoc_dart, 
                  '--sdk-docs','--output', dirname, '--dart-sdk', dart_sdk, 
                  '--footer' , footer_file, '--rel-canonical-prefix=' + url])
Beispiel #5
0
def GsutilExists(gsu_path):
    # This is a little hackish, but it is basically a one off doing very
    # specialized check that we don't use elsewhere.
    gsutilTool = os.path.join(bot_utils.DART_DIR, 'third_party', 'gsutil',
                              'gsutil')
    (_, stderr, returncode) = bot_utils.run([gsutilTool, 'ls', gsu_path],
                                            throw_on_error=False)
    # If the returncode is nonzero and we can find a specific error message,
    # we know there are no objects with a prefix of [gsu_path].
    missing = (returncode and 'CommandException: No such object' in stderr)
    # Either the returncode has to be zero or the object must be missing,
    # otherwise throw an exception.
    if not missing and returncode:
        raise Exception("Failed to determine whether %s exists" % gsu_path)
    return not missing
Beispiel #6
0
def GsutilExists(gsu_path):
  # This is a little hackish, but it is basically a one off doing very
  # specialized check that we don't use elsewhere.
  gsutilTool = os.path.join(bot_utils.DART_DIR,
                            'third_party', 'gsutil', 'gsutil')
  (_, stderr, returncode) = bot_utils.run(
      [gsutilTool, 'ls', gsu_path],
      throw_on_error=False)
  # If the returncode is nonzero and we can find a specific error message,
  # we know there are no objects with a prefix of [gsu_path].
  missing = (returncode and 'CommandException: No such object' in stderr)
  # Either the returncode has to be zero or the object must be missing,
  # otherwise throw an exception.
  if not missing and returncode:
    raise Exception("Failed to determine whether %s exists" % gsu_path)
  return not missing
def SrcSteps(build_info):
  # We always clobber the bot, to not leave old tarballs and packages
  # floating around the out dir.
  bot.Clobber(force=True)

  version = utils.GetVersion()
  builddir = os.path.join(bot_utils.DART_DIR,
                          utils.GetBuildDir(HOST_OS),
                          'src_and_installation')

  if not os.path.exists(builddir):
    os.makedirs(builddir)
  tarfilename = 'dart-%s.tar.gz' % version
  tarfile = os.path.join(builddir, tarfilename)

  with bot.BuildStep('Validating linux system'):
    print 'Validating that we are on debian jessie'
    args = ['cat', '/etc/os-release']
    (stdout, stderr, exitcode) = bot_utils.run(args)
    if exitcode != 0:
      print "Could not find linux system, exiting"
      sys.exit(1)
    if not "jessie" in stdout:
      print "Trying to build debian bits but not on debian Jessie"
      print "You can't fix this, please contact whesse@"
      sys.exit(1)

  with bot.BuildStep('Create src tarball'):
    print 'Building src tarball'
    Run([sys.executable, './tools/create_tarball.py',
         '--tar_filename', tarfile])

    print 'Building Debian packages'
    Run([sys.executable, './tools/create_debian_packages.py',
         '--tar_filename', tarfile,
         '--out_dir', builddir])

  with bot.BuildStep('Sanity check installation'):
    if os.path.exists('/usr/bin/dart') or os.path.exists(
        '/usr/lib/dart/bin/dart2js'):
      print "Dart already installed, removing"
      UninstallDart()
    TestInstallation(assume_installed=False)

    InstallFromDep(builddir)
    TestInstallation(assume_installed=True)

    # We build the runtime target to get everything we need to test the
    # standalone target.
    Run([sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime'])
    # Copy in the installed binary to avoid poluting /usr/bin (and having to
    # run as root)
    Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart'])

    # We currently can't run the testing script on wheezy since the checked in
    # binary is built on precise, see issue 18742
    # TODO(18742): Run './tools/test.py' '-mrelease' 'standalone'

    # Sanity check dart2js and the analyzer against a hello world program
    with utils.TempDir() as temp_dir:
      test_file = CreateDartTestFile(temp_dir)
      Run(['/usr/lib/dart/bin/dart2js', test_file])
      Run(['/usr/lib/dart/bin/dartanalyzer', test_file])
      Run(['/usr/lib/dart/bin/dart', test_file])

    # Sanity check that pub can start up and print the version
    Run(['/usr/lib/dart/bin/pub', '--version'])

    UninstallDart()
    TestInstallation(assume_installed=False)

  with bot.BuildStep('Upload artifacts'):
    bot_name, _ = bot.GetBotName()
    channel = bot_utils.GetChannelFromName(bot_name)
    if channel != bot_utils.Channel.BLEEDING_EDGE:
     ArchiveArtifacts(tarfile, builddir, channel)
    else:
      print 'Not uploading artifacts on bleeding edge'
def SrcSteps(build_info):
    # We always clobber the bot, to not leave old tarballs and packages
    # floating around the out dir.
    bot.Clobber(force=True)

    version = utils.GetVersion()
    builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS),
                            'src_and_installation')

    if not os.path.exists(builddir):
        os.makedirs(builddir)
    tarfilename = 'dart-%s.tar.gz' % version
    tarfile = os.path.join(builddir, tarfilename)

    with bot.BuildStep('Validating linux system'):
        print 'Validating that we are on debian jessie'
        args = ['cat', '/etc/os-release']
        (stdout, stderr, exitcode) = bot_utils.run(args)
        if exitcode != 0:
            print "Could not find linux system, exiting"
            sys.exit(1)
        if not "jessie" in stdout:
            print "Trying to build debian bits but not on debian Jessie"
            print "You can't fix this, please contact whesse@"
            sys.exit(1)

    with bot.BuildStep('Create src tarball'):
        print 'Building src tarball'
        Run([
            sys.executable, './tools/create_tarball.py', '--tar_filename',
            tarfile
        ])

        print 'Building Debian packages'
        Run([
            sys.executable, './tools/create_debian_packages.py',
            '--tar_filename', tarfile, '--out_dir', builddir
        ])

    with bot.BuildStep('Sanity check installation'):
        if os.path.exists('/usr/bin/dart') or os.path.exists(
                '/usr/lib/dart/bin/dart2js'):
            print "Dart already installed, removing"
            UninstallDart()
        TestInstallation(assume_installed=False)

        InstallFromDep(builddir)
        TestInstallation(assume_installed=True)

        # We build the runtime target to get everything we need to test the
        # standalone target.
        Run([
            sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime'
        ])
        # Copy in the installed binary to avoid poluting /usr/bin (and having to
        # run as root)
        Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart'])

        # We currently can't run the testing script on wheezy since the checked in
        # binary is built on precise, see issue 18742
        # TODO(18742): Run './tools/test.py' '-mrelease' 'standalone'

        # Sanity check dart2js and the analyzer against a hello world program
        with utils.TempDir() as temp_dir:
            test_file = CreateDartTestFile(temp_dir)
            Run(['/usr/lib/dart/bin/dart2js', test_file])
            Run(['/usr/lib/dart/bin/dartanalyzer', test_file])
            Run(['/usr/lib/dart/bin/dart', test_file])

        # Sanity check that pub can start up and print the version
        Run(['/usr/lib/dart/bin/pub', '--version'])

        UninstallDart()
        TestInstallation(assume_installed=False)
def SrcSteps(build_info):
  # We always clobber the bot, to not leave old tarballs and packages
  # floating around the out dir.
  bot.Clobber(force=True)

  version = utils.GetVersion()
  builddir = os.path.join(bot_utils.DART_DIR,
                          utils.GetBuildDir(HOST_OS, HOST_OS),
                          'src_and_installation')

  if not os.path.exists(builddir):
    os.makedirs(builddir)
  tarfilename = 'dart-%s.tar.gz' % version
  tarfile = os.path.join(builddir, tarfilename)

  with bot.BuildStep('Validating linux system'):
    print 'Validating that we are on %s' % build_info.builder_tag
    args = ['cat', '/etc/os-release']
    (stdout, stderr, exitcode) = bot_utils.run(args)
    if exitcode != 0:
      print "Could not find linux system, exiting"
      sys.exit(1)

    if build_info.builder_tag == "debian_wheezy":
      if not "wheezy" in stdout:
        print "Trying to build debian bits on a non debian system"
        sys.exit(1)
    if build_info.builder_tag == "ubuntu_precise":
      if not "precise" in stdout:
        print "Trying to build ubuntu bits on a non ubuntu system"
        sys.exit(1)

  with bot.BuildStep('Create src tarball'):
    print 'Building src tarball'
    Run([sys.executable, './tools/create_tarball.py',
         '--tar_filename', tarfile])

    print 'Building Debian packages'
    Run([sys.executable, './tools/create_debian_packages.py',
         '--tar_filename', tarfile,
         '--out_dir', builddir])

  with bot.BuildStep('Sanity check installation'):
    if os.path.exists('/usr/bin/dart'):
      print "Dart already installled, removing"
      UninstallDart()
    TestInstallation(assume_installed=False)

    InstallFromDep(builddir)
    TestInstallation(assume_installed=True)

    # We build the runtime target to get everything we need to test the
    # standalone target.
    Run([sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime'])
    # Copy in the installed binary to avoid poluting /usr/bin (and having to
    # run as root)
    Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart'])

    # We currently can't run the testing script on wheezy since the checked in
    # binary is built on precise, see issue 18742
    if (build_info.builder_tag == 'ubuntu_precise'):
      Run([sys.executable, './tools/test.py', '-ax64',
          '--mode=release', 'standalone'])

    # Sanity check dart2js and the analyzer against a hello world program
    with utils.TempDir() as temp_dir:
      test_file = CreateDartTestFile(temp_dir)
      Run(['/usr/lib/dart/bin/dart2js', test_file])
      Run(['/usr/lib/dart/bin/dartanalyzer', test_file])
      Run(['/usr/lib/dart/bin/dart', test_file])

    # Sanity check that pub can start up and print the version
    Run(['/usr/lib/dart/bin/pub', '--version'])

    UninstallDart()
    TestInstallation(assume_installed=False)

  with bot.BuildStep('Upload artifacts'):
    bot_name, _ = bot.GetBotName()
    channel = bot_utils.GetChannelFromName(bot_name)
    if channel != bot_utils.Channel.BLEEDING_EDGE:
     ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag)
    else:
      print 'Not uploading artifacts on bleeding edge'
def SrcSteps(build_info):
    # We always clobber the bot, to not leave old tarballs and packages
    # floating around the out dir.
    bot.Clobber(force=True)

    version = utils.GetVersion()
    builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS), "src_and_installation")

    if not os.path.exists(builddir):
        os.makedirs(builddir)
    tarfilename = "dart-%s.tar.gz" % version
    tarfile = os.path.join(builddir, tarfilename)

    with bot.BuildStep("Validating linux system"):
        print "Validating that we are on %s" % build_info.builder_tag
        args = ["cat", "/etc/os-release"]
        (stdout, stderr, exitcode) = bot_utils.run(args)
        if exitcode != 0:
            print "Could not find linux system, exiting"
            sys.exit(1)

        if build_info.builder_tag == "debian_wheezy":
            if not "wheezy" in stdout:
                print "Trying to build debian bits on a non debian system"
                print "You can't fix this, please contact ricow@ or whesse@"
                sys.exit(1)
        if build_info.builder_tag == "ubuntu_precise":
            if not "precise" in stdout:
                print "Trying to build ubuntu bits on a non ubuntu system"
                print "You can't fix this, please contact ricow@ or whesse@"
                sys.exit(1)

    with bot.BuildStep("Create src tarball"):
        print "Building src tarball"
        Run([sys.executable, "./tools/create_tarball.py", "--tar_filename", tarfile])

        print "Building Debian packages"
        Run([sys.executable, "./tools/create_debian_packages.py", "--tar_filename", tarfile, "--out_dir", builddir])

    with bot.BuildStep("Sanity check installation"):
        if os.path.exists("/usr/bin/dart"):
            print "Dart already installled, removing"
            UninstallDart()
        TestInstallation(assume_installed=False)

        InstallFromDep(builddir)
        TestInstallation(assume_installed=True)

        # We build the runtime target to get everything we need to test the
        # standalone target.
        Run([sys.executable, "./tools/build.py", "-mrelease", "-ax64", "runtime"])
        # Copy in the installed binary to avoid poluting /usr/bin (and having to
        # run as root)
        Run(["cp", "/usr/bin/dart", "out/ReleaseX64/dart"])

        # We currently can't run the testing script on wheezy since the checked in
        # binary is built on precise, see issue 18742
        if build_info.builder_tag == "ubuntu_precise":
            Run([sys.executable, "./tools/test.py", "-ax64", "--mode=release", "standalone"])

        # Sanity check dart2js and the analyzer against a hello world program
        with utils.TempDir() as temp_dir:
            test_file = CreateDartTestFile(temp_dir)
            Run(["/usr/lib/dart/bin/dart2js", test_file])
            Run(["/usr/lib/dart/bin/dartanalyzer", test_file])
            Run(["/usr/lib/dart/bin/dart", test_file])

        # Sanity check that pub can start up and print the version
        Run(["/usr/lib/dart/bin/pub", "--version"])

        UninstallDart()
        TestInstallation(assume_installed=False)

    with bot.BuildStep("Upload artifacts"):
        bot_name, _ = bot.GetBotName()
        channel = bot_utils.GetChannelFromName(bot_name)
        if channel != bot_utils.Channel.BLEEDING_EDGE:
            ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag)
        else:
            print "Not uploading artifacts on bleeding edge"