Generates Procfiles which can be used with honcho or foreman.
7140
def gen_procfile(ctx, wsgi, dev):
    
    if wsgi is None:
        if os.path.exists("wsgi.py"):
            wsgi = "wsgi.py"
        elif os.path.exists("app.py"):
            wsgi = "app.py"
        else:
            wsgi = "app.py"
            ctx.invoke(gen_apppy)

    def write_procfile(filename, server_process, debug):
        processes = [server_process] + current_app.processes
        procfile = []
        for name, cmd in procfile_processes(processes, debug).iteritems():
            procfile.append("%s: %s" % (name, cmd))
        with open(filename, "w") as f:
            f.write("\n".join(procfile))

    write_procfile("Procfile", ("web", ["gunicorn", wsgi]), False)
    if dev:
        write_procfile("Procfile.dev", ("web", ["frasco", "serve"]), True)
200411
def generate(env):
    """"""
    try:
        bld = env['BUILDERS']['Rpm']
    except KeyError:
        bld = RpmBuilder
        env['BUILDERS']['Rpm'] = bld

    env.SetDefault(RPM          = 'LC_ALL=C rpmbuild')
    env.SetDefault(RPMFLAGS     = SCons.Util.CLVar('-ta'))
    env.SetDefault(RPMCOM       = rpmAction)
    env.SetDefault(RPMSUFFIX    = '.rpm')
1000289
protected function prepareProcessBuilder()
    {
        $pb = new ProcessBuilder();
        $pb->inheritEnvironmentVariables();

        if ($this->sudo) {
            $pb->add('sudo');
        }
        $pb->add($this->bin);
        if ($this->config) {
            $pb->add('--config')
                ->add($this->config);
        }

        $pb->add('--rotate');

        return $pb;
    }
231029
def generate(env):
    """"""
    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

    if 'CXX' not in env:
        env['CXX']    = env.Detect(compilers) or compilers[0]

    cxx.generate(env)

    # platform specific settings
    if env['PLATFORM'] == 'aix':
        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')
        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
        env['SHOBJSUFFIX'] = '$OBJSUFFIX'
    elif env['PLATFORM'] == 'hpux':
        env['SHOBJSUFFIX'] = '.pic.o'
    elif env['PLATFORM'] == 'sunos':
        env['SHOBJSUFFIX'] = '.pic.o'
    # determine compiler version
    version = gcc.detect_version(env, env['CXX'])
    if version:
        env['CXXVERSION'] = version
1087067
def generate (self, ps):
        
        assert isinstance(ps, property_set.PropertySet)
        self.manager_.targets().log(
            "Building project '%s' with '%s'" % (self.name (), str(ps)))
        self.manager_.targets().increase_indent ()

        result = GenerateResult ()

        for t in self.targets_to_build ():
            g = t.generate (ps)
            result.extend (g)

        self.manager_.targets().decrease_indent ()
        return result
396065
protected void generateJavaFiles(Iterable<Resource> validatedResources, IProgressMonitor progress) {
		assert progress != null;
		progress.subTask(Messages.SarlBatchCompiler_49);
		getLogger().info(Messages.SarlBatchCompiler_28, getOutputPath());
		final JavaIoFileSystemAccess javaIoFileSystemAccess = this.javaIoFileSystemAccessProvider.get();
		javaIoFileSystemAccess.setOutputConfigurations(this.outputConfigurations);
		// The function configureWorkspace should set the output paths with absolute paths.
		//javaIoFileSystemAccess.setOutputPath(getOutputPath().getAbsolutePath());
		javaIoFileSystemAccess.setWriteTrace(isWriteTraceFiles());
		if (progress.isCanceled()) {
			return;
		}

		final GeneratorContext context = new GeneratorContext();
		context.setCancelIndicator(() -> progress.isCanceled());
		for (final Resource resource : validatedResources) {
			if (progress.isCanceled()) {
				return;
			}
			if (getLogger().isDebugEnabled()) {
				getLogger().debug(Messages.SarlBatchCompiler_23, resource.getURI().lastSegment());
			}
			if (isWriteStorageFiles() && resource instanceof StorageAwareResource) {
				final StorageAwareResource storageAwareResource = (StorageAwareResource) resource;
				storageAwareResource.getResourceStorageFacade().saveResource(storageAwareResource, javaIoFileSystemAccess);
			}
			if (progress.isCanceled()) {
				return;
			}
			this.generator.generate(resource, javaIoFileSystemAccess, context);
			notifiesCompiledResourceReceiver(resource);
		}
	}
