Just in-case anyone finds these useful, here are a couple tasks we use while
this snapshot problem exist, still got loads of problems with it but it
makes life a tiny bit easier.

We've got this helper task which we use to manually clean up our cache
artifacts:

task nukeCache <<{
    def cacheRoot = new File(project.gradle.gradleUserHomeDir, "cache")
    
    def groupDir = new File(cacheRoot, "com.our.group")
    
    def nukeDirs = []
    if(project.hasProperty('prefix')){
        
        groupDir.eachDir{ file ->
            if(file.name.startsWith(prefix)){
                nukeDirs << file
            }
        }
    }
    else{
        nukeDirs << groupDir
    }
    
    nukeDirs.each{
        println it.absolutePath
    }
    
    boolean doDelete = false
    if(project.hasProperty('force')){
        doDelete = true
    }
    else{
        String txt = System.console().readLine("Sure you want to delete the
above directories?(y/n):")
        if(txt.equalsIgnoreCase('y')){
            doDelete = true
        }
    }
    
    if(doDelete){
        nukeDirs.each{
            boolean status = it.deleteDir()
            println "${status ? 'Deleted':'Error not deleted'} -
$it.absolutePath" 
        }
    }
}


And we also have this little snippet which we use to clear the cache when we
call an installArchives task which installs to a localhost repo.

subProject.task('deleteArtifactDirInGradleCache')<<{
    def cacheRoot = new File(subProject.gradle.gradleUserHomeDir, "cache")
    def groupDir = new File(cacheRoot, subProject.group)
    def artifactDir = new File(groupDir, subProject.name)

    if(artifactDir.exists()){
        println "Deleting gradle cache dir ${artifactDir.absolutePath}"
        boolean status = artifactDir.deleteDir()

        if(!status){
            println "COULDN'T Delete the artifact dir!!!!"
        }
    }
    else{
        println "Artifact dir doesn't exist ${artifactDir.absolutePath}??"
    }
}


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Snapshots-not-being-updated-tp3412601p3865667.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to