예제 #1
0
def BuildOptions():
    result = optparse.OptionParser()
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release]',
                      default='debug')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option("-a",
                      "--arch",
                      help='Target architectures (comma-separated).',
                      metavar='[all,ia32,x64,simarm,arm,simmips,mips]',
                      default=utils.GuessArchitecture())
    result.add_option("--os",
                      help='Target OSs (comma-separated).',
                      metavar='[all,host,android]',
                      default='host')
    result.add_option("-j",
                      help='The number of parallel jobs to run.',
                      metavar=HOST_CPUS,
                      default=str(HOST_CPUS))
    (vs_directory, vs_executable) = utils.GuessVisualStudioPath()
    result.add_option("--devenv",
                      help='Path containing devenv.com on Windows',
                      default=vs_directory)
    result.add_option(
        "--executable",
        help='Name of the devenv.com/msbuild executable on Windows (varies for '
        'different versions of Visual Studio)',
        default=vs_executable)
    return result
예제 #2
0
def BuildOptions():
    result = optparse.OptionParser()
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release]',
                      default='debug')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option("--arch",
                      help='Target architectures (comma-separated).',
                      metavar='[all,ia32,x64,simarm,arm]',
                      default=utils.GuessArchitecture())
    result.add_option("-j",
                      help='The number of parallel jobs to run.',
                      metavar=HOST_CPUS,
                      default=str(HOST_CPUS))
    result.add_option(
        "--devenv",
        help='Path containing devenv.com on Windows',
        default=
        'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE')
    return result
예제 #3
0
def BuildOptions():
    result = optparse.OptionParser(usage=usage)
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release,product]',
                      default='debug')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option(
        "-a",
        "--arch",
        help='Target architectures (comma-separated).',
        metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,'
        'simmips,mips,simarm64,arm64,simdbc,armsimdbc]',
        default=utils.GuessArchitecture())
    result.add_option("--os",
                      help='Target OSs (comma-separated).',
                      metavar='[all,host,android]',
                      default='host')
    result.add_option("-j",
                      type=int,
                      help='Ninja -j option for Goma builds.',
                      metavar=1000,
                      default=1000)
    return result
예제 #4
0
def BuildOptions():
  result = optparse.OptionParser(usage=usage)
  result.add_option("-a", "--arch",
      help='Target architectures (comma-separated).',
      metavar='[all,' + ','.join(AVAILABLE_ARCHS) + ']',
      default=utils.GuessArchitecture())
  result.add_option("-b", "--bytecode",
      help='Build with the kernel bytecode interpreter. DEPRECATED.',
      default=False,
      action='store_true')
  result.add_option("-j",
      type=int,
      help='Ninja -j option for Goma builds.',
      default=1000)
  result.add_option("-l",
      type=int,
      help='Ninja -l option for Goma builds.',
      default=64)
  result.add_option("-m", "--mode",
      help='Build variants (comma-separated).',
      metavar='[all,debug,release,product]',
      default='debug')
  result.add_option("--no-start-goma",
      help="Don't try to start goma",
      default=False,
      action='store_true')
  result.add_option("--os",
      help='Target OSs (comma-separated).',
      metavar='[all,host,android]',
      default='host')
  result.add_option("-v", "--verbose",
      help='Verbose output.',
      default=False, action="store_true")
  return result
예제 #5
0
def BuildOptions():
    result = optparse.OptionParser()
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release]',
                      default='release')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option("-c",
                      "--core",
                      help='Run only core benchmarks.',
                      default=False,
                      action="store_true")
    result.add_option("--arch",
                      help='Target architectures (comma-separated).',
                      metavar='[all,ia32,x64,simarm,arm,dartc]',
                      default=utils.GuessArchitecture())
    result.add_option("--executable",
                      help='Virtual machine to execute.',
                      metavar='[dart, (path to dart binary)]',
                      default=None)
    result.add_option("-w",
                      "--warmup",
                      help='Only run the warmup period.',
                      default=False,
                      action="store_true")
    return result
