Runs the specified build command with the provided configuration.

@param {Object} options
8264
async function runBuildCommand({command, config, watch}) {
  try {
    const {size, count, warnings} = await workboxBuild[command](config);

    for (const warning of warnings) {
      logger.warn(warning);
    }

    logger.log(`The service worker was written to ${config.swDest}\n` +
      `${count} files will be precached, totalling ${prettyBytes(size)}.`);

    if (watch) {
      logger.log(`\nWatching for changes...`);
    }
  } catch (error) {
    // See https://github.com/hapijs/joi/blob/v11.3.4/API.md#errors
    if (typeof error.annotate === 'function') {
      throw new Error(
          `${errors['config-validation-failed']}\n${error.annotate()}`);
    }
    logger.error(errors['workbox-build-runtime-error']);
    throw error;
  }
}
365600
function run(program, options, library) {
    var opts = Assign({}, DEFAULT_OPTIONS, options);
    var argv = opts.argv || [];
    var event = opts.event || null;

    var tokens = RuniqParser.lex(program);
    var ast = RuniqParser.parse(tokens);
    if (!library) library = _createLibrary();
    var interpreter = new RuniqInterpreter(library, opts);

    interpreter.run(ast, argv, event, function(err, result) {
        if (err && opts.error) return opts.error(err);
        if (opts.success) return opts.success(result);
    });
}
739818
function exec(command, options) {
    var d = Promise.defer();

    var child = childProcess.exec(command, options, function(err, stdout, stderr) {
        if (!err) {
            return d.resolve();
        }

        err.message = stdout.toString('utf8') + stderr.toString('utf8');
        d.reject(err);
    });

    child.stdout.on('data', function (data) {
        d.notify(data);
    });

    child.stderr.on('data', function (data) {
        d.notify(data);
    });

    return d.promise;
}
1359375
function exec(cmd, args, opts) {
  console.log(`Running command: ${cmd} ${args.join(' ')}`);
  const cp = childProcessSpawn(cmd, args, opts);

  cp.stdout.on('data', data => log(data));
  cp.stderr.on('data', data => log(data));

  return new Promise((resolve, reject) => {
    cp.on('error', err => reject(log(err)));
    cp.on('exit', code => resolve(code));
  });
}
991697
def build(self):
        
        if not self.build_cmds:
            LOGGER.debug('No build commands were found, skipping build step')

        with LogTask('Building {} disk {}'.format(self.name, self.disk_path)):
            for command in self.build_cmds:
                with LogTask('Running command {}'.format(command.name)):
                    LOGGER.debug(command.cmd)
                    result = utils.run_command(command.cmd)
                    if result:
                        raise BuildException(result.err)
660338
function build(options) {
  installGitDependencies(options, function(err) {
    if (err) {
      console.error(err.message);
      process.exit(1);
    }

    var args = [path.join('node_modules', 'pangyp', 'bin', 'node-gyp'), 'rebuild'].concat(
      ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) {
        return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
      })).concat(options.args);

    console.log(['Building:', process.sass.runtime.execPath].concat(args).join(' '));

    var proc = spawn(process.sass.runtime.execPath, args, {
      stdio: [0, 1, 2]
    });

    proc.on('exit', function(errorCode) {
      if (!errorCode) {
        afterBuild(options);

        return;
      }

      console.error(errorCode === 127 ? 'node-gyp not found!' : 'Build failed');
      process.exit(1);
    });
  });
}
834617
async function Execute(command, args, watch) {
    let full = args.filter(s => s === "--full").length > 0;
    switch (command) {
        case "wp":
            let wp = `webpack --config ./config/webpack.${args[0]}.ts`;
            if (watch) wp += " --watch";
            await run(wp);
            break;
        case "deploy":
            await run("node script wp dist");
            break;
        case "publish":
            await run(`npm run deploy`);
            await run(`git add .`); 
            await run(`git commit -m "Preparing for next ${args[0]} version`); 
            await run(`npm version ${args[0]}`);
            await run(`npm publish`);
            break;
        default:
            console.log("Unknown command!");
            process.exit(1);
    }

}
913107
function() {
    if (!builds.length) { return; } // this shouldn't happen

    var build = builds.shift();
    var buildCallback = function(stats) {
      cb(build.buildName, stats);
      if (builds.length) {
        runNextBuild();
      }
    };
    console.log(colors.cyan('[Starting build]'), build.buildName);
    executeBuild(build, buildCallback);
  }
