Can't disable generation of fileHashes.bin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't disable generation of fileHashes.bin

mtakacs
This post has NOT been accepted by the mailing list yet.
Hello,
   Relative gradle newbie here!

   We're running gradle from Jenkins, and starting from a fresh source tree each time.  This seems to be causing gradle to regenerate a hash for each source file (approx 4k files) so that it can do smart task optimization.  Which I dont want in this case. Our build is as simple exec task that runs "grails war", Id just like to run it all the time, w/o spending 5-10 mins building fileHashes.bin

I've tried
    gradle --rerun-tasks --debug
and
    outputs.upToDateWhen { false }

but i suspect I want to mess with the inputs somehow?

Here's my task

https://gist.github.com/mtakacs/6252282


task grailsWar(type:Exec, dependsOn: [ initProject] ) {
    description = "launch the war process, work is done by grails"
    logger.debug "Task[$name]: configuration closure"
    outputs.upToDateWhen { false }

    ignoreExitValue false
    executable project.ext.grailsExe
    args "-Dgrails.env=${project.ext.buildEnv} war --non-interactive --plain-output --verbose --refresh-dependencies"
}

// Define a Task and pass it a configuration closure. Evaluated during configuration Phase
task productionWar(type:Copy, dependsOn: [ initProject, grailsWar ] ) {
    description = "take the contents of the build/ directory and produce a single archive/distribution file"
    logger.debug "Task[$name]: configuration closure"
    outputs.upToDateWhen { false }

    from('target') {
        include '**/*.war'
        rename 'output-(.*).war', project.ext.warName
    }
    destinationDir file(project.ext.artifactDir)

}
productionWar << {
    logger.debug "Task:[$name] -  execution closure"

}


and here's the log of the hash generation taking 9 minutes.


18:14:04 18:14:04.277 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@2dec8909, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@418c56d, org.gradle.logging.internal.JavaUtilLoggingConfigurer@76497934]
18:14:04 18:14:04.278 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache outputFileStates.bin (/var/lib/jenkins/workspace/BILLIT/billit/.gradle/1.7/taskArtifacts/outputFileStates.bin)
18:14:04 18:14:04.419 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileHashes.bin (/var/lib/jenkins/workspace/BILLIT/billit/.gradle/1.7/taskArtifacts/fileHashes.bin)
...
...
[ 9 minutes where fileHashes.bin grows and grows... ]
-rw-r--r-- 1 jenkins jenkins 23595 Aug 16 18:14 fileHashes.bin
....
-rw-r--r-- 1 jenkins jenkins 94181 Aug 16 18:21 fileHashes.bin
...
...
18:21:45 18:21:45.485 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':amazonWar'
18:21:45 18:21:45.486 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :productionWar (Thread[main,5,main]) - complete
18:21:45 18:21:45.486 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 9 mins 5.165 secs, idle: 0.016 secs
18:21:45 18:21:45.486 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskGraphExecuter] Timing: Executing the DAG took 9 mins 5.188 secs


I'd appreciate some guidance on how to either configure gradle or the task definition to not bother with this lengthy task.

-Mark
Reply | Threaded
Open this post in threaded view
|

Re: Can't disable generation of fileHashes.bin

Peter Niederwieser
This list is no longer active. Please use http://forums.gradle.org instead.