How to copy to multiple destinations with Gradle copy task?

前端 未结 5 1178
陌清茗
陌清茗 2020-12-05 04:02

I am trying to copy one file to multiple destinations through a Gradle task. I found the following in other websites but I get an ERROR while running this task.



        
5条回答
  •  囚心锁ツ
    2020-12-05 04:30

    an alternative way

    task myCustomTask << {
    
        copy {
            from 'sourcePath/folderA'
            into 'targetPath/folderA'
        }
    
        copy {
            from 'sourcePath/folderB'
            into 'targetPath/folderB'
        }
    
        copy {
            from 'sourcePath/fileA.java','sourcePath/fileB.java'
            into 'targetPath/folderC'
        }
    }
    

提交回复
热议问题