org.apache.ivy.core.IvyPatternHelper Java Examples

The following examples show how to use org.apache.ivy.core.IvyPatternHelper. 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 Project: ant-ivy   Author: apache   File: IvyRetrieveTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testWithAPreviousResolveAndResolveId() {
    // first we do a resolve in another project
    Project project = TestHelper.newProject();
    project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
    project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-simple.xml");
    IvyResolve resolve = new IvyResolve();
    resolve.setProject(project);
    resolve.setResolveId("testWithAPreviousResolveAndResolveId");
    resolve.execute();

    // then we do a retrieve with the correct module information
    retrieve.setOrganisation("apache");
    retrieve.setModule("resolve-simple");
    retrieve.setConf("default");
    retrieve.setResolveId("testWithAPreviousResolveAndResolveId");
    retrieve.execute();

    assertTrue(new File(IvyPatternHelper.substitute(RETRIEVE_PATTERN, "org1", "mod1.2", "2.0",
        "mod1.2", "jar", "jar")).exists());
}
 
Example #2
Source Project: ant-ivy   Author: apache   File: RetrieveTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testRetrieveWithVariable() throws Exception {
    // mod1.1 depends on mod1.2
    ivy.setVariable("retrieve.dir", "retrieve");
    ResolveReport report = ivy.resolve(new File(
            "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml").toURI().toURL(),
        getResolveOptions(new String[] {"*"}));
    assertNotNull(report);
    ModuleDescriptor md = report.getModuleDescriptor();
    assertNotNull(md);

    String pattern = "build/test/${retrieve.dir}/[module]/[conf]/[artifact]-[revision].[ext]";
    ivy.retrieve(md.getModuleRevisionId(),
        getRetrieveOptions().setDestArtifactPattern(pattern));
    pattern = IvyPatternHelper.substituteVariable(pattern, "retrieve.dir", "retrieve");
    assertTrue(new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0", "mod1.2",
        "jar", "jar", "default")).exists());

    pattern = "build/test/${retrieve.dir}/[module]/[conf]/[type]s/[artifact]-[revision].[ext]";
    ivy.retrieve(md.getModuleRevisionId(),
        getRetrieveOptions().setDestArtifactPattern(pattern));
    pattern = IvyPatternHelper.substituteVariable(pattern, "retrieve.dir", "retrieve");
    assertTrue(new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0", "mod1.2",
        "jar", "jar", "default")).exists());
}
 
Example #3
Source Project: ant-ivy   Author: apache   File: IvyReport.java    License: Apache License 2.0 6 votes vote down vote up
private String getOutputPattern(String conf, String ext) {
    if (mRevId == null) {
        ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();

        XmlReportParser parser = new XmlReportParser();
        File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);

        try {
            parser.parse(reportFile);
        } catch (ParseException e) {
            throw new BuildException("Error occurred while parsing reportfile '"
                    + reportFile.getAbsolutePath() + "'", e);
        }

        // get the resolve module
        mRevId = parser.getResolvedModule();
    }

    return IvyPatternHelper.substitute(outputpattern, mRevId.getOrganisation(),
        mRevId.getName(), mRevId.getRevision(), "", "", ext, conf,
        mRevId.getQualifiedExtraAttributes(), null);
}
 
Example #4
Source Project: ant-ivy   Author: apache   File: IvyArtifactProperty.java    License: Apache License 2.0 6 votes vote down vote up
public void doExecute() throws BuildException {
    prepareAndCheck();

    try {
        ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
        String resolveId = getResolveId();
        if (resolveId == null) {
            resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
        }
        XmlReportParser parser = new XmlReportParser();
        for (String conf : splitToArray(getConf())) {
            File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
            parser.parse(report);

            for (Artifact artifact : parser.getArtifacts()) {
                String name = IvyPatternHelper.substitute(getSettings().substitute(getName()),
                        artifact, conf);
                String value = IvyPatternHelper.substitute(
                        getSettings().substitute(getValue()), artifact, conf);
                setProperty(name, value);
            }
        }
    } catch (Exception ex) {
        throw new BuildException("impossible to add artifact properties: " + ex, ex);
    }
}
 