1315664
public static void run( Options options) throws Exception
    {
    if( options.showVersion())
      {
      System.out.println( getVersion());
      return;
      }
    logger_.info( "{}", getVersion());

    // Identify the system input definition file.
    File inputDefOption = options.getInputDef();
    if( inputDefOption != null && !inputDefOption.isAbsolute())
      {
      inputDefOption = new File( options.getWorkingDir(), inputDefOption.getPath());
      }

    File inputDefFile = inputDefOption;
    if( inputDefFile != null
        && !inputDefFile.exists()
        && !(inputDefFile = new File( inputDefOption.getPath() + "-Input.xml")).exists()
        && !(inputDefFile = new File( inputDefOption.getPath() + ".xml")).exists()
        && !(inputDefFile = new File( inputDefOption.getPath() + "-Input.json")).exists()
        && !(inputDefFile = new File( inputDefOption.getPath() + ".json")).exists())
        {
        throw new RuntimeException( "Can't locate input file for path=" + options.getInputDef());
        }

    File inputDir =
      inputDefFile==null
      ? options.getWorkingDir()
      : inputDefFile.getParentFile();

    Resource.Type defaultContentType =
      firstNonNull
      ( options.getContentType(),
        Resource.Type.of( inputDefFile),
        Resource.Type.XML);

    // Read the system input definition.
    logger_.info( "Reading system input definition={}", inputDefFile);
    SystemInputDef inputDef = null;
    try( SystemInputResource reader = withDefaultType( SystemInputResource.of( inputDefFile), defaultContentType))
      {
      inputDef = reader.getSystemInputDef();
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't read input definition file=" + inputDefFile, e);
      }

    // Test definition defined?
    String projectName = getProjectName( inputDefFile);
    File testDefFile = options.getTestDef();
    if( testDefFile == null && inputDefFile != null)
      {
      // No, derive default from input file.
      testDefFile = withDefaultType( new File( projectName + "-Test"), defaultContentType);
      }

    // Identify base test definition file.
    File baseDefFile = testDefFile;
    if( baseDefFile != null && !baseDefFile.isAbsolute())
      {
      // For relative path, read base test definitions from input directory.
      baseDefFile = new File( inputDir, baseDefFile.getPath());
      }

    // Output file defined?
    File outputDir = options.getOutDir();
    File outputFile = options.getOutFile();
    if ( outputFile == null)
      {
      // No, defaults to...
      outputFile =
        // ... JUnit test class file, if generating JUnit
        options.getTransformType() == Options.TransformType.JUNIT && inputDefFile != null
        ? new File( projectName.replaceAll( "\\W+", "") + "Test.java") :

        // ... HTML file, if generating HTML
        options.getTransformType() == Options.TransformType.HTML && inputDefFile != null
        ? new File( projectName + "-Test.htm") :

        // ... else test definition file.
        testDefFile;
      }
    if( outputFile != null)
      {
      // Ensure output directory exists.
      if( outputDir == null)
        {
        outputDir =
          outputFile.isAbsolute()
          ? outputFile.getParentFile()
          : inputDir;
        }
      if( !outputDir.exists() && !outputDir.mkdirs())
        {
        throw new RuntimeException( "Can't create output directory=" + outputDir);
        }

      outputFile =
        new File
        ( outputDir,
          outputFile.isAbsolute()? outputFile.getName() : outputFile.getPath());
      }

    SystemTestDef baseDef = null;
    if( options.isExtended() && baseDefFile != null && baseDefFile.exists())
      {
      // Read the previous base test definitions.
      logger_.info( "Reading base test definition={}", baseDefFile);
      try( SystemTestResource reader = withDefaultType( SystemTestResource.of( baseDefFile), defaultContentType))
        {
        baseDef = reader.getSystemTestDef();
        }
      catch( Exception e)
        {
        throw new RuntimeException( "Can't read test definition file=" + baseDefFile, e);
        }
      }

    // Identify the generator definition file.
    File genDefFile = options.getGenDef();
    File genDefDefault = null;
    if( genDefFile != null)
      {
      if( !genDefFile.isAbsolute())
        {
        genDefFile = new File( inputDir, genDefFile.getPath());
        }
      }
    else if( inputDefFile != null)
      {
      genDefDefault = withDefaultType( new File( inputDir, projectName + "-Generators"), defaultContentType);
      if( genDefDefault.exists())
        {
        genDefFile = genDefDefault;
        }
      }

    // Generator definitions specified?
    IGeneratorSet genDef = null;
    if( genDefFile != null)
      {
      // Yes, read generator definitions.
      logger_.info( "Reading generator definition={}", genDefFile);
      try( GeneratorSetResource reader = withDefaultType( GeneratorSetResource.of( genDefFile), defaultContentType))
        {
        genDef = reader.getGeneratorSet();
        }
      catch( Exception e)
        {
        throw new RuntimeException( "Can't read generator definition file=" + genDefFile, e);
        }
      }
    else
      {
      // No, use default TupleGenerator.
      genDef = GeneratorSet.basicGenerator();
      }

    // Generate new test definitions.
    SystemTestDef testDef = Tcases.getTests( inputDef, genDef, baseDef, options.getGeneratorOptions());

    // Identify test definition transformations.
    AbstractFilter transformer = null;
    File transformDefFile = options.getTransformDef();
    if( transformDefFile != null)
      {
      if( !transformDefFile.isAbsolute())
        {
        transformDefFile = new File( inputDir, transformDefFile.getPath());
        }
      transformer = new TransformFilter( transformDefFile, options.getTransformParams());
      }
    else if( options.getTransformType() == Options.TransformType.JUNIT)
      {
      transformer = new TestDefToJUnitFilter( options.getTransformParams());
      }
    else if( options.getTransformType() == Options.TransformType.HTML)
      {
      transformer = new TestDefToHtmlFilter();
      }

    if( transformer != null)
      {
      if( outputFile != null && outputFile.equals( baseDefFile) && baseDefFile.exists())
        {
        throw new RuntimeException( "Transformed output will overwrite test definition file=" + baseDefFile);
        }
      transformer.setTarget( outputFile);
      }

    // Write new test definitions.
    try
      {
      logger_.info( "Updating test definition file={}", outputFile);

      OutputStream output =
        // Transformed output?
        transformer != null?
        transformer.getSource() :

        // Output file?
        outputFile != null?
        new FileOutputStream( outputFile) :

        // Standard output?
        null;

      Resource.Type outputFileType = firstNonNull( Resource.Type.of( withDefaultType( outputFile, defaultContentType)), defaultContentType);
      if( outputFileType == Resource.Type.JSON)
        {
        TcasesJson.writeTests( testDef, output);
        }
      else
        {
        TcasesIO.writeTests( testDef, output);
        }
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't write test definition file=" + outputFile, e);
      }

    // Write any updates to generator definitions.
    File genUpdateFile =
      genDefFile != null?
      genDefFile :

      genDefDefault != null?
      genDefDefault :

      null;

    if( genUpdateFile != null && (options.getRandomSeed() != null || options.getDefaultTupleSize() != null))
      {
      logger_.info( "Updating generator definition={}", genUpdateFile);
      try
        {
        Resource.Type genUpdateType = firstNonNull( Resource.Type.of( withDefaultType( genUpdateFile, defaultContentType)), defaultContentType);
        if( genUpdateType == Resource.Type.JSON)
          {
          TcasesJson.writeGenerators( genDef, new FileOutputStream( genUpdateFile));
          }
        else
          {
          TcasesIO.writeGenerators( genDef, new FileOutputStream( genUpdateFile));
          }
        }
      catch( Exception e)
        {
        throw new RuntimeException( "Can't write generator definition file=" + genUpdateFile, e);
        }
      }
    }
