diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 3aef578..f474e81 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -16,21 +16,14 @@
 
 apply plugin: 'groovy'
 apply plugin: 'code-quality'
+apply plugin: 'idea'
 
 dependencies {
-    compile 'com.svnkit:svnkit:1.1.6', 'com.svnkit:svnkit-javahl:1.1.6', 'org.jfrog.buildinfo:build-info-extractor-gradle:1.0-SNAPSHOT'
     compile gradleApi()
-    // todo Actually it should be only groovy, but without junit we get a strange error. We need to understand this.
+    compile(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '1.0-SNAPSHOT')
     groovy localGroovy()
-    testCompile "junit:junit:4.7"
+    testCompile 'junit:junit:4.8.1@jar'
+    testCompile 'org.spockframework:spock-core:0.4-groovy-1.7@jar', 'cglib:cglib-nodep:2.2', 'org.objenesis:objenesis:1.2'
 }
 
-checkstyleConfigDir = "$rootDir/../config/checkstyle"
-checkstyleConfigFileName = new File(checkstyleConfigDir, 'checkstyle.xml')
-codeNarcConfigFileName = "$rootDir/../config/codenarc.xml"
-checkstyleProperties.checkstyleConfigDir = checkstyleConfigDir
-
-task ide(type: Sync) {
-    into file('lib')
-    from { configurations.testRuntime.files(DependencySpecs.type(Type.EXTERNAL)) }
-}
+apply from: '../gradle/codeQuality.gradle'
diff --git a/buildSrc/src/main/groovy/org/gradle/build/Install.groovy b/buildSrc/src/main/groovy/org/gradle/build/Install.groovy
index 8352798..24879e8 100644
--- a/buildSrc/src/main/groovy/org/gradle/build/Install.groovy
+++ b/buildSrc/src/main/groovy/org/gradle/build/Install.groovy
@@ -26,6 +26,8 @@ class Install extends Sync {
         addPropertyCheck()
         doLast {
             ant.chmod(file: "$installDir/bin/gradle", perm: 'ugo+x')
+            ant.chmod(file: "$installDir/bin/gradleDebug", perm: 'ugo+x')
+            ant.chmod(file: "$installDir/bin/gw", perm: 'ugo+x')
         }
     }
 
diff --git a/buildSrc/src/main/groovy/org/gradle/build/startscripts/StartScriptGenerator.groovy b/buildSrc/src/main/groovy/org/gradle/build/startscripts/StartScriptGenerator.groovy
index 939afee..56c69bc 100644
--- a/buildSrc/src/main/groovy/org/gradle/build/startscripts/StartScriptGenerator.groovy
+++ b/buildSrc/src/main/groovy/org/gradle/build/startscripts/StartScriptGenerator.groovy
@@ -55,5 +55,22 @@ class StartScriptsGenerator {
         writer.toString()
     }
 
+    static void generateExtraScripts(File binDir) {
+        String unixStartScriptHead = StartScriptsGenerator.getResourceAsStream('unixStartScriptHead.txt').text
+        String unixWharfScript = StartScriptsGenerator.getResourceAsStream('unixWharfScript.txt').text
+        String unixDebugScript = StartScriptsGenerator.getResourceAsStream('unixDebugScript.txt').text
+        String unixExecGradleScript = StartScriptsGenerator.getResourceAsStream('unixExecGradleScript.txt').text
+
+        new File(binDir, "gw").withWriter {writer ->
+            writer.write(unixStartScriptHead)
+            writer.write(unixWharfScript)
+            writer.write(unixExecGradleScript)
+        }
+        new File(binDir, "gradleDebug").withWriter {writer ->
+            writer.write(unixStartScriptHead)
+            writer.write(unixDebugScript)
+            writer.write(unixExecGradleScript)
+        }
+    }
 }
 
