Internal Error While Trying To Copy & Rename In Gradle 1.7

(Neill Robbins) #1

I have a gradle script (gradle 1.7) that is trying to do a copy and rename that is getting an internal error. Can somebody tell me what I am doing wrong.

The gradle script is: defaultTasks ‘exampleCopyTask’

task exampleCopyTask (type: Copy) {

from(projectDir) {

include ‘test.txt’

rename {it + ‘.actual’}


into projectDir }

The error is below.

Note if I change the into to “${projectDir}/temp” that works. Its copying (renaming) into the same source folder that appears to be the problem.

org.gradle.api.UncheckedIOException: The process cannot acc ess the file because another process has locked a portion of the file

at org.gradle.util.hash.HashUtil.createHash(

at org.gradle.util.hash.HashUtil.createHash(

at org.gradle.api.internal.changedetection.state.DefaultHasher.hash(Defa

at org.gradle.api.internal.changedetection.state.CachingHasher.hash(Cach

at org.gradle.api.internal.changedetection.state.DefaultFileSnapshotter$

at org.gradle.internal.Factories$1.create(

at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc

at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc

at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De etc…