Example #5
Source Project: ant-ivy   Author: apache   File: RepositoryAnalyser.java    License: Apache License 2.0 6 votes vote down vote up
public void analyse(String pattern, DependencyAnalyser depAnalyser) {
    JarModuleFinder finder = new JarModuleFinder(pattern);
    ModuleDescriptor[] mds = depAnalyser.analyze(finder.findJarModules());
    Message.info("found " + mds.length + " modules");
    for (ModuleDescriptor md : mds) {
        File ivyFile = new File(IvyPatternHelper.substitute(
                pattern,
                DefaultArtifact.newIvyArtifact(md.getModuleRevisionId(),
                        md.getPublicationDate())));
        try {
            Message.info("generating " + ivyFile);
            XmlModuleDescriptorWriter.write(md, ivyFile);
        } catch (IOException e) {
            Message.debug(e);
        }
    }
}
 
Example #6
Source Project: ant-ivy   Author: apache   File: JarModuleFinder.java    License: Apache License 2.0 6 votes vote down vote up
public JarModule[] findJarModules() {
    List<JarModule> ret = new ArrayList<>();
    URLLister lister = new FileURLLister();
    try {
        for (String org : ResolverHelper.listTokenValues(lister, pattern, "organisation")) {
            String orgPattern = IvyPatternHelper.substituteToken(pattern,
                    IvyPatternHelper.ORGANISATION_KEY, org);
            for (String module : ResolverHelper.listTokenValues(lister, orgPattern, "module")) {
                String modPattern = IvyPatternHelper.substituteToken(orgPattern,
                        IvyPatternHelper.MODULE_KEY, module);
                for (String rev : ResolverHelper.listTokenValues(lister, modPattern, "revision")) {
                    File jar = new File(IvyPatternHelper.substitute(filePattern, org,
                            module, rev, module, "jar", "jar"));
                    if (jar.exists()) {
                        ret.add(new JarModule(ModuleRevisionId.newInstance(org, module, rev), jar));
                    }
                }
            }
        }

    } catch (Exception e) {
        Message.debug(e);
        // TODO: handle exception
    }
    return ret.toArray(new JarModule[ret.size()]);
}
 
Example #7
Source Project: ant-ivy   Author: apache   File: RetrieveTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testRetrieveSimple() throws Exception {
    // mod1.1 depends on mod1.2
    ResolveReport report = ivy.resolve(new File(
            "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml").toURI().toURL(),
        getResolveOptions(new String[] {"*"}));
    assertNotNull(report);
    ModuleDescriptor md = report.getModuleDescriptor();
    assertNotNull(md);

    String pattern = "build/test/retrieve/[module]/[conf]/[artifact]-[revision].[ext]";
    ivy.retrieve(md.getModuleRevisionId(),
        getRetrieveOptions().setDestArtifactPattern(pattern));
    assertTrue(new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0", "mod1.2",
        "jar", "jar", "default")).exists());

    pattern = "build/test/retrieve/[module]/[conf]/[type]s/[artifact]-[revision].[ext]";
    ivy.retrieve(md.getModuleRevisionId(),
        getRetrieveOptions().setDestArtifactPattern(pattern));
    assertTrue(new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0", "mod1.2",
        "jar", "jar", "default")).exists());
}
 
