fill in manifest entries for asset files
436550
function(next) {
            
                    
            // Stylesheet and JavaScript files are listed in the config
            config.headerScripts.stylesheets.forEach(function(cssentry) {
                config.akashacmsEPUB.manifest.push({
                    id: cssentry.id,
                    type: "text/css",
                    href: rewriteURL(akasha, config, { rendered_url: config.akashacmsEPUB.bookmetadata.opf }, cssentry.href, false)  // MAP this URL
                });
            });
        
            config.headerScripts.javaScriptTop.concat(config.headerScripts.javaScriptBottom).forEach(function(jsentry) {
                config.akashacmsEPUB.manifest.push({
                    id: jsentry.id,
                    type: "application/javascript",
                    href: rewriteURL(akasha, config, { rendered_url: config.akashacmsEPUB.bookmetadata.opf }, jsentry.href, false)  // MAP this URL
                });
            });
            
            // There had formerly been a list of allowed file extensions in globfs.operate
            //
            // Turns out to have been too restrictive because those who wanted to
            // include other kinds of files weren't free to do so.
            //
            // The purpose here is to add manifest entries for files that aren't documents
            // and aren't already in the manifest for any other reason.
            
            var assetNum = 0;
            globfs.operate(config.root_assets.concat(config.root_docs), [ "**/*" ],
                function(basedir, fpath, fini) {
                    
                    // logger.trace('asset file '+ path.join(basedir, fpath));
                    
                    fs.stat(path.join(basedir, fpath), function(err, stats) {
                        if (err || !stats) {
                            // Shouldn't get this, because globfs will only give us
                            // files which exist
                            logger.error('ERROR '+ basedir +' '+ fpath +' '+ err);
                            fini();
                        } else if (stats.isDirectory()) {
                            // Skip directories
                            // logger.trace('isDirectory '+ basedir +' '+ fpath);
                            fini();
                        } else {
                            // logger.trace('regular file '+ basedir +' '+ fpath);
                            akasha.readDocumentEntry(fpath, function(err, docEntry) {
                            
                                if (docEntry) {
                                    // If there's a docEntry, we need to override the fpath
                                    // with the filename it renders to.  This is to properly
                                    // detect files that are already in the manifest.
                                    
                                    // logger.trace('docEntry '+ basedir +' '+ fpath);
                                    fpath = docEntry.renderedFileName;
                                }
                                // Detect any files that are already in manifest
                                // Only add to manifest stuff which isn't already there
                                var inManifest = false;
                                config.akashacmsEPUB.manifest.forEach(function(item) {
                                    if (item.href === fpath) {
                                        inManifest = true;
                                    }
                                });
                                if (!inManifest) {
                                    // We're not using the mime library for some
                                    // file extensions because it gives
                                    // incorrect values for the .otf and .ttf files
                                    
                                    // logger.trace('assetManifestEntries '+ basedir +' '+ fpath);
                                    var mimetype;
                                    if (fpath.match(/\.ttf$/i)) mimetype = "application/vnd.ms-opentype";
                                    else if (fpath.match(/\.otf$/i)) mimetype = "application/vnd.ms-opentype";
                                    else mimetype = mime.lookup(fpath);
                                    
                                    config.akashacmsEPUB.manifest.push({
                                        id: "asset" + assetNum++,
                                        type: mimetype,
                                        href: rewriteURL(akasha, config, {
                                            rendered_url: config.akashacmsEPUB.bookmetadata.opf
                                        }, fpath, false)
                                    });
                                }
                                fini();
                            });
                        }
                    });
                },
                next);
        }
