@SuppressWarnings("unchecked") private static <T extends AssetOptions> List<T> processors(final Config conf, final ClassLoader loader, final EngineFactory engineFactory, final String env, final List<String> names, final Set<String> filter) throws Exception { Map<String, Class<AssetOptions>> classes = new LinkedHashMap<>(); for (Entry<String, String> entry : bind(conf, names).entrySet()) { classes.put(entry.getKey(), (Class<AssetOptions>) loader.loadClass(entry.getValue())); } return (List<T>) processors(conf, loader, engineFactory, env, filter, classes); }
private static Map<String, List<AssetProcessor>> pipeline(final ClassLoader loader, final EngineFactory engineFactory, final Config conf) throws Exception { Map<String, List<AssetProcessor>> processors = new HashMap<>(); processors.put("dev", Collections.emptyList()); if (conf.hasPath("pipeline")) { Set<String> filter = conf.getConfig("pipeline").entrySet().stream() .map(Entry::getKey) .collect(Collectors.toSet()); filter.add("class"); Set<Entry<String, ConfigValue>> entrySet = conf.getConfig("pipeline").entrySet(); for (Entry<String, ConfigValue> entry : entrySet) { String env = unquote(entry.getKey()); processors.put(env, processors(conf, loader, engineFactory, env, strlist(entry.getValue().unwrapped()), filter)); } } return processors; }
List<String> candidates = strlist(e.getValue().unwrapped(), v -> basedir + spath(v)); List<String> values = new ArrayList<>(); candidates.forEach(it -> Try.run(() -> processors(assetconf, loader, engineFactory, null, ImmutableList.of(it.substring(1)), ImmutableSet.of()) .stream()
@SuppressWarnings("unchecked") private static <T extends AssetOptions> List<T> processors(final Config conf, final ClassLoader loader, final EngineFactory engineFactory, final String env, final List<String> names, final Set<String> filter) throws Exception { Map<String, Class<AssetOptions>> classes = new LinkedHashMap<>(); for (Entry<String, String> entry : bind(conf, names).entrySet()) { classes.put(entry.getKey(), (Class<AssetOptions>) loader.loadClass(entry.getValue())); } return (List<T>) processors(conf, loader, engineFactory, env, filter, classes); }
private static Map<String, List<AssetProcessor>> pipeline(final ClassLoader loader, final EngineFactory engineFactory, final Config conf) throws Exception { Map<String, List<AssetProcessor>> processors = new HashMap<>(); processors.put("dev", Collections.emptyList()); if (conf.hasPath("pipeline")) { Set<String> filter = conf.getConfig("pipeline").entrySet().stream() .map(Entry::getKey) .collect(Collectors.toSet()); filter.add("class"); Set<Entry<String, ConfigValue>> entrySet = conf.getConfig("pipeline").entrySet(); for (Entry<String, ConfigValue> entry : entrySet) { String env = unquote(entry.getKey()); processors.put(env, processors(conf, loader, engineFactory, env, strlist(entry.getValue().unwrapped()), filter)); } } return processors; }
List<String> candidates = strlist(e.getValue().unwrapped(), v -> basedir + spath(v)); List<String> values = new ArrayList<>(); candidates.forEach(it -> Try.run(() -> processors(assetconf, loader, engineFactory, null, ImmutableList.of(it.substring(1)), ImmutableSet.of()) .stream()