views:

61

answers:

1

Dear All:

I would like Grade/Ivy to use cached versions of my jars, as it takes ~20 seconds to check every time for updates.

Is this possible?

Thank you Misha

A: 

Here, as always, is my hack-ey solution:

deps.sh

#!/bin/bash
if [ -d lib ]; then
   rm -rf lib
fi
mkdir lib

cd lib
NAMES=`find ~/.gradle/cache -name \*.jar`
for NAME in $NAMES; do
   ln -s $NAME .
done

and my build.gradle becomes

apply plugin: 'groovy'

/*
repositories {
   mavenCentral()
}
*/

dependencies {
  /*
  groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.0'
  groovy group: 'org.hibernate', name: 'hibernate-core', version: '3.3.2.GA'
  groovy group: 'org.hibernate', name: 'hibernate-annotations', version: '3.4.0.GA'
  groovy group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.6.0'
  groovy group: 'org.jasypt', name: 'jasypt', version: '1.6'
  groovy group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version:     '0.5.0'
  groovy group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.7'
  testCompile group: 'junit', name: 'junit', version: '4.7'  
  */
  groovy fileTree(dir: 'lib', include: '*.jar')
}
Misha Koshelev
Someone had a better suggestion on gradle-users instead of my deps.sh I can use:task copyToLib(type: Copy) { into "lib" from configurations.runtime}from http://communitymapbuilder.org/display/GRADLE/CookbookThank you toHelmut Dank from gradle users mailing list!
Misha Koshelev