535600
public OptionBuilder buildOption( String name, String... options )
    {
        OptionBuilder option = OptionBuilder.create( name );
        parser.build( option, options );
        return option;
    }
899111
function optionBuilder(options) {
  options = options || {};

  var results = {stdin: [], args: [], files: []};
  Object.keys(options).map(function (option) {
    var p4option = p4options[option];
    if (!p4option) return;
    if (p4option.category !== 'unary') {
      if ((options[option] || {}).constructor !== p4option.type) return;
    }
    if (p4option.category === 'stdin') {
      results.stdin.push(p4option.cmd + options[option]);
      if (results.args.indexOf('-i') < 0) results.args.push('-i');
    } else if (p4option.cmd) {
      results.args.push(p4option.cmd);
      if (p4option.category === 'mixed') results.args.push(options[option]);
    } else {
      results.files = results.files.concat(options[option]);
    }
  });
  return results;
}
1349918
function run(cmd) {
  try {
    if (isWindows)
      cmd = 'cmd /C ' + cmd;
    var code = shell.exec(cmd);
    return code;
  } catch (err) {
    if (err) {
      console.error(err)
    }
    return 1;
  }
}
983829
function build(options) {
  var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat(
    ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) {
      return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
    })).concat(options.args);

  console.log('Building:', [process.execPath].concat(args).join(' '));

  var proc = spawn(process.execPath, args, {
    stdio: [0, 1, 2]
  });

  proc.on('exit', function(errorCode) {
    if (!errorCode) {
      afterBuild(options);
      return;
    }

    if (errorCode === 127 ) {
      console.error('node-gyp not found!');
    } else {
      console.error('Build failed with error code:', errorCode);
    }

    process.exit(1);
  });
}
867314
function run(options) {
  let files, filePromises = [];
  files = options.args || [];

  for (let i = 0; i < files.length; i++) {
    let file = files[i];
    let filePath = path.resolve(cwd, file);

    if (!fs.existsSync(filePath)) {
      continue;
    }

    let stat = fs.statSync(filePath);
    let ext = path.extname(filePath);

    let isConvert = !options.revert && ext === '.ics'
    let isRevert = options.revert && ext === '.json'

    if (!stat.isFile() || (!isConvert && !isRevert)) {
      continue;
    }

    filePromises.push(Q.nfcall(fs.readFile, filePath)
    .then((buffer) => {
      let output;
      let data = buffer.toString();

      if (isConvert) {
        output = convert(data);
        output = JSON.stringify(output, null, "  ");
      } else if (isRevert) {
        output = revert(data);
      }

      let basename = path.basename(filePath, ext);
      let dirname = path.dirname(filePath);
      let compiledExt = isConvert ? '.json' : '.ics';
      let writePath = path.join(dirname, basename) + compiledExt;

      return Q.nfcall(fs.writeFile, writePath, output);
    })
    .fail((error) => {
      throw new Error(error);
    }));
  }

  return Q.all(filePromises);
}
769094
def run_build(self, compiler=GCC, inputs=None, output=None):
        
        logger.info("Running build steps ...")
        self.run_configure(mandatory=False)
        self.run_make(mandatory=False)
        self.run_compiler(compiler=compiler,
                          inputs=inputs,
                          output=output)
