Search in sources :

Example 1 with DefaultWorkspaceModuleDescriptor

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;
}
Also used : DefaultWorkspaceModuleDescriptor(org.apache.ivy.core.module.descriptor.DefaultWorkspaceModuleDescriptor) Configuration(org.apache.ivy.core.module.descriptor.Configuration) DependencyDescriptor(org.apache.ivy.core.module.descriptor.DependencyDescriptor) License(org.apache.ivy.core.module.descriptor.License) ExcludeRule(org.apache.ivy.core.module.descriptor.ExcludeRule) Artifact(org.apache.ivy.core.module.descriptor.Artifact) DefaultArtifact(org.apache.ivy.core.module.descriptor.DefaultArtifact)

Aggregations

Artifact (org.apache.ivy.core.module.descriptor.Artifact)1 Configuration (org.apache.ivy.core.module.descriptor.Configuration)1 DefaultArtifact (org.apache.ivy.core.module.descriptor.DefaultArtifact)1 DefaultWorkspaceModuleDescriptor (org.apache.ivy.core.module.descriptor.DefaultWorkspaceModuleDescriptor)1 DependencyDescriptor (org.apache.ivy.core.module.descriptor.DependencyDescriptor)1 ExcludeRule (org.apache.ivy.core.module.descriptor.ExcludeRule)1 License (org.apache.ivy.core.module.descriptor.License)1