當前位置: 首頁>>代碼示例>>Java>>正文


Java Distribution類代碼示例

本文整理匯總了Java中org.gradle.tooling.internal.consumer.Distribution的典型用法代碼示例。如果您正苦於以下問題:Java Distribution類的具體用法?Java Distribution怎麽用?Java Distribution使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Distribution類屬於org.gradle.tooling.internal.consumer包,在下文中一共展示了Distribution類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
    if (lock.tryLock()) {
        try {
            return delegate.create(distribution, progressLoggerFactory, connectionParameters, cancellationToken);
        } finally {
            lock.unlock();
        }
    }
    ProgressLogger logger = progressLoggerFactory.newOperation(SynchronizedToolingImplementationLoader.class);
    logger.setDescription("Wait for the other thread to finish acquiring the distribution");
    logger.started();
    lock.lock();
    try {
        return delegate.create(distribution, progressLoggerFactory, connectionParameters, cancellationToken);
    } finally {
        lock.unlock();
        logger.completed();
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:20,代碼來源:SynchronizedToolingImplementationLoader.java

示例2: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters) {
    if (lock.tryLock()) {
        try {
            return delegate.create(distribution, progressLoggerFactory, connectionParameters);
        } finally {
            lock.unlock();
        }
    }
    ProgressLogger logger = progressLoggerFactory.newOperation(SynchronizedToolingImplementationLoader.class);
    logger.setDescription("Wait for the other thread to finish acquiring the distribution");
    logger.started();
    lock.lock();
    try {
        return delegate.create(distribution, progressLoggerFactory, connectionParameters);
    } finally {
        lock.unlock();
        logger.completed();
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:20,代碼來源:SynchronizedToolingImplementationLoader.java

示例3: createImplementationClassLoader

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
private ClassLoader createImplementationClassLoader(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, File userHomeDir, BuildCancellationToken cancellationToken) {
    ClassPath implementationClasspath = distribution.getToolingImplementationClasspath(progressLoggerFactory, userHomeDir, cancellationToken);
    LOGGER.debug("Using tooling provider classpath: {}", implementationClasspath);
    FilteringClassLoader.Spec filterSpec = new FilteringClassLoader.Spec();
    filterSpec.allowPackage("org.gradle.tooling.internal.protocol");
    FilteringClassLoader filteringClassLoader = new FilteringClassLoader(classLoader, filterSpec);
    return new VisitableURLClassLoader(filteringClassLoader, implementationClasspath);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:9,代碼來源:DefaultToolingImplementationLoader.java

示例4: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
    ClassPath classpath = distribution.getToolingImplementationClasspath(progressLoggerFactory, connectionParameters.getGradleUserHomeDir(), cancellationToken);

    ConsumerConnection connection = connections.get(classpath);
    if (connection == null) {
        connection = loader.create(distribution, progressLoggerFactory, connectionParameters, cancellationToken);
        connections.put(classpath, connection);
    }

    return connection;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:12,代碼來源:CachingToolingImplementationLoader.java

示例5: getWrappedDistribution

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
/**
 * Returns the default distribution to use for the specified project.
 */
public Distribution getWrappedDistribution(File propertiesFile) {
  //noinspection UseOfSystemOutOrSystemErr
  WrapperExecutor wrapper = WrapperExecutor.forWrapperPropertiesFile(propertiesFile, System.out);
  if (wrapper.getDistribution() != null) {
    return new ZippedDistribution(wrapper.getConfiguration(), myExecutorFactory);
  }
  return getDownloadedDistribution(GradleVersion.current().getVersion());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DistributionFactoryExt.java

示例6: createImplementationClassLoader

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
private ClassLoader createImplementationClassLoader(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, File userHomeDir, BuildCancellationToken cancellationToken) {
    ClassPath implementationClasspath = distribution.getToolingImplementationClasspath(progressLoggerFactory, userHomeDir, cancellationToken);
    LOGGER.debug("Using tooling provider classpath: {}", implementationClasspath);
    // On IBM JVM 5, ClassLoader.getResources() uses a combination of findResources() and getParent() and traverses the hierarchy rather than just calling getResources()
    // Wrap our real classloader in one that hides the parent.
    // TODO - move this into FilteringClassLoader
    MultiParentClassLoader parentObfuscatingClassLoader = new MultiParentClassLoader(classLoader);
    FilteringClassLoader filteringClassLoader = new FilteringClassLoader(parentObfuscatingClassLoader);
    filteringClassLoader.allowPackage("org.gradle.tooling.internal.protocol");
    return new MutableURLClassLoader(filteringClassLoader, implementationClasspath.getAsURLArray());
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:12,代碼來源:DefaultToolingImplementationLoader.java

示例7: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters) {
    LOGGER.debug("Using tooling provider from {}", distribution.getDisplayName());
    ClassLoader classLoader = createImplementationClassLoader(distribution, progressLoggerFactory, connectionParameters.getGradleUserHomeDir());
    ServiceLocator serviceLocator = new ServiceLocator(classLoader);
    try {
        Factory<ConnectionVersion4> factory = serviceLocator.findFactory(ConnectionVersion4.class);
        if (factory == null) {
            return new NoToolingApiConnection(distribution);
        }
        // ConnectionVersion4 is a part of the protocol and cannot be easily changed.
        ConnectionVersion4 connection = factory.create();

        ProtocolToModelAdapter adapter = new ProtocolToModelAdapter(new ConsumerTargetTypeProvider());
        ModelMapping modelMapping = new ModelMapping();

        // Adopting the connection to a refactoring friendly type that the consumer owns
        AbstractConsumerConnection adaptedConnection;
        if (connection instanceof ModelBuilder && connection instanceof InternalBuildActionExecutor) {
            adaptedConnection = new ActionAwareConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof ModelBuilder) {
            adaptedConnection = new ModelBuilderBackedConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof BuildActionRunner) {
            adaptedConnection = new BuildActionRunnerBackedConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof InternalConnection) {
            adaptedConnection = new InternalConnectionBackedConsumerConnection(connection, modelMapping, adapter);
        } else {
            adaptedConnection = new ConnectionVersion4BackedConsumerConnection(connection, modelMapping, adapter);
        }
        adaptedConnection.configure(connectionParameters);
        return adaptedConnection;
    } catch (UnsupportedVersionException e) {
        throw e;
    } catch (Throwable t) {
        throw new GradleConnectionException(String.format("Could not create an instance of Tooling API implementation using the specified %s.", distribution.getDisplayName()), t);
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:37,代碼來源:DefaultToolingImplementationLoader.java

示例8: createImplementationClassLoader

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
private ClassLoader createImplementationClassLoader(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, File userHomeDir) {
    ClassPath implementationClasspath = distribution.getToolingImplementationClasspath(progressLoggerFactory, userHomeDir);
    LOGGER.debug("Using tooling provider classpath: {}", implementationClasspath);
    // On IBM JVM 5, ClassLoader.getResources() uses a combination of findResources() and getParent() and traverses the hierarchy rather than just calling getResources()
    // Wrap our real classloader in one that hides the parent.
    // TODO - move this into FilteringClassLoader
    MultiParentClassLoader parentObfuscatingClassLoader = new MultiParentClassLoader(classLoader);
    FilteringClassLoader filteringClassLoader = new FilteringClassLoader(parentObfuscatingClassLoader);
    filteringClassLoader.allowPackage("org.gradle.tooling.internal.protocol");
    return new MutableURLClassLoader(filteringClassLoader, implementationClasspath.getAsURLArray());
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:12,代碼來源:DefaultToolingImplementationLoader.java

示例9: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters) {
    ClassPath classpath = distribution.getToolingImplementationClasspath(progressLoggerFactory, connectionParameters.getGradleUserHomeDir());

    ConsumerConnection connection = connections.get(classpath);
    if (connection == null) {
        connection = loader.create(distribution, progressLoggerFactory, connectionParameters);
        connections.put(classpath, connection);
    }

    return connection;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:12,代碼來源:CachingToolingImplementationLoader.java

示例10: unsupportedFeature

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public static UnsupportedVersionException unsupportedFeature(String feature, Distribution distro, String versionAdded) {
    return new UnsupportedVersionException(String.format("The version of Gradle you are using (%s) does not support the %s. Support for this is available in Gradle %s and all later versions.",
            distro.getDisplayName(), feature, versionAdded));
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:5,代碼來源:Exceptions.java

示例11: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
    LOGGER.debug("Using tooling provider from {}", distribution.getDisplayName());
    ClassLoader serviceClassLoader = createImplementationClassLoader(distribution, progressLoggerFactory, connectionParameters.getGradleUserHomeDir(), cancellationToken);
    ServiceLocator serviceLocator = new DefaultServiceLocator(serviceClassLoader);
    try {
        Factory<ConnectionVersion4> factory = serviceLocator.findFactory(ConnectionVersion4.class);
        if (factory == null) {
            return new NoToolingApiConnection(distribution);
        }
        // ConnectionVersion4 is a part of the protocol and cannot be easily changed.
        ConnectionVersion4 connection = factory.create();

        ProtocolToModelAdapter adapter = new ProtocolToModelAdapter(new ConsumerTargetTypeProvider());
        ModelMapping modelMapping = new ModelMapping();

        // Adopting the connection to a refactoring friendly type that the consumer owns
        AbstractConsumerConnection adaptedConnection;
        if (connection instanceof InternalTestExecutionConnection){
            adaptedConnection = new TestExecutionConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof StoppableConnection) {
            adaptedConnection = new ShutdownAwareConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof InternalCancellableConnection) {
            adaptedConnection = new CancellableConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof ModelBuilder && connection instanceof InternalBuildActionExecutor) {
            adaptedConnection = new ActionAwareConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof ModelBuilder) {
            adaptedConnection = new ModelBuilderBackedConsumerConnection(connection, modelMapping, adapter);
        } else if (connection instanceof BuildActionRunner) {
            adaptedConnection = new BuildActionRunnerBackedConsumerConnection(connection, modelMapping, adapter);
        } else {
            return new UnsupportedOlderVersionConnection(connection, adapter);
        }
        adaptedConnection.configure(connectionParameters);
        if (!adaptedConnection.getVersionDetails().supportsCancellation()) {
            return new NonCancellableConsumerConnectionAdapter(adaptedConnection);
        }
        return adaptedConnection;
    } catch (UnsupportedVersionException e) {
        throw e;
    } catch (Throwable t) {
        throw new GradleConnectionException(String.format("Could not create an instance of Tooling API implementation using the specified %s.", distribution.getDisplayName()), t);
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:44,代碼來源:DefaultToolingImplementationLoader.java

示例12: create

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory,
ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken);
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:3,代碼來源:ToolingImplementationLoader.java

示例13: LazyConsumerActionExecutor

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public LazyConsumerActionExecutor(Distribution distribution, ToolingImplementationLoader implementationLoader, LoggingProvider loggingProvider, ConnectionParameters connectionParameters) {
    this.distribution = distribution;
    this.implementationLoader = implementationLoader;
    this.loggingProvider = loggingProvider;
    this.connectionParameters = connectionParameters;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:7,代碼來源:LazyConsumerActionExecutor.java

示例14: NoToolingApiConnection

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
public NoToolingApiConnection(Distribution distribution) {
    this.distribution = distribution;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:4,代碼來源:NoToolingApiConnection.java

示例15: getDownloadedDistribution

import org.gradle.tooling.internal.consumer.Distribution; //導入依賴的package包/類
private Distribution getDownloadedDistribution(String gradleVersion) {
  URI distUri = new DistributionLocator().getDistributionFor(GradleVersion.version(gradleVersion));
  return getDistribution(distUri);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:DistributionFactoryExt.java


注:本文中的org.gradle.tooling.internal.consumer.Distribution類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。