use of org.apache.ivy.core.module.descriptor.DefaultWorkspaceModuleDescriptor in project ant-ivy by apache.
the class AbstractWorkspaceResolver method createWorkspaceMd.
protected WorkspaceModuleDescriptor createWorkspaceMd(ModuleDescriptor md) {
DefaultWorkspaceModuleDescriptor newMd = new DefaultWorkspaceModuleDescriptor(md.getModuleRevisionId(), "release", null, true);
newMd.addConfiguration(new Configuration(ModuleDescriptor.DEFAULT_CONFIGURATION));
newMd.setLastModified(System.currentTimeMillis());
newMd.setDescription(md.getDescription());
newMd.setHomePage(md.getHomePage());
newMd.setLastModified(md.getLastModified());
newMd.setPublicationDate(md.getPublicationDate());
newMd.setResolvedPublicationDate(md.getResolvedPublicationDate());
newMd.setStatus(md.getStatus());
Configuration[] allConfs = md.getConfigurations();
for (Artifact af : createWorkspaceArtifacts(md)) {
if (allConfs.length == 0) {
newMd.addArtifact(ModuleDescriptor.DEFAULT_CONFIGURATION, af);
} else {
for (Configuration conf : allConfs) {
newMd.addConfiguration(conf);
newMd.addArtifact(conf.getName(), af);
}
}
}
for (DependencyDescriptor dependency : md.getDependencies()) {
newMd.addDependency(dependency);
}
for (ExcludeRule excludeRule : md.getAllExcludeRules()) {
newMd.addExcludeRule(excludeRule);
}
newMd.getExtraInfos().addAll(md.getExtraInfos());
for (License license : md.getLicenses()) {
newMd.addLicense(license);
}
return newMd;
}
Aggregations