// If we were not the most recent version of Gradle to build the buildSrc dir, then do a clean build
// Otherwise, just to a regular build
final PersistentCache buildSrcCache = createCache(startParameter);
try {
GradleLauncher gradleLauncher = buildGradleLauncher(startParameter);
try {
return buildSrcCache.useCache("rebuild buildSrc", new BuildSrcUpdateFactory(buildSrcCache, gradleLauncher, new BuildSrcBuildListenerFactory()));
} finally {
gradleLauncher.stop();
}
} finally {
// This isn't quite right. We should not unlock the classes until we're finished with them, and the classes may be used across multiple builds
buildSrcCache.close();
}