title: Adding a custom library as a dependency in SAP Fiori
body: <p>I have a custom library com.foo.library I would like to include as a dependency of a Fiori-like app I have built.</p>
  
  <p><a href="http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0b41949-b803-3210-6bba-dc97da1ac623?QuickLink=index&amp;overridelayout=true&amp;59511067181158" rel="nofollow">SAP Fiori Launchpad for Developers</a> -> Best Practices for Launchpad Apps</p>
  
  <blockquote>
    <p>Declare configuration information, like the location of icons, and library dependencies in the component.js configuration file</p>
  </blockquote>
  
  <p>makes sense, adding my library as a dependency would look like</p>
  
  <pre><code>    dependencies: {
          libs: ["sap.m", "sap.ui.layout", "com.foo.library"],
          components: []
      },
  </code></pre>
  
  <p>with Fiori you have the constraint that you must use relative paths.</p>
  
  <p>eg for my dependency to work it must be found at</p>
  
  <blockquote>
    <p>/resources/com/foo/library</p>
  </blockquote>
  
  <p>What are the steps for uploading a custom library into the ABAP SAPUI5 Repository and having it served with a relative path?</p>
  
  <p>EDIT:</p>
  
  <p>Currently i have the library loaded on Component.init using</p>
  
  <pre><code> sap.ui.getCore().loadLibrary("com.foo.library", "absolute path to library");
  </code></pre>
  
  <p>it works, however I want to set the library as a dependency</p>
  
  <pre><code>ComponentMetadata.prototype._loadDependencies = function() {
  ..
              if (aLibraries) {
              jQuery.each(aLibraries, function(i, sLib) {
                  jQuery.sap.log.info("Component \"" + that.getName() + 
                  sap.ui.getCore().loadLibrary(sLib);
              });
          }
  </code></pre>
  
  <p>from code above I can see there is no option to pass in a url when the component loads the library dependencies, so i am assuming that the library has to be found relative to the resources</p>