本文整理匯總了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));
}
示例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;
}
示例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);
}