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


Java Configuration.extendsFrom方法代碼示例

本文整理匯總了Java中org.gradle.api.artifacts.Configuration.extendsFrom方法的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.extendsFrom方法的具體用法?Java Configuration.extendsFrom怎麽用?Java Configuration.extendsFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.api.artifacts.Configuration的用法示例。


在下文中一共展示了Configuration.extendsFrom方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: defineConfigurationsForSourceSet

import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private void defineConfigurationsForSourceSet(SourceSet sourceSet, ConfigurationContainer configurations) {
    Configuration compileConfiguration = configurations.maybeCreate(sourceSet.getCompileConfigurationName());
    compileConfiguration.setVisible(false);
    compileConfiguration.setDescription("Dependencies for " + sourceSet + ".");

    Configuration runtimeConfiguration = configurations.maybeCreate(sourceSet.getRuntimeConfigurationName());
    runtimeConfiguration.setVisible(false);
    runtimeConfiguration.extendsFrom(compileConfiguration);
    runtimeConfiguration.setDescription("Runtime dependencies for " + sourceSet + ".");

    Configuration compileOnlyConfiguration = configurations.maybeCreate(sourceSet.getCompileOnlyConfigurationName());
    compileOnlyConfiguration.setVisible(false);
    compileOnlyConfiguration.extendsFrom(compileConfiguration);
    compileOnlyConfiguration.setDescription("Compile dependencies for " + sourceSet + ".");

    Configuration compileClasspathConfiguration = configurations.maybeCreate(sourceSet.getCompileClasspathConfigurationName());
    compileClasspathConfiguration.setVisible(false);
    compileClasspathConfiguration.extendsFrom(compileOnlyConfiguration);
    compileClasspathConfiguration.setDescription("Compile classpath for " + sourceSet + ".");

    sourceSet.setCompileClasspath(compileClasspathConfiguration);
    sourceSet.setRuntimeClasspath(sourceSet.getOutput().plus(runtimeConfiguration));
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:24,代碼來源:JavaBasePlugin.java

示例2: doAdd

import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
private Dependency doAdd(Configuration configuration, Object dependencyNotation, Closure configureClosure) {
    if (dependencyNotation instanceof Configuration) {
        Configuration other = (Configuration) dependencyNotation;
        if (!configurationContainer.contains(other)) {
            throw new UnsupportedOperationException("Currently you can only declare dependencies on configurations from the same project.");
        }
        configuration.extendsFrom(other);
        return null;
    }

    Dependency dependency = create(dependencyNotation, configureClosure);
    configuration.getDependencies().add(dependency);
    return dependency;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:15,代碼來源:DefaultDependencyHandler.java

示例3: configureConfigurations

import org.gradle.api.artifacts.Configuration; //導入方法依賴的package包/類
void configureConfigurations(Project project) {
    ConfigurationContainer configurations = project.getConfigurations();
    Configuration compileConfiguration = configurations.getByName(COMPILE_CONFIGURATION_NAME);
    Configuration runtimeConfiguration = configurations.getByName(RUNTIME_CONFIGURATION_NAME);

    Configuration compileTestsConfiguration = configurations.getByName(TEST_COMPILE_CONFIGURATION_NAME);
    compileTestsConfiguration.extendsFrom(compileConfiguration);

    configurations.getByName(TEST_RUNTIME_CONFIGURATION_NAME).extendsFrom(runtimeConfiguration, compileTestsConfiguration);

    configurations.getByName(Dependency.DEFAULT_CONFIGURATION).extendsFrom(runtimeConfiguration);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:13,代碼來源:JavaPlugin.java


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