How to zip everything within projectDir using gradle 1.11 on windows xp (ok, pls don't laugh!)


(jim northrop) #1

just need a full zip of every folder,sub-folder,sub-sub-folder plus any files in them in my projectDir (would like to exclude /build folder if poss.)

  • using every combination known to man, none of these work using syntax like:
task fullZip(type:Zip){
    //from projectDir
    from '$projectDir/.gradle/*'
    from '$projectDir/archive'
    //from 'gradle'
    destinationDir = file("$buildDir/zips")
    baseName 'full'
    //include '.gradle/**', 'archive/**','gradle/*', 'images', 'libs', 'resources', 'src', 'build.gradle', 'README.md', 'LICENSE', 'gradlew*', '*.txt'
    //exclude 'build/**', '.gitignore', '.git/**'
}

always get:

Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at org.gradle.internal.hash.HashUtil.createHash(HashUtil.java:47)
        ... 59 more

(Jean-Baptiste Nizet) #2

The following works fine here. I’m not on Windows, but I don’t see why it wouldn’t work:

task fullZip(type:Zip){

from projectDir

destinationDir = file("$buildDir/zips")

baseName ‘full’

exclude ‘build’

}


(jim northrop) #3

sorry i dunno how 2 use Gist

HP_Owner@HP-PAVILLION /c/Software/Groovy/AsciidocTemplates/AsciidocTemplates (master)
$ gradlew
-v
  ------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
  Build time:
 2014-02-11 11:34:39 UTC
Build number: none
Revision:
   a831fa866d46cbee94e61a09af15f9dd95987421
  Groovy:
     1.8.6
Ant:
        Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:
        2.2.0
JVM:
        1.7.0_45 (Oracle Corporation 24.45-b08)
OS:
         Windows XP 5.1 x86

and i get this stacktrace:

HP_Owner@HP-PAVILLION /c/Software/Groovy/AsciidocTemplates/AsciidocTemplates (master)
$ gradlew
 allZip
--stacktrace
generateApiDocs=[]
:allZip
  FAILURE: Build failed with an exception.
  * What went wrong:
java.io.IOException: The process cannot access the file because another process has locked a portion of the file
> The process cannot access the file because another process has locked a portion of the file
  * Try:
Run with --info or --debug option to get more log output.
  * Exception is:
org.gradle.api.UncheckedIOException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at org.gradle.internal.hash.HashUtil.createHash(HashUtil.java:57)
        at org.gradle.internal.hash.HashUtil.createHash(HashUtil.java:34)
        at org.gradle.api.internal.hash.DefaultHasher.hash(DefaultHasher.java:24)
        at org.gradle.api.internal.hash.CachingHasher.hash(CachingHasher.java:45)
        at org.gradle.api.internal.changedetection.state.DefaultFileSnapshotter$1.run(DefaultFileSnapshotter.java:49)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:187)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
        at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:193)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:58)
        at org.gradle.api.internal.changedetection.state.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:45)
        at org.gradle.api.internal.changedetection.rules.InputFilesStateChangeRule.create(InputFilesStateChangeRule.java:33)
        at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:46)
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStat
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactSta
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:46)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:37)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:55)
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at org.gradle.internal.hash.HashUtil.createHash(HashUtil.java:47)
        ... 59 more
    BUILD FAILED

so me thinks either jvm 1.7 is wrong for gradle 1.11 or windows xp is too old for jvm -


(jim northrop) #4

yes, well, this works ok on my daughter’s apple macbook but not my winXP, so am guessing this is an XP issue, which will go EOL next month. so let’s close this one.


(Luke Daley) #5

Thanks for the follow up.


(atschabu) #6

it is annoying that the trace does not include the file name, but try excluding the .gradle folder as well, it might be that it includes some cache or lock file of Gradle itself.