How do I extend gradle's clean task to delete a file?

前端 未结 5 821
傲寒
傲寒 2021-02-01 00:29

So far i\'ve added the following to my build.gradle

apply plugin: \'base\' 
clean << {
    delete \'${rootDir}/api-library/auto-generated-classes/\'
    pr         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 01:13

    Below one works for me (I prefer to use dependsOn),

    task customCleanUp(type:Delete) {
       delete "your_folder", "your_file"
    }
    
    tasks.clean.dependsOn(tasks.customCleanUp)
    

提交回复
热议问题