Copy the file from default workdir to target location is not working

136 views Asked by At

I am trying to write a gradle task to copy the file from one location to the target folder but it is not doing anything and showung Up-to-Date.Can someone let me know what am I doing wrong here.I can see the file is avilable in workspace

build/artifacts/Abc-4.0.0.22.lic

and the target location i.e deploypath: /applications/sin-test/licensefile

task copyfile(type: Copy, dependsOn: deployArtifact) << {
     from 'build/artifacts'
     into "${deployPath}"
     include '*.lic'
 }
1

There are 1 answers

0
unknown On

I am able to fix it.I wrote my code in below manner to copy the file to target location and rename it.

task copyfile(dependsOn: deployArtifact) << {
     copy {
     from "${buildDir}/artifacts"
     into "${deployPath}"
     include "*.lic"
     rename '(.*)-.*.lic','$1.lic'
     }
   }