ATGModule getATGModule()

in src/main/groovy/com/epam/atg/gradle/build/repository/ATGRepositoryImpl.groovy [94:119]


    ATGModule getATGModule(Project project, String moduleName) {
        if(!moduleName) {
            LOGGER.warn('Unable to get module with null moduleName for project: {}', project)
            return null
        }
        ATGModule atgModule = findModule(moduleName)
        if (atgModule != null) {
            return atgModule
        }
        Project atgRootGradleProjectForModule = ProjectUtils.findAtgRootProjectForModule(moduleName, project)
        if (atgRootGradleProjectForModule) {
            atgModule = createCustomAtgModule(moduleName, atgRootGradleProjectForModule)
        } else  {
            atgModule = createOutOfTheBoxAtgModule(moduleName)
        }
        if (atgModule == null) {
            LOGGER.warn('Could not find module {}', moduleName)
            return null
        }
        if(!atgModule.initialize()) {
            LOGGER.warn('{} atg module not valid and will be skipped.', project)
            return null
        }
        addModule(atgModule)
        return atgModule
    }