444501
def get_running_jobs(opts):
    '''
    
    '''

    ret = []
    proc_dir = os.path.join(opts['cachedir'], 'proc')
    if not os.path.isdir(proc_dir):
        return ret
    for fn_ in os.listdir(proc_dir):
        path = os.path.join(proc_dir, fn_)
        data = read_proc_file(path, opts)
        if not data:
            continue
        if not is_pid_healthy(data['pid']):
            continue
        ret.append(data)
    return ret
661027
def generate_output_prov(self,
                             final_output,    # type: Dict[Text, Any]
                             process_run_id,  # type: Optional[str]
                             name             # type: Optional[Text]
                            ):   # type: (...) -> None
        """"""
        # Timestamp should be created at the earliest
        timestamp = datetime.datetime.now()

        # For each output, find/register the corresponding
        # entity (UUID) and document it as generated in
        # a role corresponding to the output
        for output, value in final_output.items():
            entity = self.declare_artefact(value)
            if name is not None:
                name = urllib.parse.quote(str(name), safe=":/,#")
                # FIXME: Probably not "main" in nested workflows
                role = self.wf_ns["main/%s/%s" % (name, output)]
            else:
                role = self.wf_ns["main/%s" % output]

            if not process_run_id:
                process_run_id = self.workflow_run_uri

            self.document.wasGeneratedBy(
                entity, process_run_id, timestamp, None, {"prov:role": role})
148659
def generate_hiera_template
      ssh_key = Bebox::Project.public_ssh_key_from_file(self.project_root, self.name)
      project_name = Bebox::Project.shortname_from_file(self.project_root)
      Bebox::PROVISION_STEPS.each do |step|
        step_dir = Bebox::Provision.step_name(step)
        generate_file_from_template("#{templates_path}/puppet/#{step}/hiera/data/environment.yaml.erb", "#{self.project_root}/puppet/steps/#{step_dir}/hiera/data/#{self.name}.yaml", {step_dir: step_dir, ssh_key: ssh_key, project_name: project_name})
      end
    end
1088228
def build(self, filenames, cl_args=None, link_args=None,
              x64=False, out_dir=''):
        
        if not cl_args:
            cl_args = []
        if not link_args:
            link_args = []
        msvc, lib = self.vc.get_bin_and_lib(x64)
        lib = self.make_lib(lib)
        if out_dir:
            cl_args.append('/Fo:' + out_dir + '\\')
        include = self.make_inc(self.vc.inc + self.sdk.inc)
        cl_args.extend(include + filenames)
        try:
            msvc.run_cl('/c', *cl_args)
        except CalledProcessError as error:
            logging.error(_('failed to compile: %s'), filenames)
            logging.error(_('cl.exe returned:\n%s'), error.output)
            return False
        link_args.extend(lib + self.make_objs(filenames, out_dir))
        try:
            msvc.run_link(*link_args)
        except CalledProcessError as error:
            logging.error(_('failed to link: %s'), filenames)
            logging.error(_('link.exe returned:\n%s'), error.output)
            return False
        return True
129589
protected function _generateFiles() {
        if ($this->feature && !$this->isSelectedFeature($this->feature)) {
            $this->logFile->log(null, "did not add aspect kernel because \"$this->feature\" is not selected");
            return;
        }

        parent::_generateFiles();
        $this->files = array_merge($this->files,
                                   $this->aspectKernel->generateFiles($this->class, $this->target));
    }
667838
function buildProcessTemplate(opts, callback) {
  var viewOpt = {
    app: opts.app,
    processName: opts.processName,
    directory: opts.directory,
    port: opts.port,
    command: opts.command,
    logRoot: opts.logRoot,
    num: opts.num,
    envVar: opts.envVar
  };

  renderTemplate(templateFilePath('process.conf', opts.templateOpt), viewOpt, function(err, renderedOutput) {
    if (err) {
      return callback(err.message);
    } else {
      return fs.writeFile(opts.writePath, renderedOutput, function(err) {
	if (err) {
	  return callback(err.message);
	} else {
	  return callback(null);
	}
      });
    }
  });
}
550031
def gen_template_files(path):
    "  "

    path = path.rstrip(op.sep)
    for root, _, files in walk(path):
        for f in filter(lambda x: not x in (TPLNAME, CFGNAME), files):
            yield op.relpath(op.join(root, f), path)
