lib/qx/tool/compiler/app/Application.js
function(resManager, environment) {
      var assets = [];
      var analyser = this.getAnalyser();
      var db = analyser.getDatabase();
      
      // Compile theme resource aliases
      var aliases = {};
      function getAliases(classname) {
        var tmp = db.classInfo[classname];
        if (tmp) {
          if (tmp.aliases) {
            for (var alias in tmp.aliases) {
              aliases[alias] = tmp.aliases[alias]; 
            }
          }
          if (tmp.extends) {
            getAliases(tmp.extends);
          }
        }
      }
      var themeInfo = db.classInfo[this.getTheme()];
      if (themeInfo && themeInfo.themeMeta) {
        for (let name in themeInfo.themeMeta) {
          getAliases(themeInfo.themeMeta[name]); 
        }
      }
      
      // Get a list of libraries used
      var libraryLookup = {};

      // Check all the classes
      var classNames = this.__loadDeps.slice();
      for (let i = 0; i < classNames.length; i++) {
        var classname = classNames[i];
        var classInfo = db.classInfo[classname];
        var tmp = classInfo.assets;
        if (tmp) {
          tmp.forEach(function(uri) {
            var pos = uri.indexOf("/");
            if (pos > -1) {
              var prefix = uri.substring(0, pos);
              var mappedPrefix = aliases[prefix];
              if (mappedPrefix) {
                uri = mappedPrefix + uri.substring(pos); 
              }
            }
            var library = resManager.findLibraryForResource(uri);
            if (library) {
              assets.push(library.getNamespace() + ":" + uri); 
            }
          });
        }
        if (!libraryLookup[classInfo.libraryName]) {
          libraryLookup[classInfo.libraryName] = analyser.findLibrary(classInfo.libraryName);
        }
      }
      
      for (let name in libraryLookup) {
        var lib = libraryLookup[name];
        if (lib) {
          if (lib.getAddScript()) {
            lib.getAddScript().forEach(function(path) {
              assets.push(lib.getNamespace() + ":" + path);
            });
          }
          if (lib.getAddCss()) {
            lib.getAddCss().forEach(function(path) {
              assets.push(lib.getNamespace() + ":" + path);
            });
          }
        }
      }

      // Expand variables
      for (let i = 0; i < assets.length; i++) {
        let asset = assets[i];

        var m = asset.match(/\$\{([^}]+)\}/);
        if (m) {
          var match = m[0];
          var capture = m[1];
          var pos = asset.indexOf(match);
          var left = asset.substring(0, pos);
          var right = asset.substring(pos + match.length);
          var value = environment[capture];
          if (value !== undefined) {
            if (qx.lang.Type.isArray(value)) {
              value.forEach(function(value) {
                assets.push(left + value + right);
              });
            } else {
              assets.push(left + value + right);
            }
          }
          qx.lang.Array.removeAt(assets, i--);
        }
      }

      // Remove duplicates and overlapping path wildcards
      assets.sort();
      for (let i = 1; i < assets.length; i++) {
        let asset = assets[i];
        var lastAsset = assets[i - 1];

        if (asset == lastAsset) {
          assets.splice(i--, 1);
          continue;
        }

        if (lastAsset[lastAsset.length - 1] == "*") {
          var path = lastAsset.substring(0, lastAsset.length - 1);
          if (asset.substring(0, path.length) == path) {
            assets.splice(i--, 1);
            continue;
          }
        }
      }

      return assets;
    }
function(resManager, environment) {
      var assets = [];
      var analyser = this.getAnalyser();
      var db = analyser.getDatabase();
      
      // Compile theme resource aliases
      var aliases = {};
      function getAliases(classname) {
        var tmp = db.classInfo[classname];
        if (tmp) {
          if (tmp.aliases) {
            for (var alias in tmp.aliases) {
              aliases[alias] = tmp.aliases[alias]; 
            }
          }
          if (tmp.extends) {
            getAliases(tmp.extends);
          }
        }
      }
      var themeInfo = db.classInfo[this.getTheme()];
      if (themeInfo && themeInfo.themeMeta) {
        for (let name in themeInfo.themeMeta) {
          getAliases(themeInfo.themeMeta[name]); 
        }
      }
      
      // Get a list of libraries used
      var libraryLookup = {};

      // Check all the classes
      var classNames = this.__loadDeps.slice();
      for (let i = 0; i < classNames.length; i++) {
        var classname = classNames[i];
        var classInfo = db.classInfo[classname];
        var tmp = classInfo.assets;
        if (tmp) {
          tmp.forEach(function(uri) {
            var pos = uri.indexOf("/");
            if (pos > -1) {
              var prefix = uri.substring(0, pos);
              var mappedPrefix = aliases[prefix];
              if (mappedPrefix) {
                uri = mappedPrefix + uri.substring(pos); 
              }
            }
            var library = resManager.findLibraryForResource(uri);
            if (library) {
              assets.push(library.getNamespace() + ":" + uri); 
            }
          });
        }
        if (!libraryLookup[classInfo.libraryName]) {
          libraryLookup[classInfo.libraryName] = analyser.findLibrary(classInfo.libraryName);
        }
      }
      
      for (let name in libraryLookup) {
        var lib = libraryLookup[name];
        if (lib) {
          if (lib.getAddScript()) {
            lib.getAddScript().forEach(function(path) {
              assets.push(lib.getNamespace() + ":" + path);
            });
          }
          if (lib.getAddCss()) {
            lib.getAddCss().forEach(function(path) {
              assets.push(lib.getNamespace() + ":" + path);
            });
          }
        }
      }

      // Expand variables
      for (let i = 0; i < assets.length; i++) {
        let asset = assets[i];

        var m = asset.match(/\$\{([^}]+)\}/);
        if (m) {
          var match = m[0];
          var capture = m[1];
          var pos = asset.indexOf(match);
          var left = asset.substring(0, pos);
          var right = asset.substring(pos + match.length);
          var value = environment[capture];
          if (value !== undefined) {
            if (qx.lang.Type.isArray(value)) {
              value.forEach(function(value) {
                assets.push(left + value + right);
              });
            } else {
              assets.push(left + value + right);
            }
          }
          qx.lang.Array.removeAt(assets, i--);
        }
      }

      // Remove duplicates and overlapping path wildcards
      assets.sort();
      for (let i = 1; i < assets.length; i++) {
        let asset = assets[i];
        var lastAsset = assets[i - 1];

        if (asset == lastAsset) {
          assets.splice(i--, 1);
          continue;
        }

        if (lastAsset[lastAsset.length - 1] == "*") {
          var path = lastAsset.substring(0, lastAsset.length - 1);
          if (asset.substring(0, path.length) == path) {
            assets.splice(i--, 1);
            continue;
          }
        }
      }

      return assets;
    }
