How to run copy task with android studio into assets folder
This way I do custom copying of file assets in my android-gradle build system
preBuild.dependsOn copyFiles
Here is the module's build.gradle that I am using which successfully copies the files that I wanted as a pre-build task. The "into" is modelled after the File class in Java, so it should be familiar on how to use it. The two lines at the end is optional - it will run the copyFiles task when invoking gradle clean:
android {
.....
}
task copyFiles(type: Copy) {
description = 'copying some file(s)....'
from 'src/main'
into project(':Path:To:ModuleFrom:Settings.gradle').file('./res')
include 'file1.suffix'
include '**/*.html'
}
project.afterEvaluate {
preBuild.dependsOn copyFiles
}
clean.dependsOn copyFiles
clean.mustRunAfter copyFiles