예제 #6
0
파일: build.py 프로젝트: ziyue7575/sdk
def BuildOptions():
    result = optparse.OptionParser(usage=usage)
    result.add_option(
        "-a",
        "--arch",
        help='Target architectures (comma-separated).',
        metavar='[all,' + ','.join(AVAILABLE_ARCHS) + ']',
        default=utils.GuessArchitecture())
    result.add_option(
        "-b",
        "--bytecode",
        help='Build with the kernel bytecode interpreter. DEPRECATED.',
        default=False,
        action='store_true')
    result.add_option(
        "-j", type=int, help='Ninja -j option for Goma builds.', default=1000)
    result.add_option(
        "-l", type=int, help='Ninja -l option for Goma builds.', default=64)
    result.add_option(
        "-m",
        "--mode",
        help='Build variants (comma-separated).',
        metavar='[all,debug,release,product]',
        default='debug')
    result.add_option(
        "--no-start-goma",
        help="Don't try to start goma",
        default=False,
        action='store_true')
    result.add_option(
        "--os",
        help='Target OSs (comma-separated).',
        metavar='[all,host,android]',
        default='host')
    result.add_option(
        "--sanitizer",
        type=str,
        help='Build variants (comma-separated).',
        metavar='[all,none,asan,lsan,msan,tsan,ubsan]',
        default='none')
    # TODO(38701): Remove this option once the NNBD SDK is stable/performant
    # and there is no need to build a legacy version of the SDK for comparison
    # purposes.
    result.add_option(
        "--no-nnbd",
        help='Build the Legacy (pre NNBD) version of the SDK.',
        default=False,
        action='store_true')
    result.add_option(
        "-v",
        "--verbose",
        help='Verbose output.',
        default=False,
        action="store_true")
    return result
예제 #7
0
파일: build.py 프로젝트: spbennett/sdk
def BuildOptions():
    result = optparse.OptionParser(usage=usage)
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release]',
                      default='debug')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option(
        "-a",
        "--arch",
        help='Target architectures (comma-separated).',
        metavar='[all,ia32,x64,simarm,arm,simarmv5te,armv5te,simmips,mips'
        ',simarm64,arm64,]',
        default=utils.GuessArchitecture())
    result.add_option("--os",
                      help='Target OSs (comma-separated).',
                      metavar='[all,host,android]',
                      default='host')
    result.add_option("-t",
                      "--toolchain",
                      help='Cross-compiler toolchain path',
                      default=None)
    result.add_option("-j",
                      help='The number of parallel jobs to run.',
                      metavar=HOST_CPUS,
                      default=str(HOST_CPUS))
    (vs_directory, vs_executable) = utils.GuessVisualStudioPath()
    result.add_option("--devenv",
                      help='Path containing devenv.com on Windows',
                      default=vs_directory)
    result.add_option(
        "--executable",
        help='Name of the devenv.com/msbuild executable on Windows (varies for '
        'different versions of Visual Studio)',
        default=vs_executable)
    result.add_option(
        "--use-bootstrap-for-observatory",
        help='Use a stripped down Dart binary built on the host machine '
        'for building Observatory. Necessary on Linux machines which have '
        'libc incompatibilities with the prebuilt Dart binaries.',
        default=False,
        action="store_true")
    return result
예제 #8
0
def main():
    GetOptions()

    SetGsutil()

    # Execute Docgen.dart on the SDK.
    utils.ExecuteCommand(['python', 'dartdoc.py', '-d'])

    # Use SVN Revision to get the revision number.
    revision = None
    if trustSVN:
        revision = utils.GetSVNRevision()

    if revision is None:
        # Try to find the version from the dart-sdk folder.
        revision_file_location = abspath(
            join(
                dirname(__file__), '../../../%s/%s/dart-sdk/revision' %
                (utils.BUILD_ROOT[utils.GuessOS()],
                 utils.GetBuildConf('release', utils.GuessArchitecture()))))
        with open(revision_file_location, 'r') as revision_file:
            revision = revision_file.readline(5)
            revision_file.close()

        if revision is None:
            raise Exception("Unable to find revision. ")

    # Upload the all files in Docs into a folder based off Revision number on
    # Cloud Storage.
    # TODO(alanknight): If we give it ./docs/* it fails to upload files in the
    # subdirectory, probably due to escaping. Work around it by changing dir.
    # Better, generalize this to be less dependent on the working directory.
    os.chdir('docs')
    Upload('.', GS_SITE + '/' + revision + '/')
    os.chdir('..')

    # Update VERSION file in Cloud Storage.
    with open('VERSION', 'w') as version_file:
        version_file.write(revision)
        version_file.close()
    Upload('./VERSION', GS_SITE + '/VERSION')
    Upload('./VERSION', GS_SITE + '/' + revision + '/' + 'VERSION')

    # Clean up the files it creates.
    utils.ExecuteCommand(['rm', '-rf', './docs'])
    utils.ExecuteCommand(['rm', '-f', './VERSION'])
