// the JOrtho tests are currently broken
test.enabled = false

configurations {
    ant_tasks
}

dependencies {
    ant_tasks project(':freeplane_ant')
}

jar {
    dependsOn 'check_translation'
    baseName "jortho"
}

task format_translation(dependsOn: configurations.ant_tasks) {
    doLast {
        ant.taskdef(
            name: "format_translation",
            classname: "org.freeplane.ant.FormatTranslation",
            classpath: configurations.ant_tasks.asPath
        )

        //TODO: Refer to resources in a better way. Should be able to get this from
        //the source sets.
        ant.format_translation(
            dir: file("./src/main/resources/com/inet/jortho/i18n"),
            includes: "*.properties",
            eolstyle: "unix"
        )
    }
}

task check_translation(dependsOn: configurations.ant_tasks) {
    doLast {
        ant.taskdef(
            name: "check_translation",
            classname: "org.freeplane.ant.FormatTranslationCheck",
            classpath: configurations.ant_tasks.asPath
        )

        ant.check_translation(
            dir: file("./src/main/resources/com/inet/jortho/i18n"),
            includes: "*.properties",
            eolstyle: "unix"
        )
    }
}
