<commit_before>import grails.util.BuildSettingsHolder

eventCreateWarStart = { warName, stagingDir ->

    // Scan all plugins src/templates for text templates.
    def dirs = BuildSettingsHolder.settings.getPluginDirectories()
    // Finally scan the application's src/templates
    dirs << new File(basedir)

    for (dir in dirs) {
        // Look for FreeMarker templates.
        def templatePath = new File(dir, 'src/templates/freemarker')
        if (templatePath.exists()) {
            println "Copying FreeMarker templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/freemarker") {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
        // Look for CRM templates.
        templatePath = new File(dir, 'src/templates/crm')
        if (templatePath.exists()) {
            println "Copying CRM templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/crm") {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
        // Look for text templates.
        templatePath = new File(dir, 'src/templates/text')
        if (templatePath.exists()) {
            println "Copying text templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/text") {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
    }
}<commit_msg>When creating war: templates from the application now overwrite the plugin template, even if plugin template is newer<commit_after>import grails.util.BuildSettingsHolder

eventCreateWarStart = { warName, stagingDir ->

    // Scan all plugins src/templates for text templates.
    def dirs = BuildSettingsHolder.settings.getPluginDirectories()
    // Finally scan the application's src/templates
    dirs << new File(basedir)

    for (dir in dirs) {
        // Look for FreeMarker templates.
        def templatePath = new File(dir, 'src/templates/freemarker')
        if (templatePath.exists()) {
            println "Copying FreeMarker templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/freemarker", overwrite: true) {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
        // Look for CRM templates.
        templatePath = new File(dir, 'src/templates/crm')
        if (templatePath.exists()) {
            println "Copying CRM templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/crm", overwrite: true) {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
        // Look for text templates.
        templatePath = new File(dir, 'src/templates/text')
        if (templatePath.exists()) {
            println "Copying text templates from $dir to war...\n"
            ant.copy(todir: "${stagingDir}/WEB-INF/templates/text", overwrite: true) {
                fileset(dir: templatePath, includes: "**/*.*")
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.1279947489333771, 'fraction_numerical': 0.0, 'mean_word_length': 2.1683991683991684, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7112821', 'n_tokens_mistral': 882, 'n_tokens_neox': 838, 'n_words': 217}