本文整理汇总了Java中org.apache.ivy.core.module.descriptor.ModuleDescriptor.getConfigurationsNames方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleDescriptor.getConfigurationsNames方法的具体用法?Java ModuleDescriptor.getConfigurationsNames怎么用?Java ModuleDescriptor.getConfigurationsNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.ModuleDescriptor
的用法示例。
在下文中一共展示了ModuleDescriptor.getConfigurationsNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfs
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private static String getConfs(ModuleDescriptor md, Artifact artifact) {
StringBuilder ret = new StringBuilder();
for (String conf : md.getConfigurationsNames()) {
if (Arrays.asList(md.getArtifacts(conf)).contains(artifact)) {
ret.append(conf).append(",");
}
}
if (ret.length() > 0) {
ret.setLength(ret.length() - 1);
}
return ret.toString();
}
示例2: findFirstArtifactRef
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
protected ResolvedResource findFirstArtifactRef(ModuleDescriptor md, DependencyDescriptor dd,
ResolveData data) {
for (String configName : md.getConfigurationsNames()) {
for (Artifact artifact : md.getArtifacts(configName)) {
ResolvedResource ret = getArtifactRef(artifact, data.getDate());
if (ret != null) {
return ret;
}
}
}
return null;
}
示例3: testPublishNotAllConfigs
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testPublishNotAllConfigs() throws IOException, ParseException {
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-multiconf.xml");
IvyResolve res = new IvyResolve();
res.setProject(project);
res.execute();
publish.setPubrevision("1.2");
publish.setResolver("1");
publish.setConf("compile");
publish.setUpdate(true);
File art = new File("build/test/publish/resolve-simple-1.2.jar");
FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);
publish.execute();
// should have do the ivy delivering
assertTrue(new File("build/test/publish/ivy-1.2.xml").exists());
// should have published the files with "1" resolver
assertTrue(new File("test/repositories/1/apache/resolve-simple/ivys/ivy-1.2.xml").exists());
assertTrue(new File("test/repositories/1/apache/resolve-simple/jars/resolve-simple-1.2.jar")
.exists());
// should have updated published ivy version
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(
new IvySettings(),
new File("test/repositories/1/apache/resolve-simple/ivys/ivy-1.2.xml").toURI().toURL(),
false);
assertEquals("1.2", md.getModuleRevisionId().getRevision());
// should only contain the default configuration
String[] configs = md.getConfigurationsNames();
assertEquals("Number of configurations not correct", 1, configs.length);
assertEquals("Compile configuration not present", "compile", configs[0]);
}
示例4: computeConfs
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private void computeConfs(List<String> confInput, ModuleDescriptor md) {
Set<String> configurations = new HashSet<>();
configurations.addAll(confInput);
if (configurations.contains("*")) {
confs = md.getConfigurationsNames();
} else {
confs = configurations.toArray(new String[configurations.size()]);
}
}
示例5: getConfsToResolve
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private String[] getConfsToResolve(ModuleDescriptor reference, String conf, String[] rconfs) {
Message.debug("calculating configurations to resolve");
if (reference == null) {
Message.debug("module not yet resolved, all confs still need to be resolved");
if (conf == null) {
return new String[] {"*"};
}
return splitToArray(conf);
}
if (conf == null) {
Message.debug("module already resolved, no configuration to resolve");
return new String[0];
}
String[] confs;
if ("*".equals(conf)) {
confs = reference.getConfigurationsNames();
} else {
confs = splitToArray(conf);
}
Set<String> rconfsSet = new HashSet<>();
// for each resolved configuration, check if the report still exists
ResolutionCacheManager cache = getSettings().getResolutionCacheManager();
for (String resolvedConf : rconfs) {
String resolveId = getResolveId();
if (resolveId == null) {
resolveId = ResolveOptions.getDefaultResolveId(reference);
}
File report = cache.getConfigurationResolveReportInCache(resolveId, resolvedConf);
// if the report does not exist any longer, we have to recreate it...
if (report.exists()) {
rconfsSet.add(resolvedConf);
}
}
Set<String> confsSet = new HashSet<>(Arrays.asList(confs));
Message.debug("resolved configurations: " + rconfsSet);
Message.debug("asked configurations: " + confsSet);
confsSet.removeAll(rconfsSet);
Message.debug("to resolve configurations: " + confsSet);
return confsSet.toArray(new String[confsSet.size()]);
}