Example #8
Source Project: ant-ivy   Author: apache   File: ModuleRevisionId.java    License: Apache License 2.0 6 votes vote down vote up
private ModuleRevisionId(ModuleId moduleId, String branch, String revision,
        Map<String, String> extraAttributes, boolean replaceNullBranchWithDefault) {
    super(null, extraAttributes);
    this.moduleId = moduleId;
    IvyContext context = IvyContext.getContext();
    this.branch = (replaceNullBranchWithDefault && branch == null)
    // we test if there's already an Ivy instance loaded, to avoid loading a default one
    // just to get the default branch
    ? (context.peekIvy() == null ? null : context.getSettings().getDefaultBranch(moduleId))
            : branch;
    this.revision = revision == null ? Ivy.getWorkingRevision() : normalizeRevision(revision);
    setStandardAttribute(IvyPatternHelper.ORGANISATION_KEY, this.moduleId.getOrganisation());
    setStandardAttribute(IvyPatternHelper.MODULE_KEY, this.moduleId.getName());
    setStandardAttribute(IvyPatternHelper.BRANCH_KEY, this.branch);
    setStandardAttribute(IvyPatternHelper.REVISION_KEY, this.revision);
}
 
Example #9
Source Project: ant-ivy   Author: apache   File: SearchEngine.java    License: Apache License 2.0 6 votes vote down vote up
public ModuleEntry[] listModuleEntries(OrganisationEntry org) {
    Set<ModuleEntry> entries = new HashSet<>();

    Map<String, Object> tokenValues = new HashMap<>();
    tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, org.getOrganisation());

    for (DependencyResolver resolver : settings.getResolvers()) {
        Map<String, String>[] modules = resolver.listTokenValues(
            new String[] {IvyPatternHelper.MODULE_KEY}, tokenValues);
        for (Map<String, String> me : modules) {
            String module = me.get(IvyPatternHelper.MODULE_KEY);
            entries.add(new ModuleEntry(org, module));
        }
    }

    return entries.toArray(new ModuleEntry[entries.size()]);
}
 
Example #10
Source Project: ant-ivy   Author: apache   File: SearchEngine.java    License: Apache License 2.0 6 votes vote down vote up
public String[] listModules(String org) {
    Set<String> entries = new HashSet<>();

    Map<String, Object> tokenValues = new HashMap<>();
    tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, org);

    for (DependencyResolver resolver : settings.getResolvers()) {
        Map<String, String>[] modules = resolver.listTokenValues(
            new String[] {IvyPatternHelper.MODULE_KEY}, tokenValues);
        for (Map<String, String> module : modules) {
            entries.add(module.get(IvyPatternHelper.MODULE_KEY));
        }
    }

    return entries.toArray(new String[entries.size()]);
}
 
Example #11
Source Project: ant-ivy   Author: apache   File: SearchEngine.java    License: Apache License 2.0 6 votes vote down vote up
public String[] listRevisions(String org, String module) {
    Set<String> entries = new HashSet<>();

    Map<String, Object> tokenValues = new HashMap<>();
    tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, org);
    tokenValues.put(IvyPatternHelper.MODULE_KEY, module);

    for (DependencyResolver resolver : settings.getResolvers()) {
        Map<String, String>[] revisions = resolver.listTokenValues(
            new String[] {IvyPatternHelper.REVISION_KEY}, tokenValues);
        for (Map<String, String> revision : revisions) {
            entries.add(revision.get(IvyPatternHelper.REVISION_KEY));
        }
    }

    return entries.toArray(new String[entries.size()]);
}
 
Example #12
Source Project: ant-ivy   Author: apache   File: SearchEngine.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * List module ids of the module accessible through the current resolvers matching the given mid
 * criteria according to the given matcher.
 * <p>
 * ModuleId are returned in the system namespace.
 * </p>
 *
 * @param moduleCrit ModuleId
 * @param matcher PatternMatcher
 * @return ModuleId[]
 */
