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

前端 未结 5 824
傲寒
傲寒 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:07

    Gradle Kotlin Script analogue:

    tasks {
        getByName("clean") {
            delete.add("logs") // add accepts argument with Any type
        }
    }
    

提交回复
热议问题