private void initModulesArgs ( Map < String , String > resultBundlePathMapping , List < String > args , List < JoinableResourceBundle > bundles , Map < String , JoinableResourceBundle > bundleMap , String modules , List < String > depModulesArgs , List < String > globalBundleDependencies ) { // Define Jawr root module // The JAWR_ROOT_MODULE is a fake module to give a root module to the // dependency graph // This is it's only purpose. It is the root dependency for any module // This is used because Google Closure use a unique module as root for // dependency management // in advance mode args . add ( JS_ARG ) ; args . add ( JAWR_ROOT_MODULE_JS ) ; args . add ( MODULE_ARG ) ; args . add ( JAWR_ROOT_MODULE_NAME + ":1:" ) ; resultBundlePathMapping . put ( JAWR_ROOT_MODULE_NAME , JAWR_ROOT_MODULE_JS ) ; if ( StringUtils . isNotEmpty ( modules ) ) { String [ ] moduleSpecs = modules . split ( ";" ) ; for ( String moduleSpec : moduleSpecs ) { int moduleNameSeparatorIdx = moduleSpec . indexOf ( ":" ) ; if ( moduleNameSeparatorIdx < 0 ) { throw new BundlingProcessException ( "The property 'jawr.js.closure.modules' is not properly defined. Please check your configuration." ) ; } // Check module name String bundleName = moduleSpec . substring ( 0 , moduleNameSeparatorIdx ) ; checkBundleName ( bundleName , bundleMap ) ; JoinableResourceBundle bundle = bundleMap . get ( bundleName ) ; List < String > dependencies = Arrays . asList ( moduleSpec . substring ( moduleNameSeparatorIdx + 1 ) . split ( MODULE_DEPENDENCIES_SEPARATOR ) ) ; dependencies . addAll ( 0 , globalBundleDependencies ) ; generateBundleModuleArgs ( depModulesArgs , bundleMap , resultBundlePathMapping , bundle , dependencies ) ; // Remove the bundle from the list of bundle to treat bundles . remove ( bundle ) ; } } }
Initialize the modules arguments