/*
 * WARNING
 *
 * This file should not be edited.
 *
 * GNU LIBRARY GENERAL PUBLIC LICENSE
 * Version 2, June 1991
 *
 * Add tasks that are relevant to Java projects.
 */

assert(project != rootProject               )
assert(rootProject.hasProperty('bnd_cnf'   ))
assert(            hasProperty('sourceSets'))


/* Setup javadoc options */
apply from: rootProject.file("${rootProject.bnd_cnf}/gradle/template/javaDoc.gradle")

/* Add spotbugs to the project */
apply from: rootProject.file("${rootProject.bnd_cnf}/gradle/template/spotbugs.gradle")

/* Add jacoco to the project */
apply from: rootProject.file("${rootProject.bnd_cnf}/gradle/template/jacoco.gradle")

clean.doLast {
  sourceSets.each {
    for (d in it.output.classesDirs) {
      if (projectDir != d) {
        delete(d)
      }
    }
    if (projectDir != it.output.resourcesDir) {
      delete(it.output.resourcesDir)
    }
    if (projectDir != buildDir) {
      delete(buildDir)
    }
  }
}
