Apply configuration from registered bundles. If dropwizard bundles support is enabled, lookup them too.
164627
private void configureFromBundles() {
        context.lifecycle().runPhase(context.getConfiguration(), context.getConfigurationTree(),
                context.getEnvironment());
        final Stopwatch timer = context.stat().timer(BundleTime);
        final Stopwatch resolutionTimer = context.stat().timer(BundleResolutionTime);
        if (context.option(ConfigureFromDropwizardBundles)) {
            context.registerDwBundles(BundleSupport.findBundles(context.getBootstrap(), GuiceyBundle.class));
        }
        context.registerLookupBundles(bundleLookup.lookup());
        resolutionTimer.stop();
        BundleSupport.processBundles(context);
        timer.stop();
    }
713832
def setup(self):
        """"""
        super(RequireJSFilter, self).setup()

        excluded_files = []
        for bundle in self.excluded_bundles:
            excluded_files.extend(
                map(lambda f: os.path.splitext(f)[0],
                    bundle.contents)
            )

        if excluded_files:
            self.argv.append(
                'exclude={0}'.format(','.join(excluded_files))
            )
447105
public void applyConfiguration(Configuration configuration) {
        if (plugins != null) {
            plugins.stream()
                    .filter(pluginDefinition -> pluginDefinition.isConfigurationSupported(configuration))
                    .forEach(pluginDefinition -> project.getDependencies().add(configuration.getName(), generateDependencyNotation(configuration, pluginDefinition)));
        }
    }
638639
private static void applyConfigs(final ClassLoader classloader, final GuiceConfig config)
	{
		// Load all the local configs
		for (String configFile : getPropertyFiles(config))
		{
			try
			{
				for (PropertyFile properties : loadConfig(classloader, configFile))
					config.setAll(properties);
			}
			catch (IOException e)
			{
				throw new IllegalArgumentException("Error loading configuration URLs from " + configFile, e);
			}
		}

		// Load the network config (if enabled)
		try
		{
			applyNetworkConfiguration(config);
		}
		catch (Throwable t)
		{
			throw new RuntimeException("Failed to retrieve configuration from network!", t);
		}
	}
183923
def require(self, *namespecs):
        """"""
        blacklist = set([n[1:] for n in namespecs if n.startswith('!')])
        not_blacklist = [n for n in namespecs if not n.startswith('!')]
        return Bundle(*[bundle for name, version, bundle
            in self._require_recursive(*not_blacklist) if name not in blacklist])
1167566
public void startBundle(Bundle bundle)
    {
        if (bundle != null)
            if ((bundle.getState() != Bundle.ACTIVE) && (bundle.getState() != Bundle.STARTING))
        {
            try {
                bundle.start();
            } catch (BundleException e) {
                e.printStackTrace();
            }
        }
    }
291515
public void addRequiredBundles(Set<String> bundles) {
		// TODO manage transitive dependencies
		// don't require self
		Set<String> bundlesToMerge;
		String bundleName = (String) getMainAttributes().get(BUNDLE_SYMBOLIC_NAME);
		if (bundleName != null) {
			int idx = bundleName.indexOf(';');
			if (idx >= 0) {
				bundleName = bundleName.substring(0, idx);
			}
		}
		if (bundleName != null && bundles.contains(bundleName)
				|| projectName != null && bundles.contains(projectName)) {
			bundlesToMerge = new LinkedHashSet<String>(bundles);
			bundlesToMerge.remove(bundleName);
			bundlesToMerge.remove(projectName);
		} else {
			bundlesToMerge = bundles;
		}
		String s = (String) getMainAttributes().get(REQUIRE_BUNDLE);
		Wrapper<Boolean> modified = Wrapper.wrap(this.modified);
		String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified, lineDelimiter);
		this.modified = modified.get();
		getMainAttributes().put(REQUIRE_BUNDLE, result);
	}
1231519
@Override
    public ConfigurationAdmin getService(Bundle bundle, ServiceRegistration<ConfigurationAdmin> registration) {
        ServiceReference<ConfigurationAdmin> reference = registration.getReference();
        ced.setServiceReference(reference);
        return new ConfigurationAdminImpl(this, bundle);
    }
