configurations {
    junitAnt
}

dependencies {
  // initialize JUnit optional ant task
  junitAnt 'junit:junit:4.8.2'
  junitAnt('org.apache.ant:ant-junit:1.9.2') {
      transitive = false
  }
}

ant.taskdef(name: 'junit',
            classname: 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask',
            classpath: configurations.junitAnt.asPath)

ant.importBuild('build.xml') {antTarget ->
    'lambdacalc-'+antTarget
}

// ensure 'generate' runs before 'classes' ('generate' is NOT optional)
'lambdacalc-compileJava' {
  dependsOn {
    'lambdacalc-generate'
  }  
  mustRunAfter {
    'lambdacalc-generate'
  }
}

'lambdacalc-declare-mps-tasks' {
  dependsOn {
    ':setup'
  }
}

'lambdacalc-generate' {
  dependsOn {
    ':coderules-assemble'
  }
}

assemble {
  dependsOn {
    'lambdacalc-assemble'
  }
}

check {
  dependsOn {
    'lambdacalc-check'
  }
}