public ModuleId[] listModules(ModuleId moduleCrit, PatternMatcher matcher) {
    List<ModuleId> ret = new ArrayList<>();

    Map<String, Object> criteria = new HashMap<>();
    addMatcher(matcher, moduleCrit.getOrganisation(), criteria,
        IvyPatternHelper.ORGANISATION_KEY);
    addMatcher(matcher, moduleCrit.getName(), criteria, IvyPatternHelper.MODULE_KEY);

    String[] tokensToList = new String[] {IvyPatternHelper.ORGANISATION_KEY,
            IvyPatternHelper.MODULE_KEY};

    for (DependencyResolver resolver : settings.getResolvers()) {
        Map<String, String>[] moduleIdAsMap = resolver.listTokenValues(tokensToList, criteria);
        for (Map<String, String> moduleId : moduleIdAsMap) {
            String org = moduleId.get(IvyPatternHelper.ORGANISATION_KEY);
            String name = moduleId.get(IvyPatternHelper.MODULE_KEY);
            ModuleId modId = ModuleId.newInstance(org, name);
            ret.add(NameSpaceHelper.transform(modId, resolver.getNamespace()
                    .getToSystemTransformer()));
        }
    }

    return ret.toArray(new ModuleId[ret.size()]);
}
 
Example #13
Source Project: ant-ivy   Author: apache   File: RetrieveTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testRetrieveOverwrite() throws Exception {
    // mod1.1 depends on mod1.2
    ResolveReport report = ivy.resolve(new File(
            "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml").toURI().toURL(),
        getResolveOptions(new String[] {"*"}));
    assertNotNull(report);
    ModuleDescriptor md = report.getModuleDescriptor();
    assertNotNull(md);

    String pattern = "build/test/retrieve/[module]/[conf]/[artifact]-[revision].[ext]";

    // we create a fake old file to see if it is overwritten
    File file = new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0",
        "mod1.2", "jar", "jar", "default")).getCanonicalFile();
    file.getParentFile().mkdirs();
    file.createNewFile();
    ivy.retrieve(md.getModuleRevisionId(),
        getRetrieveOptions().setOverwriteMode("always").setDestArtifactPattern(pattern));
    assertEquals(new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar").lastModified(),
        file.lastModified());
}
 
Example #14
Source Project: ant-ivy   Author: apache   File: Match.java    License: Apache License 2.0 6 votes vote down vote up
public Matcher getPatternMatcher(ModuleRevisionId askedMrid) {
    String revision = askedMrid.getRevision();

    List<String> args = split(getArgs());
    List<String> argValues = getRevisionArgs(revision);

    if (args.size() != argValues.size()) {
        return new NoMatchMatcher();
    }

    Map<String, String> variables = new HashMap<>();
    for (String arg : args) {
        variables.put(arg, argValues.get(args.indexOf(arg)));
    }

    String pattern = getPattern();
    pattern = IvyPatternHelper.substituteVariables(pattern, variables);

    PatternMatcher pMatcher = IvyContext.getContext().getSettings().getMatcher(matcher);
    return pMatcher.getMatcher(pattern);
}
 
Example #15
Source Project: ant-ivy   Author: apache   File: IvyRetrieveTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testInline() {
    // we first resolve another ivy file
    IvyResolve resolve = new IvyResolve();
    resolve.setProject(project);
    resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
    resolve.execute();

    assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());

    // then we resolve a dependency directly
    retrieve.setOrganisation("org1");
    retrieve.setModule("mod1.2");
    retrieve.setRevision("2.0");
    retrieve.setInline(true);
    retrieve.execute();
    assertTrue(new File(IvyPatternHelper.substitute(RETRIEVE_PATTERN, "org1", "mod1.2", "2.0",
        "mod1.2", "jar", "jar")).exists());
}
 
Example #16
Source Project: ant-ivy   Author: apache   File: IvyPatternHelperTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testOptionalSubstitute() {
    Map<String, String> tokens = new HashMap<>();
    tokens.put("token", "");
    tokens.put("othertoken", "myval");
    assertEquals("test-myval",
        IvyPatternHelper.substituteTokens("test(-[token])(-[othertoken])", tokens));
    tokens.put("token", "val");
    assertEquals("test-val-myval",
        IvyPatternHelper.substituteTokens("test(-[token])(-[othertoken])", tokens));
}
 