429770
protected void initBundles() {
        if (commonBundle == null) {
            Locale locale = configuration.getLocale();
            this.commonBundle = ResourceBundle.getBundle(commonBundleName, locale);
            this.docletBundle = ResourceBundle.getBundle(docletBundleName, locale);
        }
    }
503998
function patchBundle(bundle: Bundle, delta: DeltaBundle): Bundle {
  const map = new Map(bundle.modules);

  for (const [key, value] of delta.modified) {
    map.set(key, value);
  }

  for (const [key, value] of delta.added) {
    map.set(key, value);
  }

  for (const key of delta.deleted) {
    map.delete(key);
  }

  const modules = Array.from(map.entries());

  return {
    pre: bundle.pre,
    post: bundle.post,
    modules,
  };
}
363122
@Override
	public synchronized void rebuildModifiedBundles() {

		stopProcessIfNeeded();

		StopWatch stopWatch = ThreadLocalJawrContext.getStopWatch();

		if (config.getUseSmartBundling()) {

			// Wait until all watch event has been processed
			if (watcher != null) {
				while (!watcher.hasNoEventToProcess()) {
					try {
						if (LOGGER.isInfoEnabled()) {
							LOGGER.info("Wait until there is no more watch event to process");
						}
						Thread.sleep(config.getSmartBundlingDelayAfterLastEvent());
					} catch (InterruptedException e) {
						// Do nothing
					}
				}
			}

			List<JoinableResourceBundle> bundlesToRebuild = getBundlesToRebuild();
			for (JoinableResourceBundle bundle : bundlesToRebuild) {
				bundle.resetBundleMapping();
			}
			build(bundlesToRebuild, true, stopWatch);

		} else {
			LOGGER.warn("You should turn on \"smart bundling\" feature to be able to rebuild modified bundles.");
		}
	}
178930
private void checkBundleName(String bundleName, Map<String, JoinableResourceBundle> bundleMap) {
		if (!JAWR_ROOT_MODULE_NAME.equals(bundleName)) {
			boolean moduleExist = bundleMap.get(bundleName) != null;
			if (!moduleExist) {
				throw new BundlingProcessException("The bundle name '" + bundleName
						+ "' defined in 'jawr.js.closure.modules' is not defined in the configuration. Please check your configuration.");
			}
		}
	}
1253192
private function loadConfig()
    {
        $appBundle = null;
        $this->getEventManager()->dispatch(self::EVENT_BEFORE_LOAD_CONFIG, $this);

        foreach ($this->registerBundles() as $bundle) {
            if ($bundle instanceof \App\AppBundle) {
                $appBundle = $bundle;
                continue;
            }

            $bundle->loadConfig();
        }

        if (!$appBundle instanceof \App\AppBundle) {
            throw new BaseException('AppBundle does not exist.');
        }

        $appBundle->loadConfig();
        $this->getEventManager()->dispatch(self::EVENT_AFTER_LOAD_CONFIG, $this);
    }
977250
function adjustBundlesPath(data, options) {
	var path = require("path");
	var configuration = clone(data.configuration);

	var bundlesPath = configuration.bundlesPath;
	Object.defineProperty(configuration, "bundlesPath", {
		configurable: true,
		get: function() {
			return path.join(bundlesPath, options.target);
		}
	});

	return assign({}, omit(data, ["configuration"]), {
		configuration: configuration
	});
}
547817
public static function register($bundle, $config = array())
	{
		$defaults = array('handles' => null, 'auto' => false);

		// If the given configuration is actually a string, we will assume it is a
		// location and set the bundle name to match it. This is common for most
		// bundles that simply live in the root bundle directory.
		if (is_string($config))
		{
			$bundle = $config;

			$config = array('location' => $bundle);
		}

		// If no location is set, we will set the location to match the name of
		// the bundle. This is for bundles that are installed on the root of
		// the bundle directory so a location was not set.
		if ( ! isset($config['location']))
		{
			$config['location'] = $bundle;
		}

		static::$bundles[$bundle] = array_merge($defaults, $config);

		// It is possible for the developer to specify auto-loader mappings
		// directly on the bundle registration. This provides a convenient
		// way to register mappings without a bootstrap.
		if (isset($config['autoloads']))
		{
			static::autoloads($bundle, $config);
		}
	}
