gradle - copy file after its generation

后端 未结 4 554
情歌与酒
情歌与酒 2020-12-09 08:44


I try to build jar and after that copy it to another folder.

task createJar(type: Jar) {
    archiveName = \"GradleJarProject.jar\"
    manifest {
             


        
4条回答
  •  醉话见心
    2020-12-09 09:09

    You probably need to ensure they are run in the right order,

    task copyJarToBin(type:Copy,dependsOn:[createJar]) {
       copy {
         from "${buildDir}/GradleJarProject.jar"  // needs to be gstring       
         into "d:/tmp"
        }
    }
    

提交回复
热议问题