219015
function loadFile(entry, opts, formatter, cb, errCb) {
      var type = entry.assetType || entry.bundle;
      formatter = formatter || ss.client.formatters[entry.ext || type];
      if (!formatter) {
        throw new Error('Unsupported file extension \'.' + entry.ext + '\' when we were expecting some type of ' +
          ((type||'unknown').toUpperCase()) + ' file. Please provide a formatter for ' + (entry.file) + ' or move it to /client/static');
      }
      if (formatter.assetType !== type) {
        throw new Error('Unable to render \'' + entry.file + '\' as this appears to be a ' + (type.toUpperCase()) +
          ' file. Expecting some type of ' + (type.toUpperCase()) + ' file in ' + (path.dirname(entry.file)) + ' instead');
      }

      // Use the formatter to pre-process the asset before bundling
      try {
        return formatter.call(this.clientFilePath(entry.file), opts, cb, errCb);
      } catch (err) {
        return errCb(err);
      }
    }
512194
function assetFile(filename, callback) {
      const data = {
        source: files[filename].source,
        destination: files[filename].destination || path.join(path.dirname(filename), '.')
      }
      delete files[filename]
      metalsmithAssets(data)(files, metalsmith, callback)
    }
1173776
function updateManifest (archive, updates, cb) {
  return maybe(cb, async function () {
    var manifest
    try {
      manifest = await readManifest(archive)
    } catch (e) {
      manifest = {}
    }
    Object.assign(manifest, generateManifest(updates))
    return writeManifest(archive, manifest)
  })
}
230902
def manifest
    if File.exists?(manifest_file) && File.readable?(manifest_file) then
      MultiJson.load(File.read(manifest_file))
    else
      {}
    end
  end
587233
public void installAssets(Collection<String> assetIds, File fromDir, RepositoryConnectionList loginInfo) throws InstallException {
        this.installAssets = new ArrayList<List<InstallAsset>>();
        ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
        ArrayList<String> unresolvedFeatures = new ArrayList<String>();
        Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, InstallConstants.TO_USER);
        getResolveDirector().resolve(assetIds, fromDir, InstallConstants.TO_USER, false, installAssets, unresolvedFeatures);
        if (!unresolvedFeatures.isEmpty()) {
            log(Level.FINEST, "installAssets() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
            installAssets(unresolvedFeatures, loginInfo);
        }
        if (!installAssets.isEmpty()) {
            getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
            this.installAssets.add(installAssets);
        }
        if (this.installAssets.isEmpty()) {
            throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ASSETS_ALREADY_INSTALLED", assetIds.toString());
        }
    }
337258
def jarManifest(target, source, env, for_signature):
    """"""
    for src in source:
        contents = src.get_text_contents()
        if contents[:16] == "Manifest-Version":
            return src
    return ''
1098109
protected function registerAssetFinder() : void {
		$this->app->singleton('basset.finder', function($app) {
			return new AssetFinder($app['files'], $app['config'], base_path() . '/resources/assets');
		});
	}
535459
function resolveDependencies(self, paths) {
  var assets = [], cache = {};

  _.forEach(paths, function (p) {
    var asset;

    if (p === self.pathname) {
      if (!cache[p]) {
        cache[p] = true;
        assets.push(self);
      }
      return;
    }

    asset = self.environment.findAsset(p, { bundle: false });

    if (asset) {
      asset.__requiredAssets__.forEach(function (asset_dependency) {
        if (!cache[asset_dependency.pathname]) {
          cache[asset_dependency.pathname] = true;
          assets.push(asset_dependency);
        }
      });
    }
  });

  return assets;
}
2597
def _set_asset_paths(self, app):
        
        webpack_stats = app.config['WEBPACK_MANIFEST_PATH']

        try:
            with app.open_resource(webpack_stats, 'r') as stats_json:
                stats = json.load(stats_json)

                if app.config['WEBPACK_ASSETS_URL']:
                    self.assets_url = app.config['WEBPACK_ASSETS_URL']
                else:
                    self.assets_url = stats['publicPath']

                self.assets = stats['assets']
        except IOError:
            raise RuntimeError(
                "Flask-Webpack requires 'WEBPACK_MANIFEST_PATH' to be set and "
                "it must point to a valid json file.")
