androidandroid-studiobuild.gradlegenerated-codegradle-task

Generated code stays in build folder after Android Studio Build


I am using a gradle task to generate some code for my API and store this code into the build folder. When I am building my application the process deletes the build folder.

Is there a way to call my code generation task between the folder deletion and the start of the compilation?


Solution

  • After allot of trying , i found the solution . In the build.gradle i had to add the preBuild.finalizedBy(generateCode)