Adds a library to the list of libraries that should be loaded in the web page.
<p>The function will also load the dependencies (if any) and will have no effect if the library has already been loaded.</p>

@param WebLibraryInterface $library
497771
public function addLibrary(WebLibraryInterface $library): void
    {
        if ($this->rendered) {
            throw new WebLibraryException("The libraries have already been rendered. This call to addLibrary should be performed BEFORE the toHtml method of WebLibraryManager is called.");
        }
        if (array_search($library, $this->webLibraries) === false) {
            // Let's start by adding dependencies.
            $dependencies = $library->getDependencies();
            if ($dependencies) {
                foreach ($dependencies as $dependency) {
                    /* @var $dependency WebLibraryInterface */
                    $this->addLibrary($dependency);
                }
            }
            
            $this->webLibraries[] = $library;
        }
    }
113867
@Override
    public T addAsLibrary(String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName must be specified");
        File file = fileFromResource(resourceName);
        return addAsLibrary(file, new BasicPath(resourceName));
    }
613388
protected function addElementDependencies(ElementInterface $element, AttributeCollection $collection)
    {
        if ($element->hasOption('dependencies') && count($element->getOption('dependencies'))) {
            $dependencies = $this->formatter->formatDependencies($element->getOption('dependencies'));
            $collection->add(new Attribute('agDependencies', $dependencies, Attribute::TYPE_ARRAY));
        }
    }
886317
public void addLibrary(Class<?> library) {
        for (Method method : library.getDeclaredMethods()) {
            if ((method.getModifiers() & Modifier.PUBLIC) == 0) {
                continue; // ignore non-public methods
            }

            String name = method.getName().toLowerCase();

            // strip preceding _ chars used to avoid conflicts with Java keywords
            if (name.startsWith("_")) {
                name = name.substring(1);
            }

            m_functions.put(name, method);
        }
    }
1099564
public static synchronized void loadLibrary(File jar) throws NoAvailableBackendException {
        try {
            /*We are using reflection here to circumvent encapsulation; addURL is not public*/
            java.net.URLClassLoader loader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
            java.net.URL url = jar.toURI().toURL();
            /*Disallow if already loaded*/
            for (java.net.URL it : java.util.Arrays.asList(loader.getURLs())) {
                if (it.equals(url)) {
                    return;
                }
            }
            java.lang.reflect.Method method =
                            java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] {java.net.URL.class});
            method.setAccessible(true); /*promote the method to public access*/
            method.invoke(loader, new Object[] {url});
        } catch (final java.lang.NoSuchMethodException | java.lang.IllegalAccessException
                        | java.net.MalformedURLException | java.lang.reflect.InvocationTargetException e) {
            throw new NoAvailableBackendException(e);
        }
    }
136466
public function addNode(DependencyNode $node)
    {
        if (!$this->dependencies->contains($node)) {
            $this->dependencies->attach($node, new ArrayObject());
            $this->nodes[] = $node;

            foreach ($node->getDependencies() as $depency) {
                $this->addDependency($node, $depency);
            }
        }
    }
821269
public function insertLibrary($index, $library, $href)
    {
        $href = '/lib/' . $library . '/css/' . $href;
        $this->insert($index, 'library', $href);
        return $this;
    }
852433
public function saveLibrary($library) {
    $dest = $this->path . '/libraries/' . \H5PCore::libraryToString($library, TRUE);

    // Make sure destination dir doesn't exist
    \H5PCore::deleteFileTree($dest);

    // Move library folder
    self::copyFileTree($library['uploadDirectory'], $dest);
  }
253856
def add_external_library(library):
    

    for command in ['build', 'build_ext', 'install']:
        add_command_option(command, str('use-system-' + library),
                           'Use the system {0} library'.format(library),
                           is_bool=True)
246692
public function loadPackage($names)
    {
        $names = is_array($names) ? $names : func_get_args();

        foreach ($names as $name) {
            if (!array_key_exists($name, $this->packages)) {

                /** @var PackageInterface $package */
                if (!is_null($package = $this->manager->load($name))) {
                    $this->packages[$name] = $package;

                    if ($package->hasDependencies()) {
                        foreach ($package->getDependencies() as $dependency) {
                            $this->loadPackage($dependency);
                        }
                    }
                }
            }
        }

        return $this;
    }
295396
public static function add($library) {
		$connected = Application::get('flag.global.library.' . $library . '.connected');
		if (!$connected) {
			Factory::submodule('flag.global.library.' . $library . '.submodule')->add();
			Application::set('flag.global.library.' . $library . '.connected', true);
		}
	}
630513
protected function init( $product, $dependency = 'boldgrid/library' ) {
		$this->product = $product;
		$this->dependency = $dependency;
		Option::init();
		$this->libraries = Option::get( 'library' );
		$this->verify();
	}
1038657
@Override
    public T addAsLibraries(File... resources) throws IllegalArgumentException {
        Validate.notNull(resources, "Resources must be specified");
        for (File resource : resources) {
            addAsLibrary(resource);
        }
        return covarientReturn();
    }
383071
private void copyLibraryElementsToClasspath(Library library) {
        Collection<File> files = library.getFiles();
        addToClassPath(library.getContainers());
        if (files != null && !!!files.isEmpty()) {
            for (File file : files) {

                nativeLibraryFiles.add(file);
            }
        }

        for (Fileset fileset : library.getFilesets()) {
            for (File file : fileset.getFileset()) {

                nativeLibraryFiles.add(file);
            }
        }
    }
876057
public function add($element, $dependencies = array())
    {
        // Add
        $this->elements[$element] = (object)array(
            'id' => $element,
            'dependencies' => (array)$dependencies,
            'visited' => false
        );
    }
299221
public function addListener(ListenerInterface $listener)
    {
        if (!in_array($listener, $this->collection_listeners, true)) {
            $this->collection_listeners[] = $listener;
        }
    }
640279
public function addLibrary(Library $library) {
		if (!$this->view->getHtmlProperties()->registerLibrary($library)) {
			return $this;
		}
		
		$library->apply($this->view, $this);
		
		return $this;
	}