function ( resManager , environment ) { var assets = [ ] ; var analyser = this . getAnalyser ( ) ; var db = analyser . getDatabase ( ) ; // Compile theme resource aliases var aliases = { } ; function getAliases ( classname ) { var tmp = db . classInfo [ classname ] ; if ( tmp ) { if ( tmp . aliases ) { for ( var alias in tmp . aliases ) { aliases [ alias ] = tmp . aliases [ alias ] ; } } if ( tmp . extends ) { getAliases ( tmp . extends ) ; } } } var themeInfo = db . classInfo [ this . getTheme ( ) ] ; if ( themeInfo && themeInfo . themeMeta ) { for ( let name in themeInfo . themeMeta ) { getAliases ( themeInfo . themeMeta [ name ] ) ; } } // Get a list of libraries used var libraryLookup = { } ; // Check all the classes var classNames = this . __loadDeps . slice ( ) ; for ( let i = 0 ; i < classNames . length ; i ++ ) { var classname = classNames [ i ] ; var classInfo = db . classInfo [ classname ] ; var tmp = classInfo . assets ; if ( tmp ) { tmp . forEach ( function ( uri ) { var pos = uri . indexOf ( "/" ) ; if ( pos > - 1 ) { var prefix = uri . substring ( 0 , pos ) ; var mappedPrefix = aliases [ prefix ] ; if ( mappedPrefix ) { uri = mappedPrefix + uri . substring ( pos ) ; } } var library = resManager . findLibraryForResource ( uri ) ; if ( library ) { assets . push ( library . getNamespace ( ) + ":" + uri ) ; } } ) ; } if ( ! libraryLookup [ classInfo . libraryName ] ) { libraryLookup [ classInfo . libraryName ] = analyser . findLibrary ( classInfo . libraryName ) ; } } for ( let name in libraryLookup ) { var lib = libraryLookup [ name ] ; if ( lib ) { if ( lib . getAddScript ( ) ) { lib . getAddScript ( ) . forEach ( function ( path ) { assets . push ( lib . getNamespace ( ) + ":" + path ) ; } ) ; } if ( lib . getAddCss ( ) ) { lib . getAddCss ( ) . forEach ( function ( path ) { assets . push ( lib . getNamespace ( ) + ":" + path ) ; } ) ; } } } // Expand variables for ( let i = 0 ; i < assets . length ; i ++ ) { let asset = assets [ i ] ; var m = asset . match ( / \$\{([^}]+)\} / ) ; if ( m ) { var match = m [ 0 ] ; var capture = m [ 1 ] ; var pos = asset . indexOf ( match ) ; var left = asset . substring ( 0 , pos ) ; var right = asset . substring ( pos + match . length ) ; var value = environment [ capture ] ; if ( value !== undefined ) { if ( qx . lang . Type . isArray ( value ) ) { value . forEach ( function ( value ) { assets . push ( left + value + right ) ; } ) ; } else { assets . push ( left + value + right ) ; } } qx . lang . Array . removeAt ( assets , i -- ) ; } } // Remove duplicates and overlapping path wildcards assets . sort ( ) ; for ( let i = 1 ; i < assets . length ; i ++ ) { let asset = assets [ i ] ; var lastAsset = assets [ i - 1 ] ; if ( asset == lastAsset ) { assets . splice ( i -- , 1 ) ; continue ; } if ( lastAsset [ lastAsset . length - 1 ] == "*" ) { var path = lastAsset . substring ( 0 , lastAsset . length - 1 ) ; if ( asset . substring ( 0 , path . length ) == path ) { assets . splice ( i -- , 1 ) ; continue ; } } } return assets ; }
Returns a list of all of the assets required by all classes
@param resManager {qx.tool.compiler.resources.Manager} the resource manager
@param environment {Map} environment
Returns a list of all of the assets required by all classes