I am having issues with a subproject copy task. Every time I run this it says build successful but doesn’t perform the copy operation correctly. When ran with debug mode it says:
Skipping task ‘:app:copy’ as it has no source files.
Can any one review this code and let me know why it is not copying files? The source directory contains php, html and css files while the destination folder is a place from where I will upload it online.
In my understanding of your description, you want to copy files from the directory root-dir/services/website/app into the directory root-dir/app/dist/app, right?
In the context of project(':app'){} block, a directory name is evaluated as relative to root-dir/app directory.
So, this task definition is
copy from root-dir/app/services/website/app
copy into root-dir/app/dist/app
If you don’t have a directory root-dir/app/services/website/app, Gradle considers input file is empty so that task :app:copy is always UP-TO-DATE.
If your goal is the same as my understanding, please modify :app:copy task definition as
project (':app') {
task copy(type: Copy) {
includeEmptyDirs = true
def fromDir = rootProject.file('service/website/app/') // the directory is root-dir/services/website/app
def toDir = 'dist/app/' // the directory is root-dir/app/dist/app
from fromDir
into toDir
}
}
If my understanding is different from your goal, please let me know.