本文整理匯總了Java中org.gradle.api.Project.getConfigurations方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getConfigurations方法的具體用法?Java Project.getConfigurations怎麽用?Java Project.getConfigurations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.Project
的用法示例。
在下文中一共展示了Project.getConfigurations方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureConfigurations
import org.gradle.api.Project; //導入方法依賴的package包/類
private void configureConfigurations(final Project project) {
ConfigurationContainer configurations = project.getConfigurations();
project.setProperty("status", "integration");
Configuration archivesConfiguration = configurations.maybeCreate(Dependency.ARCHIVES_CONFIGURATION).
setDescription("Configuration for archive artifacts.");
configurations.maybeCreate(Dependency.DEFAULT_CONFIGURATION).
setDescription("Configuration for default artifacts.");
final DefaultArtifactPublicationSet defaultArtifacts = project.getExtensions().create(
"defaultArtifacts", DefaultArtifactPublicationSet.class, archivesConfiguration.getArtifacts()
);
configurations.all(new Action<Configuration>() {
public void execute(Configuration configuration) {
configuration.getArtifacts().all(new Action<PublishArtifact>() {
public void execute(PublishArtifact artifact) {
defaultArtifacts.addCandidate(artifact);
}
});
}
});
}
示例2: configureConfigurations
import org.gradle.api.Project; //導入方法依賴的package包/類
private void configureConfigurations(final Project project) {
ConfigurationContainer configurations = project.getConfigurations();
Configuration moduleConfiguration = configurations.create(DEPLOY_CONFIGURATION_NAME).setVisible(false)
.setTransitive(false).setDescription("Classpath for deployable modules, not transitive.");
Configuration earlibConfiguration = configurations.create(EARLIB_CONFIGURATION_NAME).setVisible(false)
.setDescription("Classpath for module dependencies.");
configurations.getByName(Dependency.DEFAULT_CONFIGURATION)
.extendsFrom(moduleConfiguration, earlibConfiguration);
}
示例3: createConfigurations
import org.gradle.api.Project; //導入方法依賴的package包/類
private List<Map> createConfigurations(Project project) {
Iterable<Configuration> configurations = project.getConfigurations();
return CollectionUtils.collect(configurations, new Transformer<Map, Configuration>() {
@Override
public Map transform(Configuration configuration) {
LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(4);
map.put("name", configuration.getName());
map.put("description", configuration.getDescription());
map.put("dependencies", createDependencies(configuration));
map.put("moduleInsights", createModuleInsights(configuration));
return map;
}
});
}
示例4: configureConfigurations
import org.gradle.api.Project; //導入方法依賴的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);
}