void apply()

in src/main/groovy/com/epam/atg/gradle/initializers/GradleTasksInitializer.groovy [33:70]


    void apply(Project project) {
        project.ext.RunAssembler = RunAssemblerTask.class


        project.configurations.create(ATGPluginConstants.MANIFEST_ATG_CLASSPATH)

        project.tasks.create(ATGPluginConstants.DEPENDENCIES_SINK_TASK, Copy.class, {  task ->
            def plugin = ATGPlugin.getPluginExtension(project)
            task.onlyIf {
                println("dependenciesSinkPath: ${plugin.dependenciesSinkPath}")
                plugin.dependenciesSinkPath != null
            }
            task.setGroup(ATGPluginConstants.ATG_TASK_GROUP)
            project.afterEvaluate {
                task.from(project.configurations.atgClassPath)
                task.into(plugin.dependenciesSinkPath)
            }
            task.doFirst {project.delete(plugin.dependenciesSinkPath)}
        })

        project.tasks.create(ATGPluginConstants.MANIFEST_TASK, ManifestGeneratorTask.class, { task ->
            task.setGroup(ATGPluginConstants.ATG_TASK_GROUP)
            project.afterEvaluate {
                ManifestConfig manifestConfig = buildAtgManifestConfig(project)
                task.onlyIf {
                    if (manifestConfig == null) {
                        return false
                    }
                    boolean notExist = !manifestConfig.override && !new File(manifestConfig.manifestFilePath).exists()
                    boolean override = manifestConfig.override
                    boolean skipGeneration = manifestConfig.skipGeneration
                    return !skipGeneration && (override || notExist)
                }
                task.manifestConfig = manifestConfig
                task.outputFile = new File(project.projectDir.absolutePath + '/' + manifestConfig?.manifestFilePath)
            }
        })
    }