【问题标题】:android gradle copy task not workandroid gradle复制任务不起作用
【发布时间】:2016-11-08 10:15:32
【问题描述】:

我的项目结构为:

-主项目
--主题一个

在我的主题一个build.gradle添加复制任务

 task makeDebugJar(type: Copy) {
   def dist = new File("livenessLib/build/outputs","jars")
   if (!dist.exists()) {
    dist.mkdir()
   }
   println "++++++debug MyLib task invoke ++++++: "
   def sourcedir = new File("build/intermediates/bundles/debug/")
   if (sourcedir.exists()) {
       from(sourcedir) {
         include('classes.jar')
       }
      into(dist)
      println "++++++Copy doaane ++++++: "
      rename('classes.jar', 'ZALiveness-debug.jar')
      println "++++++rename done ++++++: "
  }
 }
 makeDebugJar.dependsOn build

然后构建主项目,日志显示每一步调用,并创建了目录jars,但此目录中没有jar。

谁能帮我解决这个问题?非常感谢

【问题讨论】:

    标签: android


    【解决方案1】:
    task copyFiles(type: Copy)
    
    copyFiles {
        description = 'Copies html5 files from the common library...'
        from '../../www'
        into 'assets/www'
        include('**/*')
    }
    

    请看:

    How to run copy task with android studio into assets folder

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-10
      • 2012-04-21
      • 2020-10-06
      • 2019-12-13
      • 2013-12-30
      • 2023-03-31
      • 2016-07-17
      • 1970-01-01
      相关资源
      最近更新 更多