예제 #9
0
파일: build.py 프로젝트: robbielamb-wf/sdk
def BuildOptions():
    result = optparse.OptionParser(usage=usage)
    result.add_option("-m",
                      "--mode",
                      help='Build variants (comma-separated).',
                      metavar='[all,debug,release,product]',
                      default='debug')
    result.add_option("-v",
                      "--verbose",
                      help='Verbose output.',
                      default=False,
                      action="store_true")
    result.add_option(
        "-a",
        "--arch",
        help='Target architectures (comma-separated).',
        metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,'
        'simarm64,arm64,simdbc,armsimdbc]',
        default=utils.GuessArchitecture())
    result.add_option("--os",
                      help='Target OSs (comma-separated).',
                      metavar='[all,host,android]',
                      default='host')
    result.add_option("-t",
                      "--toolchain",
                      help='Cross-compiler toolchain path',
                      default=None)
    result.add_option("-j",
                      help='The number of parallel jobs to run.',
                      metavar=HOST_CPUS,
                      default=str(HOST_CPUS))
    (vs_directory, vs_executable) = utils.GuessVisualStudioPath()
    result.add_option("--devenv",
                      help='Path containing devenv.com on Windows',
                      default=vs_directory)
    result.add_option(
        "--executable",
        help='Name of the devenv.com/msbuild executable on Windows (varies for '
        'different versions of Visual Studio)',
        default=vs_executable)
    result.add_option("--gyp",
                      help='Build with gyp.',
                      default=use_gyp(),
                      action='store_true')
    return result
예제 #10
0
def AddCommonConfigurationArgs(parser):
    """Adds arguments that influence which configuration will be built."""
    parser.add_argument("-a",
                        "--arch",
                        type=str,
                        help='Target architectures (comma-separated).',
                        metavar='[all,' + ','.join(AVAILABLE_ARCHS) + ']',
                        default=utils.GuessArchitecture())
    parser.add_argument('--mode',
                        '-m',
                        type=str,
                        help='Build variants (comma-separated).',
                        metavar='[all,debug,release,product]',
                        default='debug')
    parser.add_argument('--os',
                        type=str,
                        help='Target OSs (comma-separated).',
                        metavar='[all,host,android,fuchsia]',
                        default='host')
    parser.add_argument('--sanitizer',
                        type=str,
                        help='Build variants (comma-separated).',
                        metavar='[all,none,asan,lsan,msan,tsan,ubsan]',
                        default='none')
예제 #11
0
def Flags():
    result = optparse.OptionParser()
    result.add_option("-v",
                      "--verbose",
                      help="Print messages",
                      default=False,
                      action="store_true")
    result.add_option("-t",
                      "--test",
                      help="App or Dart file containing the test",
                      type="string",
                      action="store",
                      default=None)
    result.add_option("--arch",
                      help="The architecture to run tests for",
                      metavar="[ia32,x64,arm,simarm,dartc,chromium,dartium]",
                      default=utils.GuessArchitecture())
    result.add_option("-m",
                      "--mode",
                      help="The test modes in which to run",
                      metavar='[debug,release]',
                      default='debug')
    result.set_usage("run.py --arch ARCH --mode MODE -t TEST")
    return result
예제 #12
0
#!/usr/bin/env python
# Copyright 2016 The Dart project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import argparse
import multiprocessing
import os
import shutil
import subprocess
import sys
import time
import utils

HOST_OS = utils.GuessOS()
HOST_ARCH = utils.GuessArchitecture()
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
GN = os.path.join(DART_ROOT, 'buildtools', 'gn')

# Environment variables for default settings.
DART_USE_ASAN = "DART_USE_ASAN"  # Use instead of --asan
DART_USE_LSAN = "DART_USE_LSAN"  # Use instead of --lsan
DART_USE_MSAN = "DART_USE_MSAN"  # Use instead of --msan
DART_USE_TSAN = "DART_USE_TSAN"  # Use instead of --tsan
DART_USE_UBSAN = "DART_USE_UBSAN"  # Use instead of --ubsan
DART_USE_TOOLCHAIN = "DART_USE_TOOLCHAIN"  # Use instread of --toolchain-prefix
DART_USE_SYSROOT = "DART_USE_SYSROOT"  # Use instead of --target-sysroot
DART_USE_CRASHPAD = "DART_USE_CRASHPAD"  # Use instead of --use-crashpad
# use instead of --platform-sdk
DART_MAKE_PLATFORM_SDK = "DART_MAKE_PLATFORM_SDK"
예제 #13
0
            defs[name] = value
            continue
        prefix_match = PREFIX_PATTERN.match(line)
        if prefix_match:
            prefix = SplitPath(prefix_match.group(1).strip())
            continue
        print "Malformed line: '%s'." % line
        return False
    return True


# ---------------
# --- M a i n ---
# ---------------

ARCH_GUESS = utils.GuessArchitecture()