866647
def run(self, command, variables=[], board=None, packages=[]):
        """"""

        # -- Check for the SConstruct file
        if not isfile(util.safe_join(util.get_project_dir(), 'SConstruct')):
            variables += ['-f']
            variables += [util.safe_join(
                util.get_folder('resources'), 'SConstruct')]
        else:
            click.secho('Info: use custom SConstruct file')

        # -- Resolve packages
        if self.profile.check_exe_default():
            # Run on `default` config mode
            if not util.resolve_packages(
              packages,
              self.profile.packages,
              self.resources.distribution.get('packages')
             ):
                # Exit if a package is not installed
                raise Exception
        else:
            click.secho('Info: native config mode')

        # -- Execute scons
        return self._execute_scons(command, variables, board)
927510
function doBuild () {
    // Enable Verbose build
    var verbose = log.levels[log.level] <= log.levels.verbose
    if (!win && verbose) {
      argv.push('V=1')
    }
    if (win && !verbose) {
      argv.push('/clp:Verbosity=minimal')
    }

    if (win) {
      // Turn off the Microsoft logo on Windows
      argv.push('/nologo')
    }

    // Specify the build type, Release by default
    if (win) {
      // Convert .gypi config target_arch to MSBuild /Platform
      // Since there are many ways to state '32-bit Intel', default to it.
      // N.B. msbuild's Condition string equality tests are case-insensitive.
      var archLower = arch.toLowerCase()
      var p = archLower === 'x64' ? 'x64' :
              (archLower === 'arm' ? 'ARM' :
              (archLower === 'arm64' ? 'ARM64' : 'Win32'))
      argv.push('/p:Configuration=' + buildType + ';Platform=' + p)
      if (jobs) {
        var j = parseInt(jobs, 10)
        if (!isNaN(j) && j > 0) {
          argv.push('/m:' + j)
        } else if (jobs.toUpperCase() === 'MAX') {
          argv.push('/m:' + require('os').cpus().length)
        }
      }
    } else {
      argv.push('BUILDTYPE=' + buildType)
      // Invoke the Makefile in the 'build' dir.
      argv.push('-C')
      argv.push('build')
      if (jobs) {
        var j = parseInt(jobs, 10)
        if (!isNaN(j) && j > 0) {
          argv.push('--jobs')
          argv.push(j)
        } else if (jobs.toUpperCase() === 'MAX') {
          argv.push('--jobs')
          argv.push(require('os').cpus().length)
        }
      }
    }

    if (win) {
      // did the user specify their own .sln file?
      var hasSln = argv.some(function (arg) {
        return path.extname(arg) == '.sln'
      })
      if (!hasSln) {
        argv.unshift(gyp.opts.solution || guessedSolution)
      }
    }

    var proc = gyp.spawn(command, argv)
    proc.on('exit', onExit)
  }