apply plugin: 'java'

repositories {
  jcenter()
}

sourceSets {
    main {
        java {
            srcDirs = ["src/"]
        }
        resources {
            srcDirs = ["src/"]
            exclude '**/*.java'
        }
    }

    test {
        java {
            srcDirs = ['test/']
        }
    }
}

jar {
  manifest {
    attributes 'Implementation-Title': 'ASMCup Runtime',
               'Main-Class': 'asmcup.sandbox.Main'
  }
}

dependencies {
    testCompile "junit:junit:4.12"
}

// ------------------ code coverage ------------------------------ //

apply plugin: 'jacoco'

jacoco {
    toolVersion = "0.7.6.201602180812"
    reportsDir = file("$buildDir/codecoverage")
}

jacocoTestReport {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination "${buildDir}/codecoverage"
    }
}

// ------------------ static analysis ---------------------------- //

apply plugin: 'findbugs'

findbugs {
    reportLevel = "high"
}

tasks.withType(FindBugs) {
    reports {
        xml.enabled false
        html.enabled true
    }
}