def BuildOptions():
    result = optparse.OptionParser()
    result.add_option("-m",
                      "--mode",
                      help="The test modes in which to run (comma-separated)",
                      default='release')
    result.add_option("-v",
                      "--verbose",
                      help="Verbose output",
                      default=False,
                      action="store_true")
    result.add_option("-S",
                      dest="scons_flags",
예제 #14
0
def Main():
    global OUTPUT
    global BUILD

    parser = BuildOptions()
    (options, args) = parser.parse_args()

    if args:
        parser.print_help()
        return 1

    osName = utils.GuessOS()
    mode = 'debug'
    arch = utils.GuessArchitecture()

    if not options.build:
        print >> sys.stderr, 'Error: no --build option specified'
        exit(1)
    else:
        BUILD = options.build

    if not options.out:
        print >> sys.stderr, 'Error: no --out option specified'
        exit(1)
    else:
        # TODO(devoncarew): Currently we scrape the output path to determine the
        # mode and arch. This is fragile and should moved into one location
        # (utils.py?) or made more explicit.
        OUTPUT = options.out
        mode = ('release', 'debug')['Debug' in OUTPUT]
        arch = ('ia32', 'x64')['X64' in OUTPUT]

    # Use explicit mode and arch information.
    if options.mode:
        mode = options.mode
    if options.arch:
        arch = options.arch

    OUTPUT = os.path.abspath(OUTPUT)
    BUILD = os.path.abspath(BUILD)

    print "\nBuilding the editor"
    print "  config : %s, %s, %s" % (osName, arch, mode)
    print "  output : %s" % OUTPUT

    # Clean the editor output directory.
    print '\ncleaning %s' % OUTPUT
    shutil.rmtree(OUTPUT, True)

    # These are the valid eclipse build configurations that we can produce.
    # We synthesize these up from the OS_CONFIG and ARCH_CONFIG information.
    # macosx, cocoa, x86 & macosx, cocoa, x86_64
    # win32, win32, x86 & win32, win32, x86_64
    # linux, gtk, x86 & linux, gtk, x86_64

    buildConfig = OS_CONFIG[osName] + ', ' + ARCH_CONFIG[arch]

    print "\ninvoking build_rcp.xml with buildConfig = [%s]\n" % buildConfig

    sys.stdout.flush()
    sys.stderr.flush()

    buildScript = join('editor', 'tools', 'features',
                       'com.google.dart.tools.deploy.feature_releng',
                       'build_rcp.xml')
    build_cmd = [
        AntPath(), '-lib',
        join('third_party', 'bzip2', 'bzip2.jar'), '-Dbuild.out=' + OUTPUT,
        '-Dbuild.configs=' + buildConfig,
        '-Dbuild.root=' + GetEclipseBuildRoot(),
        '-Dbuild.downloads=' + GetDownloadCache(),
        '-Dbuild.source=' + os.path.abspath('editor'),
        '-Dbuild.dart.sdk=' + GetSdkPath(), '-Dbuild.no.properties=true',
        '-Dbuild.channel=' + utils.GetChannel(),
        '-Dbuild.revision=' + utils.GetSVNRevision(),
        '-Dbuild.version.qualifier=' + utils.GetEclipseVersionQualifier(),
        '-Ddart.version.full=' + utils.GetVersion(), '-buildfile', buildScript
    ]
    print build_cmd
    buildRcpStatus = subprocess.call(build_cmd, shell=utils.IsWindows())

    if buildRcpStatus != 0:
        sys.exit(buildRcpStatus)

    # build_rcp.xml will put the built editor archive in the OUTPUT directory
    # (dart-editor-macosx.cocoa.x86.zip). It contains the editor application in a
    # dart/ subdirectory. We unzip the contents of the archive into OUTPUT. It
    # will use the ../dart-sdk directory as its SDK.
    archives = glob.glob(join(OUTPUT, '*.zip'))

    if archives:
        ProcessEditorArchive(arch, archives[0], OUTPUT)

    if os.path.exists(GetEditorTemp()):
        shutil.rmtree(GetEditorTemp())

    print('\nEditor build successful')
예제 #15
0
"""

import optparse
import os
from os.path import join, dirname, abspath, exists
import platform
import subprocess
import sys
sys.path.append(abspath(join(dirname(__file__), '../../../tools')))
import utils

DART = abspath(
    join(
        dirname(__file__), '../../../%s/%s/dart-sdk/bin/dart' %
        (utils.BUILD_ROOT[utils.GuessOS()],
         utils.GetBuildConf('release', utils.GuessArchitecture()))))
PACKAGE_ROOT = abspath(
    join(
        dirname(__file__), '../../../%s/%s/packages/' %
        (utils.BUILD_ROOT[utils.GuessOS()],
         utils.GetBuildConf('release', utils.GuessArchitecture()))))
GSUTIL = utils.GetBuildbotGSUtilPath()
GS_SITE = 'gs://dartlang-docgen'
DESCRIPTION = 'Runs docgen.dart on the SDK libraries, and uploads them to Google \
    Cloud Storage for the dartdoc-viewer. '

# Allow us to override checking SVN's revision number. Useful for development
# so we can upload docs from a branch using an SDK that was built on a
# revision newer than when the branch was forked.
trustSVN = None