diff --git a/buildSrc/src/main/resources/org/gradle/build/startscripts/unixDebugScript.txt b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixDebugScript.txt
new file mode 100644
index 0000000..e7a15ea
--- /dev/null
+++ b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixDebugScript.txt
@@ -0,0 +1,15 @@
+
+if [ -z "$JDWP_GRADLE_PORT" ]; then
+    JDWP_GRADLE_PORT=5006
+fi
+
+hasJdwp=`echo "$GRADLE_OPTS" | egrep -i "Xdebug"`
+if [ -z "$hasJdwp" ]; then
+    GRADLE_OPTS="$GRADLE_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$JDWP_GRADLE_PORT"
+else
+    echo "GRADLE_OPTS already defined a JVM debug param: $GRADLE_OPTS"
+    echo "Cannot activate JVM Debugger"
+    exit 1
+fi
+
+export GRADLE_OPTS
diff --git a/buildSrc/src/main/resources/org/gradle/build/startscripts/unixExecGradleScript.txt b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixExecGradleScript.txt
new file mode 100644
index 0000000..6201226
--- /dev/null
+++ b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixExecGradleScript.txt
@@ -0,0 +1,6 @@
+
+if [ -z "$GRADLE_EXEC" ]; then
+    GRADLE_EXEC=gradle
+fi
+
+$GRADLE_HOME/bin/$GRADLE_EXEC "$@"
diff --git a/buildSrc/src/main/resources/org/gradle/build/startscripts/unixWharfScript.txt b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixWharfScript.txt
new file mode 100644
index 0000000..e031ebe
--- /dev/null
+++ b/buildSrc/src/main/resources/org/gradle/build/startscripts/unixWharfScript.txt
@@ -0,0 +1,20 @@
+GRADLE_EXEC="gradle --daemon --wharf"
+
+if [ "$1" = "--jdwp" ]; then
+    shift
+    GRADLE_EXEC="gradleDebug --wharf"
+fi
+
+if [ "$1" = "--jackson" ]; then
+    shift
+    hasWharfMarshaller=`echo "$GRADLE_OPTS" | egrep -i "wharf.marshallType"`
+    if [ -z "$hasWharfMarshaller" ]; then
+        GRADLE_OPTS="$GRADLE_OPTS -Dwharf.marshallType=jackson"
+    else
+        echo "GRADLE_OPTS already defined a wharf marshaller type: $GRADLE_OPTS"
+        echo "Cannot activate JAckson marshaller"
+        exit 1
+    fi
+fi
+
+export GRADLE_OPTS
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/StartParameter.java b/subprojects/gradle-core/src/main/groovy/org/gradle/StartParameter.java
index 96fd009..5f96cf8 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/StartParameter.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/StartParameter.java
@@ -79,6 +79,7 @@ public class StartParameter {
     private boolean noOpt;
     private boolean colorOutput = true;
     private boolean profile;
+    private boolean wharf;
 
     /**
      * Creates a {@code StartParameter} with default values. This is roughly equivalent to running Gradle on the
@@ -124,6 +125,7 @@ public class StartParameter {
         startParameter.dryRun = dryRun;
         startParameter.noOpt = noOpt;
         startParameter.profile = profile;
+        startParameter.wharf = wharf;
         return startParameter;
     }
 
@@ -284,6 +286,14 @@ public class StartParameter {
         buildExecuter = null;
     }
 
+    public void setWharf(boolean enabled) {
+        this.wharf = enabled;
+    }
+
+    public boolean isWharf() {
+        return wharf;
+    }
+
     /**
      * Returns the names of the tasks to be excluded from this build. When empty, no tasks are excluded from the build.
      *
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/ClientModuleResolver.java b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/ClientModuleResolver.java
index 9967819..975b170 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/ClientModuleResolver.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/ClientModuleResolver.java
@@ -103,24 +103,14 @@ public class ClientModuleResolver extends BasicResolver {
 
     private RepositoryCacheManager createUseOriginCacheManager(String name) {
         File tmpIvyCache = createTmpDir();
-        boolean useWharf = Boolean.getBoolean("useWharf");
-        RepositoryCacheManager result;
-        if (useWharf) {
-            WharfCacheManager cacheManager = new WharfCacheManager();
-            cacheManager.setBasedir(tmpIvyCache);
-            cacheManager.setName(name);
-            result = cacheManager;
-        } else {
-            DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
-            cacheManager.setBasedir(tmpIvyCache);
-            cacheManager.setName(name);
-            cacheManager.setUseOrigin(true);
-            cacheManager.setLockStrategy(new NoLockStrategy());
-            cacheManager.setIvyPattern(ResolverContainer.DEFAULT_CACHE_IVY_PATTERN);
-            cacheManager.setArtifactPattern(ResolverContainer.DEFAULT_CACHE_ARTIFACT_PATTERN);
-            result = cacheManager;
-        }
-        return result;
+        DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
+        cacheManager.setBasedir(tmpIvyCache);
+        cacheManager.setName(name);
+        cacheManager.setUseOrigin(true);
+        cacheManager.setLockStrategy(new NoLockStrategy());
+        cacheManager.setIvyPattern(ResolverContainer.DEFAULT_CACHE_IVY_PATTERN);
+        cacheManager.setArtifactPattern(ResolverContainer.DEFAULT_CACHE_ARTIFACT_PATTERN);
+        return cacheManager;
     }
 
     private File createTmpDir() {
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultResolverFactory.java b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultResolverFactory.java
index c683905..bc53830 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultResolverFactory.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultResolverFactory.java
@@ -24,6 +24,7 @@ import org.apache.ivy.plugins.resolver.DualResolver;
 import org.apache.ivy.plugins.resolver.FileSystemResolver;
 import org.apache.ivy.plugins.resolver.IBiblioResolver;
 import org.apache.ivy.plugins.resolver.URLResolver;
+import org.gradle.StartParameter;
 import org.gradle.api.InvalidUserDataException;
 import org.gradle.api.UncheckedIOException;
 import org.gradle.api.artifacts.ConfigurationContainer;
@@ -55,10 +56,12 @@ import java.util.Map;
  * @author Hans Dockter
  */
 public class DefaultResolverFactory implements ResolverFactory {
+    private final boolean useWharf;
     private final Factory<? extends LoggingManagerInternal> loggingManagerFactory;
 
-    public DefaultResolverFactory(Factory<? extends LoggingManagerInternal> loggingManagerFactory) {
+    public DefaultResolverFactory(Factory<? extends LoggingManagerInternal> loggingManagerFactory, boolean useWharf) {
         this.loggingManagerFactory = loggingManagerFactory;
+        this.useWharf = useWharf;
     }
 
     public DependencyResolver createResolver(Object userDescription) {
@@ -91,13 +94,7 @@ public class DefaultResolverFactory implements ResolverFactory {
 
     private RepositoryCacheManager createUseOriginCacheManager(String name) {
         File tmpIvyCache = createTmpDir();
-        boolean useWharf = Boolean.getBoolean("useWharf");
-        DefaultRepositoryCacheManager cacheManager;
-        if (useWharf) {
-            cacheManager = new DefaultRepositoryCacheManager();
-        } else {
-            cacheManager = new DefaultRepositoryCacheManager();
-        }
+        DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
         cacheManager.setBasedir(tmpIvyCache);
         cacheManager.setName(name);
         return cacheManager;
@@ -128,7 +125,6 @@ public class DefaultResolverFactory implements ResolverFactory {
     }
 
     private IBiblioResolver createIBiblioResolver(String name, String root) {
-        boolean useWharf = Boolean.getBoolean("useWharf");
         IBiblioResolver iBiblioResolver;
         if (useWharf) {
             iBiblioResolver = new GradleWharfResolver();
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultSettingsConverter.java b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultSettingsConverter.java
index aa96cd2..84d0cbf 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultSettingsConverter.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/DefaultSettingsConverter.java
@@ -49,12 +49,14 @@ public class DefaultSettingsConverter implements SettingsConverter {
     private static Logger logger = Logging.getLogger(DefaultSettingsConverter.class);
 
     private RepositoryCacheManager repositoryCacheManager;
+    private final boolean useWharf;
     private IvySettings ivySettings;
     private final ProgressLoggerFactory progressLoggerFactory;
     private final TransferListener transferListener = new ProgressLoggingTransferListener();
 
-    public DefaultSettingsConverter(ProgressLoggerFactory progressLoggerFactory) {
+    public DefaultSettingsConverter(ProgressLoggerFactory progressLoggerFactory, boolean useWharf) {
         this.progressLoggerFactory = progressLoggerFactory;
+        this.useWharf = useWharf;
     }
 
     private static String getLengthText(TransferEvent evt) {
@@ -157,7 +159,6 @@ public class DefaultSettingsConverter implements SettingsConverter {
         ivySettings.setDefaultCacheIvyPattern(ResolverContainer.DEFAULT_CACHE_IVY_PATTERN);
         ivySettings.setDefaultCacheArtifactPattern(ResolverContainer.DEFAULT_CACHE_ARTIFACT_PATTERN);
         ivySettings.setVariable("ivy.log.modules.in.use", "false");
-        boolean useWharf = Boolean.getBoolean("useWharf");
         if (useWharf) {
             setRepositoryCacheManager(ivySettings, initWharf(ivySettings, gradleUserHome));
         } else {
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/GradleIBiblioResolver.java b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/GradleIBiblioResolver.java
index 7f6218e..71f1929 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/GradleIBiblioResolver.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/artifacts/ivyservice/GradleIBiblioResolver.java
@@ -17,6 +17,7 @@ package org.gradle.api.internal.artifacts.ivyservice;
 
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.cache.DefaultRepositoryCacheManager;
+import org.apache.ivy.core.cache.RepositoryCacheManager;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
@@ -121,21 +122,24 @@ public class GradleIBiblioResolver extends IBiblioResolver {
     }
 
     private PropertiesFile getCacheProperties(DependencyDescriptor dd, ResolvedModuleRevision moduleRevision) {
-        boolean useWharf = Boolean.getBoolean("useWharf");
-        PropertiesFile props;
-        if (useWharf) {
-            WharfCacheManager cacheManager = (WharfCacheManager) getRepositoryCacheManager();
-            props = new PropertiesFile(new File(cacheManager.getRepositoryCacheRoot(),
+        RepositoryCacheManager repositoryCacheManager = getRepositoryCacheManager();
+        if (repositoryCacheManager == null) {
+            throw new NullPointerException("Repository cache manager cannot be null!");
+        }
+        if (repositoryCacheManager instanceof WharfCacheManager) {
+            WharfCacheManager cacheManager = (WharfCacheManager) repositoryCacheManager;
+            return  new PropertiesFile(new File(cacheManager.getRepositoryCacheRoot(),
                     IvyPatternHelper.substitute(DEFAULT_DATA_FILE_PATTERN, moduleRevision.getId())),
                     "ivy cached data file for " + dd.getDependencyRevisionId());
-        } else {
-            DefaultRepositoryCacheManager cacheManager = (DefaultRepositoryCacheManager) getRepositoryCacheManager();
-            props = new PropertiesFile(new File(cacheManager.getRepositoryCacheRoot(),
+        } else if (repositoryCacheManager instanceof DefaultRepositoryCacheManager) {
+            DefaultRepositoryCacheManager cacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
+            return  new PropertiesFile(new File(cacheManager.getRepositoryCacheRoot(),
                     IvyPatternHelper.substitute(DEFAULT_DATA_FILE_PATTERN, moduleRevision.getId())),
                     "ivy cached data file for " + dd.getDependencyRevisionId());
+        } else {
+            // Error message cache unsupported
+            throw new IllegalStateException("Cache " + repositoryCacheManager.getClass().getName()+" is unsupported");
         }
-
-        return props;
     }
 
     public interface CacheTimeoutStrategy {
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/project/TopLevelBuildServiceRegistry.java b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/project/TopLevelBuildServiceRegistry.java
index 1574849..03415b3 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/project/TopLevelBuildServiceRegistry.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/api/internal/project/TopLevelBuildServiceRegistry.java
@@ -195,7 +195,7 @@ public class TopLevelBuildServiceRegistry extends DefaultServiceRegistry impleme
     protected Factory<RepositoryHandler> createRepositoryHandlerFactory() {
         return new DefaultRepositoryHandlerFactory(
                 new DefaultResolverFactory(
-                        getFactory(LoggingManagerInternal.class)),
+                        getFactory(LoggingManagerInternal.class), startParameter.isWharf()),
                 get(ClassGenerator.class));
     }
 
@@ -264,8 +264,8 @@ public class TopLevelBuildServiceRegistry extends DefaultServiceRegistry impleme
 
         return new DefaultConfigurationContainerFactory(clientModuleRegistry,
                 new DefaultSettingsConverter(
-                        get(ProgressLoggerFactory.class)
-                ),
+                        get(ProgressLoggerFactory.class),
+                        startParameter.isWharf()),
                 get(PublishModuleDescriptorConverter.class),
                 get(PublishModuleDescriptorConverter.class),
                 fileModuleDescriptorConverter,
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/initialization/DefaultCommandLineConverter.java b/subprojects/gradle-core/src/main/groovy/org/gradle/initialization/DefaultCommandLineConverter.java
index 1b638bd..ddd286e 100644
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/initialization/DefaultCommandLineConverter.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/initialization/DefaultCommandLineConverter.java
@@ -59,6 +59,7 @@ public class DefaultCommandLineConverter extends AbstractCommandLineConverter<St
     private static final String NO_OPT = "no-opt";
     private static final String EXCLUDE_TASK = "x";
     private static final String PROFILE = "profile";
+    private static final String WHARF = "wharf";
 
     private static BiMap<String, StartParameter.ShowStacktrace> showStacktraceMap = HashBiMap.create();
     private final CommandLineConverter<LoggingConfiguration> loggingConfigurationCommandLineConverter = new LoggingCommandLineConverter();
@@ -96,6 +97,7 @@ public class DefaultCommandLineConverter extends AbstractCommandLineConverter<St
         parser.option(NO_OPT).hasDescription("Ignore any task optimization.");
         parser.option(EXCLUDE_TASK, "exclude-task").hasArguments().hasDescription("Specify a task to be excluded from execution.");
         parser.option(PROFILE).hasDescription("Profiles build execution time and generates a report in the <build_dir>/reports/profile directory.");
+        parser.option(WHARF).hasDescription("Use Wharf cache manager.");
     }
 
     @Override
@@ -206,6 +208,10 @@ public class DefaultCommandLineConverter extends AbstractCommandLineConverter<St
             startParameter.setProfile(true);
         }
 
+        if (options.hasOption(WHARF)) {
+            startParameter.setWharf(true);
+        }
+
         return startParameter;
     }
 
diff --git a/subprojects/gradle-docs/docs.gradle b/subprojects/gradle-docs/docs.gradle
index d289806..c58facd 100644
--- a/subprojects/gradle-docs/docs.gradle
+++ b/subprojects/gradle-docs/docs.gradle
@@ -17,6 +17,7 @@
 import org.gradle.build.docs.UserGuideTransformTask
 import org.gradle.build.docs.ExtractSnippetsTask
 import org.gradle.build.docs.AssembleSamplesDocTask
+import org.gradle.build.docs.dsl.AssembleDslDocTask
 import org.gradle.build.docs.dsl.ExtractDslMetaDataTask
 import org.jfrog.build.extractor.gradle.BuildInfoRecorderTask
 
diff --git a/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/IdeaModule.groovy b/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/IdeaModule.groovy
index 8a3a078..9100d0a 100644
--- a/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/IdeaModule.groovy
+++ b/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/IdeaModule.groovy
@@ -175,7 +175,7 @@ public class IdeaModule extends XmlGeneratorTask<Module> {
             List moduleLibraries = resolvedConfiguration.getFiles(Specs.SATISFIES_ALL).collect { File binaryFile ->
                 File sourceFile = sourceFiles[binaryFile.name]
                 File javadocFile = javadocFiles[binaryFile.name]
-                new ModuleLibrary([getPath(binaryFile)] as Set, javadocFile ? [getPath(javadocFile)] as Set : [] as Set, sourceFile ? [getPath(sourceFile)] as Set : [] as Set, [] as Set, scope)
+                new ModuleLibrary([getCachePath(binaryFile)] as Set, javadocFile ? [getCachePath(javadocFile)] as Set : [] as Set, sourceFile ? [getCachePath(sourceFile)] as Set : [] as Set, [] as Set, scope)
             }
             moduleLibraries.addAll(getSelfResolvingFiles(getScopeDependencies(scopes[scope],
                     { it instanceof SelfResolvingDependency && !(it instanceof ProjectDependency)}), scope))
@@ -187,7 +187,7 @@ public class IdeaModule extends XmlGeneratorTask<Module> {
     private def getSelfResolvingFiles(Collection dependencies, String scope) {
         dependencies.inject([] as LinkedHashSet) { result, SelfResolvingDependency selfResolvingDependency ->
             result.addAll(selfResolvingDependency.resolve().collect { File file ->
-                new ModuleLibrary([getPath(file)] as Set, [] as Set, [] as Set, [] as Set, scope)
+                new ModuleLibrary([getCachePath(file)] as Set, [] as Set, [] as Set, [] as Set, scope)
             })
             result
         }
@@ -267,6 +267,10 @@ public class IdeaModule extends XmlGeneratorTask<Module> {
         return pathFactory.path(file)
     }
 
+    protected Path getCachePath(File file) {
+        return pathFactory.cachePath(file)
+    }
+
     protected PathFactory getPathFactory() {
         PathFactory factory = new PathFactory()
         factory.addPathVariable('MODULE_DIR', getOutputFile().parentFile)
diff --git a/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/model/PathFactory.groovy b/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/model/PathFactory.groovy
index 59582f8..7f75e0e 100644
--- a/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/model/PathFactory.groovy
+++ b/subprojects/gradle-idea/src/main/groovy/org/gradle/plugins/idea/model/PathFactory.groovy
@@ -31,6 +31,10 @@ class PathFactory {
         createFile(file.canonicalFile)
     }
 
+    Path cachePath(File file) {
+        createFile(file.absoluteFile)
+    }
+
     private Path createFile(File file) {
         Map match = null
         for (variable in variables) {
diff --git a/subprojects/gradle-launcher/launcher.gradle b/subprojects/gradle-launcher/launcher.gradle
index 23ddf02..a90a0fe 100644
--- a/subprojects/gradle-launcher/launcher.gradle
+++ b/subprojects/gradle-launcher/launcher.gradle
@@ -20,6 +20,7 @@ jar.doFirst {
 task startScripts << {
     ant.mkdir(dir: startScriptsDir)
     StartScriptsGenerator.generate(jar.archiveName, startScriptsDir, 'gradle')
+    StartScriptsGenerator.generateExtraScripts(startScriptsDir)
 }
 
 ideaModule {
