MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / mergeModules

Method mergeModules

Engine/source/module/moduleManager.cpp:1518–1696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516//-----------------------------------------------------------------------------
1517
1518bool ModuleManager::mergeModules( const char* pMergeTargetPath, const bool removeMergeDefinition, const bool registerNewModules )
1519{
1520 // Sanity!
1521 AssertFatal( pMergeTargetPath != NULL, "Cannot merge modules with a target path of NULL." );
1522
1523 // Is a module merge available?
1524 if ( !isModuleMergeAvailable() )
1525 {
1526 // No, so warn.
1527 Con::warnf( "Cannot merge modules as a module merge is not available." );
1528 return false;
1529 }
1530
1531 // Expand the target path.
1532 char targetPathBuffer[1024];
1533 Con::expandPath( targetPathBuffer, sizeof(targetPathBuffer), pMergeTargetPath );
1534 pMergeTargetPath = targetPathBuffer;
1535
1536 // Fetch module merge file path.
1537 StringTableEntry moduleMergeFilePath = getModuleMergeFilePath();
1538
1539 // Read module merge definition.
1540 Taml taml;
1541 ModuleMergeDefinition* pModuleMergeDefinition = taml.read<ModuleMergeDefinition>( moduleMergeFilePath );
1542
1543 // Do we have a module merge definition.
1544 if ( pModuleMergeDefinition == NULL )
1545 {
1546 // No, so warn.
1547 Con::warnf( "Cannot merge modules as the module merge definition file failed to load '%s'.", moduleMergeFilePath );
1548 return false;
1549 }
1550
1551 // Fetch the merge source path.
1552 StringTableEntry mergeSourcePath = pModuleMergeDefinition->getModuleMergePath();
1553
1554 // Remove the module merge definition.
1555 pModuleMergeDefinition->deleteObject();
1556 pModuleMergeDefinition = NULL;
1557
1558 // If we cannot merge the modules then we only process modules flagged as critical merge.
1559 const bool criticalMergeOnly = !canMergeModules( mergeSourcePath );
1560
1561 // Initialize the target module manager and scan the target folder for modules.
1562 ModuleManager targetModuleManager;
1563 targetModuleManager.mEnforceDependencies = false;
1564 targetModuleManager.mEchoInfo = false;
1565 targetModuleManager.scanModules( pMergeTargetPath );
1566
1567 // Initialize the source module manager and scan the source folder for modules.
1568 ModuleManager sourceModuleManager;
1569 sourceModuleManager.mEnforceDependencies = false;
1570 sourceModuleManager.mEchoInfo = false;
1571 sourceModuleManager.scanModules( mergeSourcePath );
1572
1573 // Find all the source modules.
1574 typeConstModuleDefinitionVector sourceModules;
1575 sourceModuleManager.findModules( false, sourceModules );

Callers 1

Calls 15

warnfFunction · 0.85
expandPathFunction · 0.85
dSprintfFunction · 0.85
getModuleMergePathMethod · 0.80
scanModulesMethod · 0.80
findModulesMethod · 0.80
getCriticalMergeMethod · 0.80
getModuleIdMethod · 0.80
getVersionIdMethod · 0.80
getBuildIdMethod · 0.80
findModuleIdMethod · 0.80
findModuleDefinitionMethod · 0.80

Tested by

no test coverage detected