Example #17
Source Project: pushfish-android   Author: PushFish   File: M2ResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected String substituteTokens(String pattern, Map<String, String> attributes) {
    String org = attributes.get(IvyPatternHelper.ORGANISATION_KEY);
    if (org != null) {
        attributes.put(IvyPatternHelper.ORGANISATION_KEY, org.replace(".", "/"));
    }
    return super.substituteTokens(pattern, attributes);
}
 
Example #18
Source Project: pushfish-android   Author: PushFish   File: AbstractResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected Map<String, String> toAttributes(IvyArtifactName ivyArtifact) {
    HashMap<String, String> attributes = new HashMap<String, String>();
    attributes.put(IvyPatternHelper.ARTIFACT_KEY, ivyArtifact.getName());
    attributes.put(IvyPatternHelper.TYPE_KEY, ivyArtifact.getType());
    attributes.put(IvyPatternHelper.EXT_KEY, ivyArtifact.getExtension());
    attributes.put("classifier", ivyArtifact.getClassifier());
    return attributes;
}
 
Example #19
Source Project: ant-ivy   Author: apache   File: IvyRetrieveTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrievePrivateWithWildcard() {
    project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-381.xml");
    retrieve.setConf("*");
    retrieve.execute();
    assertTrue(new File(IvyPatternHelper.substitute(RETRIEVE_PATTERN, "org1", "mod1.2", "1.1",
        "mod1.2", "jar", "jar", "public")).exists());
    assertTrue(new File(IvyPatternHelper.substitute(RETRIEVE_PATTERN, "org3", "mod3.2", "1.4",
        "mod3.2", "jar", "jar", "private")).exists());
}
 
Example #20
Source Project: pushfish-android   Author: PushFish   File: AbstractResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected Map<String, String> toAttributes(ModuleComponentIdentifier componentIdentifier) {
    HashMap<String, String> attributes = new HashMap<String, String>();
    attributes.put(IvyPatternHelper.ORGANISATION_KEY, componentIdentifier.getGroup());
    attributes.put(IvyPatternHelper.MODULE_KEY, componentIdentifier.getModule());
    attributes.put(IvyPatternHelper.REVISION_KEY, componentIdentifier.getVersion());
    return attributes;
}
 
Example #21
Source Project: pushfish-android   Author: PushFish   File: PomReader.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private String replaceProps(String val) {
    if (val == null) {
        return null;
    } else {
        return IvyPatternHelper.substituteVariables(val, properties).trim();
    }
}
 
Example #22
Source Project: pushfish-android   Author: PushFish   File: M2ResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public String toModulePath(ModuleIdentifier module) {
    String pattern = getPattern();
    if (!pattern.endsWith(MavenPattern.M2_PATTERN)) {
        throw new UnsupportedOperationException("Cannot locate module for non-maven layout.");
    }
    String metaDataPattern = pattern.substring(0, pattern.length() - MavenPattern.M2_PER_MODULE_PATTERN.length() - 1);
    return IvyPatternHelper.substituteTokens(metaDataPattern, toAttributes(module));
}
 
Example #23
Source Project: pushfish-android   Author: PushFish   File: M2ResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public String toModuleVersionPath(ModuleVersionArtifactMetaData artifact) {
    String pattern = getPattern();
    if (!pattern.endsWith(MavenPattern.M2_PATTERN)) {
        throw new UnsupportedOperationException("Cannot locate module version for non-maven layout.");
    }
    String metaDataPattern = pattern.substring(0, pattern.length() - MavenPattern.M2_PER_MODULE_VERSION_PATTERN.length() - 1);
    return IvyPatternHelper.substituteTokens(metaDataPattern, toAttributes(artifact));
}
 
