<commit_before>#!/usr/bin/env python
#
# Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

import os
import os.path
import shutil
import sys
import subprocess

import bot
import bot_utils

utils = bot_utils.GetUtils()

BUILD_OS = utils.GuessOS()

(bot_name, _) = bot.GetBotName()
CHANNEL = bot_utils.GetChannelFromName(bot_name)

def BuildSDK():
  with bot.BuildStep('Build SDK'):
    sysroot_env =  dict(os.environ)
    if BUILD_OS == 'linux':
      ia32root = os.path.join(bot_utils.DART_DIR, '..', 'sysroots',
                              'build', 'linux', 'debian_wheezy_i386-sysroot')
      sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 "
               "-I=/usr/include/c++/4.6/i486-linux-gnu") % ia32root
      sysroot_env['LDFLAGS'] = '--sysroot=%s' % ia32root
      sysroot_env['CFLAGS'] = '--sysroot=%s' % ia32root
    Run([sys.executable, './tools/build.py', '--mode=release',
         '--arch=ia32', 'create_sdk'], env=sysroot_env)

    x64root = os.path.join(bot_utils.DART_DIR, '..', 'sysroots', 'build',
                           'linux', 'debian_wheezy_amd64-sysroot')
    if BUILD_OS == 'linux':
      sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 "
              "-I=/usr/include/c++/4.6/x86_64-linux-gnu") % x64root
      sysroot_env['LDFLAGS'] = '--sysroot=%s' % x64root
      sysroot_env['CFLAGS'] = '--sysroot=%s' % x64root
    Run([sys.executable, './tools/build.py', '--mode=release',
         '--arch=x64', 'create_sdk'], env=sysroot_env)

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, '--dart-sdk', dart_sdk, 
                  '--footer' , footer_file, '--rel-canonical-prefix=' + url])
<commit_msg>fix arguments for dartdoc run<commit_after>#!/usr/bin/env python
#
# Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

import os
import os.path
import shutil
import sys
import subprocess

import bot
import bot_utils

utils = bot_utils.GetUtils()

BUILD_OS = utils.GuessOS()

(bot_name, _) = bot.GetBotName()
CHANNEL = bot_utils.GetChannelFromName(bot_name)

def BuildSDK():
  with bot.BuildStep('Build SDK'):
    sysroot_env =  dict(os.environ)
    if BUILD_OS == 'linux':
      ia32root = os.path.join(bot_utils.DART_DIR, '..', 'sysroots',
                              'build', 'linux', 'debian_wheezy_i386-sysroot')
      sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 "
               "-I=/usr/include/c++/4.6/i486-linux-gnu") % ia32root
      sysroot_env['LDFLAGS'] = '--sysroot=%s' % ia32root
      sysroot_env['CFLAGS'] = '--sysroot=%s' % ia32root
    Run([sys.executable, './tools/build.py', '--mode=release',
         '--arch=ia32', 'create_sdk'], env=sysroot_env)

    x64root = os.path.join(bot_utils.DART_DIR, '..', 'sysroots', 'build',
                           'linux', 'debian_wheezy_amd64-sysroot')
    if BUILD_OS == 'linux':
      sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 "
              "-I=/usr/include/c++/4.6/x86_64-linux-gnu") % x64root
      sysroot_env['LDFLAGS'] = '--sysroot=%s' % x64root
      sysroot_env['CFLAGS'] = '--sysroot=%s' % x64root
    Run([sys.executable, './tools/build.py', '--mode=release',
         '--arch=x64', 'create_sdk'], env=sysroot_env)

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])

{'fraction_non_alphanumeric': 0.16583316663332667, 'fraction_numerical': 0.01840368073614723, 'mean_word_length': 2.5587188612099645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4856056', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1774, 'n_words': 324}