566873
private Manifest addToList(Resource resource) {
        try {
            if (resource != null && resource.exists()) {
                Manifest manifest = new ManifestEx(resource);
                manifests.add(manifest);
                return manifest;
            }
        } catch (Exception e) {
            log.debug("Exception occurred reading manifest: " + resource);
        }

        return null;
    }
396392
function copyAssets(output, plugin) {
    var logger = output.getLogger();
    var pluginRoot = plugin.getPath();
    var options = output.getOptions();

    var outputRoot = options.get('root');
    var assetOutputFolder = path.join(outputRoot, 'gitbook');
    var prefix = options.get('prefix');

    var assetFolder = path.join(pluginRoot, ASSET_FOLDER, prefix);

    if (!fs.existsSync(assetFolder)) {
        return Promise();
    }

    logger.debug.ln('copy assets from theme', assetFolder);
    return fs.copyDir(
        assetFolder,
        assetOutputFolder,
        {
            deleteFirst: false,
            overwrite: true,
            confirm: true
        }
    );
}
226363
function updateManifest() {
  const {stdout: branch} = exec(`git rev-parse --abbrev-ref HEAD`)

  if (!branch.includes("release")) {
    return;
  }

  console.log("[copy-assets] update assets manifest");

  const last = lastRelease();
  exec(`git cat-file -p ${last}:assets/module-manifest.json > assets/module-manifest.json`);
}
491913
def precompiled_assets(clear_cache = false)
      @precompiled_assets = nil if clear_cache
      @precompiled_assets ||= assets_manifest.find(config.assets.precompile).map(&:logical_path).to_set
    end
1286766
function createManifest(manifest, callback) {
    assert.object(manifest, 'manifest');
    assert.string(manifest.name, 'manifest.name');
    assert.string(manifest.template, 'manifest.template');
    assert.string(manifest.path, 'manifest.path');

    return (this.post('/manifests', manifest, callback));
}
146217
private function addAssets(): void
    {
        $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('bundles/codefogtags/selectize.min.css');
        $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('bundles/codefogtags/backend.min.css');

        if (!\in_array('assets/jquery/js/jquery.min.js', (array) $GLOBALS['TL_JAVASCRIPT'], true)
            && !\in_array('assets/jquery/js/jquery.js', (array) $GLOBALS['TL_JAVASCRIPT'], true)
        ) {
            $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('assets/jquery/js/jquery.min.js');
        }

        $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('bundles/codefogtags/selectize.min.js');
        $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('bundles/codefogtags/widget.min.js');
        $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('bundles/codefogtags/backend.min.js');
    }
340357
function (requestURL, filename, fileType) {
    
    if (gc.coreFunctions.getReqestExtension(filename) == '.ipa'){
        // The template of an entry as well as the indicator variable for a file or dir.
        // This is used for IPA files that need to be installed on iOS devices so .manifest is appended to search for the appropriate manifest.
        var listingEntry = '<tr><td>{itemType}</td><td><a href="itms-services://?action=download-manifest&url={hrefLink}.plist">{itemName}</a></td></tr>\n';

        // Populate the template now using the placeholders as text to be replaced.
        listingEntry = listingEntry.replace('{itemType}', "iOS");
        listingEntry = listingEntry.replace('{hrefLink}', gc.coreFunctions.joinPaths(requestURL, filename));
        listingEntry = listingEntry.replace('{itemName}', filename);
    } else {
        // The template of an entry as well as the indicator variable for a file or dir.
        var listingEntry = '<tr><td>{itemType}</td><td><a href="{hrefLink}">{itemName}</a></td></tr>\n';
        // Populate the template now using the placeholders as text to be replaced.
        listingEntry = listingEntry.replace('{itemType}', fileType);
        listingEntry = listingEntry.replace('{hrefLink}', gc.coreFunctions.joinPaths(requestURL, filename));
        listingEntry = listingEntry.replace('{itemName}', filename);
    }
    
    
    
    // Return the entry.
    return listingEntry;
}