Stop parsing code

How can i stop gradle to start by parsing code , because i have to import an ant file which is generated after starting execution of code , so how can i say to gradle to execute code step by step to can find this file after being generated.
thank you

It’s hard from your description to know exactly what you’re doing but I’m guessing something like

task generateAnt {
   inputs.files fileTree('src/main/xxx')
   outputs.file "$buildDir/generated/build.xml"
   doLast {
      String xml = generateXml(fileTree('src/main/xxx')) 
      mkdir "$buildDir/generated" 
      file("$buildDir/generated/build.xml").text = xml
task useGeneratedAnt {
   dependsOn generateAnt
   doLast {
      ant.includeBuild "$buildDir/generated/build.xml"
      ant.task1 {...} 
      ant.task2 {...} 

Please note that you’d only do something like this for legacy reasons (eg migrating ant build to gradle). There are much better solutions available in Gradle which don’t need ant

1 Like

Thanks for your response , but it s not that my problem , i already resolved it , by calling the file out of task , so gradle start building line by line .