use of org.gradle.internal.classpath.ClassPath in project gradle by gradle.
the class FinalizerThread method run.
public void run() {
try {
while (!stopped.get()) {
Cleanup entry = (Cleanup) referenceQueue.remove();
ClassPath key = entry.getKey();
removeCacheEntry(key, entry, DONT_CLOSE_CLASSLOADER);
}
} catch (InterruptedException ex) {
LOG.debug("Shutdown of classloader cache in progress");
}
}
use of org.gradle.internal.classpath.ClassPath in project gradle by gradle.
the class CachingToolingImplementationLoader method create.
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, InternalBuildProgressListener progressListener, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
ClassPath classpath = distribution.getToolingImplementationClasspath(progressLoggerFactory, progressListener, connectionParameters.getGradleUserHomeDir(), cancellationToken);
ConsumerConnection connection = connections.get(classpath);
if (connection == null) {
connection = loader.create(distribution, progressLoggerFactory, progressListener, connectionParameters, cancellationToken);
connections.put(classpath, connection);
}
return connection;
}
use of org.gradle.internal.classpath.ClassPath in project gradle by gradle.
the class ValidateTaskProperties method validateTaskClasses.
@TaskAction
public void validateTaskClasses() throws IOException {
ClassLoader previousContextClassLoader = Thread.currentThread().getContextClassLoader();
ClassPath classPath = new DefaultClassPath(Iterables.concat(Collections.singleton(getClassesDir()), getClasspath()));
ClassLoader classLoader = getClassLoaderFactory().createIsolatedClassLoader(classPath);
Thread.currentThread().setContextClassLoader(classLoader);
try {
validateTaskClasses(classLoader);
} finally {
Thread.currentThread().setContextClassLoader(previousContextClassLoader);
ClassLoaderUtils.tryClose(classLoader);
}
}
use of org.gradle.internal.classpath.ClassPath in project gradle by gradle.
the class DefaultPluginRequestApplicator method defineScriptHandlerClassScope.
private void defineScriptHandlerClassScope(ScriptHandlerInternal scriptHandler, ClassLoaderScope classLoaderScope, Iterable<PluginImplementation<?>> pluginsFromOtherLoaders) {
ClassPath classPath = scriptHandler.getScriptClassPath();
ClassPath cachedJarClassPath = cachedClasspathTransformer.transform(classPath);
classLoaderScope.export(cachedJarClassPath);
for (PluginImplementation<?> pluginImplementation : pluginsFromOtherLoaders) {
classLoaderScope.export(pluginImplementation.asClass().getClassLoader());
}
classLoaderScope.lock();
}
use of org.gradle.internal.classpath.ClassPath in project gradle by gradle.
the class ClassPathPluginResolution method execute.
@Override
public void execute(PluginResolveContext pluginResolveContext) {
ClassPath classPath = classPathFactory.create();
ClassLoaderScope loaderScope = parent.createChild("plugin-" + pluginId.getId());
loaderScope.local(classPath);
loaderScope.lock();
PluginRegistry pluginRegistry = new DefaultPluginRegistry(pluginInspector, loaderScope);
PluginImplementation<?> plugin = pluginRegistry.lookup(pluginId);
if (plugin == null) {
throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");
}
pluginResolveContext.add(plugin);
}
Aggregations