403517
private void renderBundle(final ContextTreeConfig config, final TreeNode root,
                              final Class<?> scope, final Class<Object> bundle) {
        final BundleItemInfo info = service.getData().getInfo(bundle);
        if (isHidden(config, info, scope)) {
            return;
        }
        final List<String> markers = Lists.newArrayList();
        fillCommonMarkers(info, markers, scope);
        final TreeNode node = new TreeNode(RenderUtils.renderClassLine(bundle, markers));
        // avoid duplicate bundle content render
        if (!isDuplicateRegistration(info, scope)) {
            renderScopeContent(config, node, bundle);
        }
        // avoid showing empty bundle line if configured to hide (but show if bundle is ignored as duplicate)
        if (node.hasChildren() || !config.isHideEmptyBundles()
                || (!config.isHideDisables() && markers.contains(IGNORED))) {
            root.child(node);
        }
    }
1353954
private void initResourceBundles(List<JoinableResourceBundle> resourceBundles)
			throws DuplicateBundlePathException, BundleDependencyException {

		// Create custom defined bundles
		bundleDefinitionsWithDependencies = new HashSet<>();
		if (null != bundleDefinitions) {
			if (LOGGER.isInfoEnabled())
				LOGGER.info("Adding custom bundle definitions. ");
			for (ResourceBundleDefinition def : bundleDefinitions) {
				// If this is a composite bundle
				if (def.isComposite()) {
					resourceBundles.add(buildCompositeResourcebundle(def));
				} else
					resourceBundles.add(buildResourcebundle(def));
			}
		}

		// Normalize the base Dir if needed
		if (!jawrConfig.getGeneratorRegistry().isPathGenerated(baseDir)) {
			this.baseDir = PathNormalizer.asDirPath(baseDir);
		}

		// Use the dirmapper if specified
		if (useDirMapperFactory) {
			if (LOGGER.isInfoEnabled())
				LOGGER.info("Using ResourceBundleDirMapper. ");

			ResourceBundleDirMapper dirFactory = new ResourceBundleDirMapper(baseDir, resourceReaderHandler,
					resourceBundles, fileExtension, excludedDirMapperDirs);
			Map<String, String> mappings = dirFactory.getBundleMapping();
			for (Entry<String, String> entry : mappings.entrySet()) {
				resourceBundles.add(buildDirMappedResourceBundle(entry.getKey(), entry.getValue()));
			}
		}

		if (this.scanForOrphans) {
			// Add all orphan bundles
			OrphanResourceBundlesMapper orphanFactory = new OrphanResourceBundlesMapper(baseDir, resourceReaderHandler,
					jawrConfig.getGeneratorRegistry(), resourceBundles, fileExtension);
			List<String> orphans = orphanFactory.getOrphansList();

			// Orphans may be added separately or as one single resource bundle.
			if (useSingleResourceFactory) {
				// Add extension to the filename
				if (!singleFileBundleName.endsWith(fileExtension))
					singleFileBundleName += fileExtension;

				if (LOGGER.isInfoEnabled())
					LOGGER.info("Building bundle of orphan resources with the name: " + singleFileBundleName);

				resourceBundles.add(buildOrphansResourceBundle(singleFileBundleName, orphans));

			} else {
				if (LOGGER.isInfoEnabled())
					LOGGER.info("Creating mappings for orphan resources. ");
				for (Iterator<String> it = orphans.iterator(); it.hasNext();) {
					resourceBundles.add(buildOrphanResourceBundle(it.next()));
				}
			}
		} else if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Skipping orphan file auto processing. ");
			if ("".equals(jawrConfig.getServletMapping()))
				LOGGER.debug("Note that there is no specified mapping for Jawr "
						+ "(it has been seet to serve *.js or *.css requests). "
						+ "The orphan files will become unreachable through the server.");
		}

		// Initialize bundle dependencies
		for (ResourceBundleDefinition definition : bundleDefinitionsWithDependencies) {
			JoinableResourceBundle bundle = getBundleFromName(definition.getBundleName(), resourceBundles);
			if (bundle != null) {
				bundle.setDependencies(getBundleDependencies(definition, resourceBundles));
			}
		}
	}