Java Code Examples for org.apache.ivy.core.module.descriptor.DependencyDescriptor#isForce()
The following examples show how to use
org.apache.ivy.core.module.descriptor.DependencyDescriptor#isForce() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReflectiveDependencyDescriptorFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public DependencyDescriptor create(DependencyDescriptor source, ModuleRevisionId targetId) { if (!(source instanceof DefaultDependencyDescriptor)) { throw new IllegalArgumentException("I can only create descriptors out of DefaultDependencyDescriptor"); } DefaultDependencyDescriptor out = new DefaultDependencyDescriptor(moduleDescriptor(source), targetId, source.getDynamicConstraintDependencyRevisionId(), source.isForce(), source.isChanging(), source.isTransitive()); setProperty(out, "parentId", getProperty(source, "parentId")); setProperty(out, "namespace", source.getNamespace()); ((Map) getProperty(out, "confs")).putAll((Map) getProperty(source, "confs")); Map sourceExcludeRules = (Map) getProperty(source, "excludeRules"); setProperty(out, "excludeRules", sourceExcludeRules == null? null: new LinkedHashMap(sourceExcludeRules)); Map sourceIncludeRules = (Map) getProperty(source, "includeRules"); setProperty(out, "includeRules", sourceIncludeRules == null ? null : new LinkedHashMap(sourceIncludeRules)); Map dependencyArtifacts = (Map) getProperty(source, "dependencyArtifacts"); setProperty(out, "dependencyArtifacts", dependencyArtifacts == null? null: new LinkedHashMap(dependencyArtifacts)); setProperty(out, "sourceModule", source.getSourceModule()); return out; }
Example 2
Source File: ReflectiveDependencyDescriptorFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public DependencyDescriptor create(DependencyDescriptor source, ModuleRevisionId targetId) { if (!(source instanceof DefaultDependencyDescriptor)) { throw new IllegalArgumentException("I can only create descriptors out of DefaultDependencyDescriptor"); } DefaultDependencyDescriptor out = new DefaultDependencyDescriptor(moduleDescriptor(source), targetId, source.getDynamicConstraintDependencyRevisionId(), source.isForce(), source.isChanging(), source.isTransitive()); setProperty(out, "parentId", getProperty(source, "parentId")); setProperty(out, "namespace", source.getNamespace()); ((Map) getProperty(out, "confs")).putAll((Map) getProperty(source, "confs")); Map sourceExcludeRules = (Map) getProperty(source, "excludeRules"); setProperty(out, "excludeRules", sourceExcludeRules == null? null: new LinkedHashMap(sourceExcludeRules)); Map sourceIncludeRules = (Map) getProperty(source, "includeRules"); setProperty(out, "includeRules", sourceIncludeRules == null ? null : new LinkedHashMap(sourceIncludeRules)); Map dependencyArtifacts = (Map) getProperty(source, "dependencyArtifacts"); setProperty(out, "dependencyArtifacts", dependencyArtifacts == null? null: new LinkedHashMap(dependencyArtifacts)); setProperty(out, "sourceModule", source.getSourceModule()); return out; }
Example 3
Source File: ReflectiveDependencyDescriptorFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public DependencyDescriptor create(DependencyDescriptor source, ModuleRevisionId targetId) { if (!(source instanceof DefaultDependencyDescriptor)) { throw new IllegalArgumentException("I can only create descriptors out of DefaultDependencyDescriptor"); } DefaultDependencyDescriptor out = new DefaultDependencyDescriptor(moduleDescriptor(source), targetId, source.getDynamicConstraintDependencyRevisionId(), source.isForce(), source.isChanging(), source.isTransitive()); setProperty(out, "parentId", getProperty(source, "parentId")); setProperty(out, "namespace", source.getNamespace()); ((Map) getProperty(out, "confs")).putAll((Map) getProperty(source, "confs")); Map sourceExcludeRules = (Map) getProperty(source, "excludeRules"); setProperty(out, "excludeRules", sourceExcludeRules == null? null: new LinkedHashMap(sourceExcludeRules)); Map sourceIncludeRules = (Map) getProperty(source, "includeRules"); setProperty(out, "includeRules", sourceIncludeRules == null ? null : new LinkedHashMap(sourceIncludeRules)); Map dependencyArtifacts = (Map) getProperty(source, "dependencyArtifacts"); setProperty(out, "dependencyArtifacts", dependencyArtifacts == null? null: new LinkedHashMap(dependencyArtifacts)); setProperty(out, "sourceModule", source.getSourceModule()); return out; }
Example 4
Source File: ReflectiveDependencyDescriptorFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public DependencyDescriptor create(DependencyDescriptor source, ModuleRevisionId targetId) { if (!(source instanceof DefaultDependencyDescriptor)) { throw new IllegalArgumentException("I can only create descriptors out of DefaultDependencyDescriptor"); } DefaultDependencyDescriptor out = new DefaultDependencyDescriptor(moduleDescriptor(source), targetId, source.getDynamicConstraintDependencyRevisionId(), source.isForce(), source.isChanging(), source.isTransitive()); setProperty(out, "parentId", getProperty(source, "parentId")); setProperty(out, "namespace", source.getNamespace()); ((Map) getProperty(out, "confs")).putAll((Map) getProperty(source, "confs")); Map sourceExcludeRules = (Map) getProperty(source, "excludeRules"); setProperty(out, "excludeRules", sourceExcludeRules == null? null: new LinkedHashMap(sourceExcludeRules)); Map sourceIncludeRules = (Map) getProperty(source, "includeRules"); setProperty(out, "includeRules", sourceIncludeRules == null ? null : new LinkedHashMap(sourceIncludeRules)); Map dependencyArtifacts = (Map) getProperty(source, "dependencyArtifacts"); setProperty(out, "dependencyArtifacts", dependencyArtifacts == null? null: new LinkedHashMap(dependencyArtifacts)); setProperty(out, "sourceModule", source.getSourceModule()); return out; }
Example 5
Source File: XmlModuleDescriptorWriter.java From ant-ivy with Apache License 2.0 | 4 votes |
protected static void printDependency(ModuleDescriptor md, DependencyDescriptor dep, PrintWriter out) { final ModuleRevisionId dependencyRevisionId = dep.getDependencyRevisionId(); out.print(String.format("<dependency org=\"%s\" name=\"%s\"", XMLHelper.escape(dependencyRevisionId.getOrganisation()), XMLHelper.escape(dependencyRevisionId.getName()))); if (dependencyRevisionId.getBranch() != null) { out.print(" branch=\"" + XMLHelper.escape(dependencyRevisionId.getBranch()) + "\""); } out.print(" rev=\"" + XMLHelper.escape(dependencyRevisionId.getRevision()) + "\""); final ModuleRevisionId dynamicConstraintDependencyRevisionId = dep.getDynamicConstraintDependencyRevisionId(); if (!dynamicConstraintDependencyRevisionId.equals(dependencyRevisionId)) { if (dynamicConstraintDependencyRevisionId.getBranch() != null) { out.print(" branchConstraint=\"" + XMLHelper.escape(dynamicConstraintDependencyRevisionId.getBranch()) + "\""); } out.print(" revConstraint=\"" + XMLHelper.escape(dynamicConstraintDependencyRevisionId.getRevision()) + "\""); } if (dep.isForce()) { out.print(" force=\"" + dep.isForce() + "\""); } if (dep.isChanging()) { out.print(" changing=\"" + dep.isChanging() + "\""); } if (!dep.isTransitive()) { out.print(" transitive=\"" + dep.isTransitive() + "\""); } StringBuilder sb = new StringBuilder(); for (String modConf : dep.getModuleConfigurations()) { if (sb.length() > 0) { sb.append(";"); } sb.append(XMLHelper.escape(modConf)).append( listToPrefixedString(dep.getDependencyConfigurations(modConf), "->")); } out.print(" conf=\"" + sb + "\""); printExtraAttributes(dep, out, " "); DependencyArtifactDescriptor[] depArtifacts = dep.getAllDependencyArtifacts(); if (depArtifacts.length > 0) { out.println(">"); } printDependencyArtefacts(md, out, depArtifacts); IncludeRule[] includes = dep.getAllIncludeRules(); if (includes.length > 0 && depArtifacts.length == 0) { out.println(">"); } printDependencyIncludeRules(md, out, includes); ExcludeRule[] excludes = dep.getAllExcludeRules(); if (excludes.length > 0 && includes.length == 0 && depArtifacts.length == 0) { out.println(">"); } printDependencyExcludeRules(md, out, excludes); if (includes.length + excludes.length + depArtifacts.length == 0) { out.println("/>"); } else { out.println("\t\t</dependency>"); } }