Rename file in gradle with passed parameter
问题 I'm packaging up my build artefacts from a gradle build. It's an Android Studio project. I have tasks that successfully create a zip file containing two jars. Let's say the zip file is called ' my.zip '. I have the following gradle task: task renameArtifacts (type: Copy) { from ('build/') include 'my.zip' destinationDir file('build/') doLast { println "my-${versionString}.zip" rename('build/my.zip', "build/my-${versionString}.zip") } } And I'm calling it with gradle -PversionString="123" :sdk