How to run copy task with android studio into assets folder

后端 未结 7 984
温柔的废话
温柔的废话 2020-12-01 11:53

So far I have added the following to the end of my \"build.gradle\"

task copyFiles(type: Copy)

copyFiles {
    description = \'Copies html5 files from the c         


        
7条回答
  •  情话喂你
    2020-12-01 12:56

    task myCopyToAssets(type: Copy) {
        def toDir = rootProject.file('app/assets')
        from (rootProject.file('app/usb')) {
            include 'libhotplug.so'
        }
        into toDir
    }
    
    
    
    tasks.whenTaskAdded { task ->
        //println task.getName()
        if (task.name == 'assembleDebug' || task.name == 'assembleRelease') {
            println 'myCopy'
            myCopyToLibs.execute()
            myCopyToAssets.execute()
        }
    }
    

提交回复
热议问题