Collecticons compile wrapped for use in the CLI tool.
2849
async function compileProgram (dirPath, command) {
  await validateDirPathForCLI(dirPath);
  const params = pick(command, [
    'fontName',
    'sassPlaceholder',
    'cssClass',
    'fontTypes',
    'styleFormats',
    'styleDest',
    'styleName',
    'fontDest',
    'authorName',
    'authorUrl',
    'className',
    'previewDest',
    'preview',
    'catalogDest',

    'experimentalFontOnCatalog',
    'experimentalDisableStyles'
  ]);

  try {
    return collecticonsCompile({
      dirPath,
      ...params
    });
  } catch (error) {
    if (!error.userError) throw error;
    // Capture some errors and convert to their command line alternative.
    const code = error.code;
    if (code === 'PLC_CLASS_EXC') {
      error.details = ['Error: --no-sass-placeholder and --no-css-class are mutually exclusive'];
    } else if (code === 'FONT_TYPE') {
      error.details = ['Error: invalid font type value passed to --font-types'];
    } else if (code === 'CLASS_CSS_FORMAT') {
      error.details = ['Error: "--no-css-class" and "--style-formats css" are not compatible'];
    } else if (code === 'STYLE_TYPE') {
      error.details = ['Error: invalid style format value passed to --style-format'];
    }

    throw error;
  }
}
824555
def packb(obj, **kwargs):
    """"""
    kwargs.setdefault('use_bin_type', True)
    return msgpack.packb(obj, **kwargs)
542281
def compile(self, # type: ignore
                manager_container,
                container: 'Container', # type: ignore
                verbose: bool = False
                ) -> CompilationOutcome:
        
        return self.__compile(manager_container,
                              container,
                              self.__command,
                              verbose)
1072636
def compile_cc(build_context, compiler_config, buildenv, sources,
               workspace_dir, buildenv_workspace, cmd_env):
    
    objects = []
    for src in sources:
        obj_rel_path = '{}.o'.format(splitext(src)[0])
        obj_file = join(buildenv_workspace, obj_rel_path)
        include_paths = [buildenv_workspace] + compiler_config.include_path
        compile_cmd = (
            [compiler_config.compiler, '-o', obj_file, '-c'] +
            compiler_config.compile_flags +
            ['-I{}'.format(path) for path in include_paths] +
            [join(buildenv_workspace, src)])
        # TODO: capture and transform error messages from compiler so file
        # paths match host paths for smooth(er) editor / IDE integration
        build_context.run_in_buildenv(buildenv, compile_cmd, cmd_env)
        objects.append(
            join(relpath(workspace_dir, build_context.conf.project_root),
                 obj_rel_path))
    return objects
336340
function createIcon (buf, maxAge) {
  return {
    body: buf,
    headers: {
      'Cache-Control': 'public, max-age=' + Math.floor(maxAge / 1000),
      'ETag': etag(buf)
    }
  }
}
922762
public function calibrateIconSets()
    {
        $this->log('Calibrating icon sets...');
        // Get decalibrated icon types
        $mimeTypes = $this->iconItemRepo->findMimeTypesForCalibration();
        if (!empty($mimeTypes)) {
            $this->log('Calibrating icons for mime types: \''.implode('\', \'', $mimeTypes).'\'');
            $activeSet = $this->getActiveResourceIconSet();
            $activeSetIcons = $this->getIconSetIconsByType($activeSet, true);
            $resourceIcons = $this
                ->om
                ->getRepository('ClarolineCoreBundle:Resource\ResourceIcon')
                ->findByMimeTypes($mimeTypes);
            // Fix paths for resourceIcons
            foreach ($resourceIcons as $resourceIcon) {
                $curMimeType = $resourceIcon->getMimeType();
                $activeSetIcon = $activeSetIcons->getByMimeType($curMimeType);
                if (!is_null($activeSetIcon) && $activeSetIcon->getResourceIcon()->getId() !== $resourceIcon->getId()) {
                    $resourceIcon->setRelativeUrl($activeSetIcon->getRelativeUrl());
                    $resourceIconShortcut = $resourceIcon->getShortcutIcon();
                    $resourceIconShortcut->setRelativeUrl(
                        $activeSetIcon->getResourceIcon()->getShortcutIcon()->getRelativeUrl()
                    );
                    $this->om->persist($resourceIcon);
                    $this->om->persist($resourceIconShortcut);
                }
            }
            $this->om->flush();
            // Recalibrate IconItems
            $this->iconItemRepo->recalibrateIconItemsForMimeTypes($mimeTypes);
            // Update resource icons reference after calibration
            $this->iconItemRepo->updateResourceIconsReferenceAfterCalibration($mimeTypes);
            // Delete redundant resource icons (the one's duplicated)
            $this->iconItemRepo->deleteRedundantResourceIconsAfterCalibration($mimeTypes);
            $this->log('Icon sets calibrated with success.');

            return;
        }
        $this->log('No mime types found for calibration. Everything works fine.');

        return;
    }
565758
def cli(ctx, board, scons, project_dir, sayyes):
    """"""

    if scons:
        Project().create_sconstruct(project_dir, sayyes)
    elif board:
        Project().create_ini(board, project_dir, sayyes)
    else:
        click.secho(ctx.get_help())
