I try to add some logging messages to my Copy-task. I do
def testEnvPath = "../${taskName - 'update'}/"
into (testEnvPath)
[...]
// copies sql folder
from ("sql/updates/sql/") {
include "*.*"
into "sql/updates/sql"
eachFile { file ->
logger.info("Copied ${file.sourcePath} -> ${file.path}" )
}
}
The output is, that file.sourcePath just returns the file name, while file.path returns the path but without the configured root ‘into()’ statement. E. g.
Copied my_sql.sql -> sql/updates/sql/my_sql.sql
I’d rather have the absoluteSourcePath and the destination path as a canonical path. E. g.
Copied D://.../my_sql.sql -> ../project/sql/updates/sql/my_sql.sql