Example #24
Source Project: pushfish-android   Author: PushFish   File: M2ResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private Map<String, Object> mapOrganisation(Map<String, Object> attributes) {
    String org = (String) attributes.get(IvyPatternHelper.ORGANISATION_KEY);
    if (org != null) {
        attributes.put(IvyPatternHelper.ORGANISATION_KEY, org.replace(".", "/"));
    }
    return attributes;
}
 
Example #25
Source Project: pushfish-android   Author: PushFish   File: IvyResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected Map<String, Object> toAttributes(ModuleVersionArtifactMetaData artifact) {
    HashMap<String, Object> attributes = new HashMap<String, Object>();
    ModuleComponentIdentifier moduleVersionIdentifier = artifact.getId().getComponentIdentifier();
    IvyArtifactName ivyArtifact = artifact.getName();
    attributes.put(IvyPatternHelper.ORGANISATION_KEY, moduleVersionIdentifier.getGroup());
    attributes.put(IvyPatternHelper.MODULE_KEY, moduleVersionIdentifier.getModule());
    attributes.put(IvyPatternHelper.REVISION_KEY, moduleVersionIdentifier.getVersion());
    attributes.put(IvyPatternHelper.ARTIFACT_KEY, ivyArtifact.getName());
    attributes.put(IvyPatternHelper.TYPE_KEY, ivyArtifact.getType());
    attributes.put(IvyPatternHelper.EXT_KEY, ivyArtifact.getExtension());
    attributes.put("classifier", ivyArtifact.getClassifier());
    return attributes;
}
 
Example #26
Source Project: Pushjet-Android   Author: Pushjet   File: M2ResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected String substituteTokens(String pattern, Map<String, String> attributes) {
    String org = attributes.get(IvyPatternHelper.ORGANISATION_KEY);
    if (org != null) {
        attributes.put(IvyPatternHelper.ORGANISATION_KEY, org.replace(".", "/"));
    }
    return super.substituteTokens(pattern, attributes);
}
 
Example #27
Source Project: Pushjet-Android   Author: Pushjet   File: AbstractResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected Map<String, String> toAttributes(IvyArtifactName ivyArtifact) {
    HashMap<String, String> attributes = new HashMap<String, String>();
    attributes.put(IvyPatternHelper.ARTIFACT_KEY, ivyArtifact.getName());
    attributes.put(IvyPatternHelper.TYPE_KEY, ivyArtifact.getType());
    attributes.put(IvyPatternHelper.EXT_KEY, ivyArtifact.getExtension());
    attributes.put("classifier", ivyArtifact.getClassifier());
    return attributes;
}
 
Example #28
Source Project: ant-ivy   Author: apache   File: AbstractPatternsBasedResolver.java    License: Apache License 2.0 5 votes vote down vote up
protected void convertM2CriteriaForResourceSearch(Map<String, Object> criteria) {
    Object org = criteria.get(IvyPatternHelper.ORGANISATION_KEY);
    if (org instanceof String) {
        criteria.put(IvyPatternHelper.ORGANISATION_KEY,
            convertM2OrganizationForResourceSearch((String) org));
    }
}
 
Example #29
Source Project: Pushjet-Android   Author: Pushjet   File: AbstractResourcePattern.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected Map<String, String> toAttributes(ModuleComponentIdentifier componentIdentifier) {
    HashMap<String, String> attributes = new HashMap<String, String>();
    attributes.put(IvyPatternHelper.ORGANISATION_KEY, componentIdentifier.getGroup());
    attributes.put(IvyPatternHelper.MODULE_KEY, componentIdentifier.getModule());
    attributes.put(IvyPatternHelper.REVISION_KEY, componentIdentifier.getVersion());
    return attributes;
}
 
Example #30
Source Project: Pushjet-Android   Author: Pushjet   File: PomReader.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
private String replaceProps(String val) {
    if (val == null) {
        return null;
    } else {
        return IvyPatternHelper.substituteVariables(val, properties).trim();
    }
}