1360596
def generate(env):
    """"""
    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

    for suffix in ASSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASAction)
        shared_obj.add_action(suffix, SCons.Defaults.ASAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)

    for suffix in ASPPSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)
        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)

    env['AS']        = 'ml'
    env['ASFLAGS']   = SCons.Util.CLVar('/nologo')
    env['ASPPFLAGS'] = '$ASFLAGS'
    env['ASCOM']     = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES'
    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES'
    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
637922
def pull_dependencies(collector, image, **kwargs):
    """"""
    for dep in image.commands.dependent_images:
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)
1287703
function compilejs(sources, outdir, outfile, opt_options) {
  var bundler = browserify({
    entries: sources,
    debug: false
  });
  return rebundle_(bundler, outdir, outfile, opt_options);
}
179365
def compile_flags(args):
    

    compiler_options = {
        'define_macros': args.defines,
        'undef_macros': args.undefs,
        'include_dirs': args.include_dirs,
        'extra_compile_args': args.extra_flags,
        'library_dirs': args.libraries_dir,
        'extra_link_args': args.extra_flags,
    }
    for param in ('opts', ):
        val = getattr(args, param, None)
        if val:
            compiler_options[param] = val

    return compiler_options
433940
def generate(env):
    """"""
    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

    # TODO(batch):  shouldn't reach in to cmdgen this way; necessary
    # for now to bypass the checks in Builder.DictCmdGenerator.__call__()
    # and allow .cc and .cpp to be compiled in the same command line.
    static_obj.cmdgen.source_ext_match = False
    shared_obj.cmdgen.source_ext_match = False

    for suffix in CSuffixes:
        static_obj.add_action(suffix, CAction)
        shared_obj.add_action(suffix, ShCAction)
        static_obj.add_emitter(suffix, static_object_emitter)
        shared_obj.add_emitter(suffix, shared_object_emitter)

    for suffix in CXXSuffixes:
        static_obj.add_action(suffix, CXXAction)
        shared_obj.add_action(suffix, ShCXXAction)
        static_obj.add_emitter(suffix, static_object_emitter)
        shared_obj.add_emitter(suffix, shared_object_emitter)

    env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
    env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s \\\"/Fp%s\\\""%(PCHSTOP or "",File(PCH))) or ""}'])
    env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag
    env['_CCCOMCOM']  = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'
    env['CC']         = 'cl'
    env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
    env['CFLAGS']     = SCons.Util.CLVar('')
    env['CCCOM']      = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM","$CCCOMSTR")}'
    env['SHCC']       = '$CC'
    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
    env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')
    env['SHCCCOM']    = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCCCOMSTR")}'
    env['CXX']        = '$CC'
    env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')
    env['CXXCOM']     = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM","$CXXCOMSTR")}'
    env['SHCXX']      = '$CXX'
    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
    env['SHCXXCOM']   = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}'
    env['CPPDEFPREFIX']  = '/D'
    env['CPPDEFSUFFIX']  = ''
    env['INCPREFIX']  = '/I'
    env['INCSUFFIX']  = ''
#    env.Append(OBJEMITTER = [static_object_emitter])
#    env.Append(SHOBJEMITTER = [shared_object_emitter])
    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1

    env['RC'] = 'rc'
    env['RCFLAGS'] = SCons.Util.CLVar('')
    env['RCSUFFIXES']=['.rc','.rc2']
    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
    env['BUILDERS']['RES'] = res_builder
    env['OBJPREFIX']      = ''
    env['OBJSUFFIX']      = '.obj'
    env['SHOBJPREFIX']    = '$OBJPREFIX'
    env['SHOBJSUFFIX']    = '$OBJSUFFIX'

    # Set-up ms tools paths
    msvc_setup_env_once(env)

    env['CFILESUFFIX'] = '.c'
    env['CXXFILESUFFIX'] = '.cc'

    msvc_set_PCHPDBFLAGS(env)


    env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
    env['BUILDERS']['PCH'] = pch_builder

    if 'ENV' not in env:
        env['ENV'] = {}
    if 'SystemRoot' not in env['ENV']:    # required for dlls in the winsxs folders
        env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()
70689
function amdWrap(factoryCode, deps) {
        var deps = deps.map(function (dep) {
            return "'" + dep + "'";
        });
        return AMD_TEMPLATE.START +
            deps.join(',') +
            AMD_TEMPLATE.MIDDLE +
            factoryCode +
            AMD_TEMPLATE.END;
    }
913264
function getMatchingIcons(iconsWithScores, maxScore) {
  return iconsWithScores
    .filter((item) => item.score === maxScore)
    .map((item) => Object.assign({}, item, { ext: path.extname(item.url) }));
}
991804
public function collect(Map $map, array $icons = [])
    {
        foreach ($this->polylineCollector->collect($map) as $polyline) {
            if ($polyline->hasIconSequences()) {
                $icons = $this->collectValues($polyline->getIconSequences());
            }
        }

        return $icons;
    }
187838
private void cloneExplorerTypeIcons(Map<String, String> iconPaths) throws CmsException {

        for (Map.Entry<String, String> entry : iconPaths.entrySet()) {
            String source = ICON_PATH + entry.getKey();
            String target = ICON_PATH + entry.getValue();
            if (getCms().existsResource(source) && !getCms().existsResource(target)) {
                getCms().copyResource(source, target);
            }
        }
    }
363176
def pull_parent(collector, image, **kwargs):
    """"""
    log.warning("")
    pull_dependencies(collector, image, **kwargs)