185497
function buildProcessOptions(processes, logRoot, cmdOptions) {
  return _.flatten(_.map(_.keys(processes), function(procKey) {
    var concurrentCount = parser.parseConcurrencyOpts(cmdOptions)[procKey] || 1;
    var command = processes[procKey];
    return _.map(_.range(concurrentCount), function(index) {
      return {
	port: cmdOptions.port,
	app: cmdOptions.app,
	appName: getProcessName(cmdOptions.app, procKey, index),
	environmentVar: getEnvOpts(command, cmdOptions),
	processCommand: command,
	processName: procKey,
	logRoot: logRoot,
	directory: parser.cmdWorkingDir(cmdOptions),
	user: cmdOptions.user,
	num: index
      };
    });
  }));
}
1168208
function(srcFile, callback) {
    new Generator(this.workingDir, srcFile, this.targetDir, this.jumper, this.logger, this.options.docco).run(callback);
  }
626903
def generate(env):
    SCons.Tool.bcc32.findIt('tlib', env)
    """"""
    SCons.Tool.createStaticLibBuilder(env)
    env['AR']          = 'tlib'
    env['ARFLAGS']     = SCons.Util.CLVar('')
    env['ARCOM']       = '$AR $TARGET $ARFLAGS /a $SOURCES'
    env['LIBPREFIX']   = ''
    env['LIBSUFFIX']   = '.lib'
74416
def RepackTemplates(self,
                      repack_configs,
                      templates,
                      output_dir,
                      config=None,
                      sign=False,
                      signed_template=False):
    """"""
    pool = multiprocessing.Pool(processes=10)
    results = []
    bulk_sign_installers = False
    for repack_config in repack_configs:
      for template in templates:
        repack_args = ["grr_client_build"]
        if config:
          repack_args.extend(["--config", config])

        repack_args.extend([
            "--secondary_configs", repack_config, "repack", "--template",
            template, "--output_dir",
            self.GetOutputDir(output_dir, repack_config)
        ])

        # We only sign exes and rpms at the moment. The others will raise if we
        # try to ask for signing.
        passwd = None

        if sign:
          if template.endswith(".exe.zip"):
            # This is for osslsigncode only.
            if platform.system() != "Windows":
              passwd = self.GetWindowsPassphrase()
              repack_args.append("--sign")
            else:
              bulk_sign_installers = True
            if signed_template:
              repack_args.append("--signed_template")
          elif template.endswith(".rpm.zip"):
            bulk_sign_installers = True

        print("Calling %s" % " ".join(repack_args))
        results.append(
            pool.apply_async(SpawnProcess, (repack_args,), dict(passwd=passwd)))

        # Also build debug if it's windows.
        if template.endswith(".exe.zip"):
          debug_args = []
          debug_args.extend(repack_args)
          debug_args.append("--debug_build")
          print("Calling %s" % " ".join(debug_args))
          results.append(
              pool.apply_async(SpawnProcess, (debug_args,),
                               dict(passwd=passwd)))

    try:
      pool.close()
      # Workaround to handle keyboard kills
      # http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool
      # get will raise if the child raises.
      for result_obj in results:
        result_obj.get(9999)
      pool.join()
    except KeyboardInterrupt:
      print("parent received control-c")
      pool.terminate()
    except ErrorDuringRepacking:
      pool.terminate()
      raise

    if bulk_sign_installers:
      to_sign = {}
      for root, _, files in os.walk(output_dir):
        for f in files:
          if f.endswith(".exe"):
            to_sign.setdefault("windows", []).append(os.path.join(root, f))
          elif f.endswith(".rpm"):
            to_sign.setdefault("rpm", []).append(os.path.join(root, f))
      if to_sign.get("windows"):
        signer = repacking.TemplateRepacker().GetSigner([
            "ClientBuilder Context",
            "Platform:%s" % platform.system(), "Target:Windows"
        ])
        signer.SignFiles(to_sign.get("windows"))
      if to_sign.get("rpm"):
        signer = repacking.TemplateRepacker().GetSigner([
            "ClientBuilder Context",
            "Platform:%s" % platform.system(), "Target:Linux", "Target:LinuxRpm"
        ])
        signer.AddSignatureToRPMs(to_sign.get("rpm"))