Search in sources :

Example 1 with MergeStrategy

use of org.eclipse.ceylon.cmr.spi.MergeStrategy in project ceylon by eclipse.

the class AbstractJBossRuntime method createRepository.

private RepositoryManager createRepository(Configuration conf, boolean offline) {
    Logger log = new CMRJULLogger();
    final RepositoryManagerBuilder builder = CeylonUtils.repoManager().cwd(conf.cwd).systemRepo(conf.systemRepository).cacheRepo(conf.cacheRepository).overrides(conf.overrides).upgradeDist(conf.upgradeDist).noDefaultRepos(conf.noDefaultRepositories).noOutRepo(true).userRepos(conf.repositories).offline(offline || conf.offline).logger(log).buildManagerBuilder();
    final MergeStrategy ms = getService(MergeStrategy.class, conf);
    if (ms != null)
        builder.mergeStrategy(ms);
    if (conf.cacheContent)
        builder.cacheContent();
    final ContentTransformer ct = getService(ContentTransformer.class, conf);
    if (ct != null)
        builder.contentTransformer(ct);
    return builder.buildRepository();
}
Also used : RepositoryManagerBuilder(org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder) MergeStrategy(org.eclipse.ceylon.cmr.spi.MergeStrategy) ContentTransformer(org.eclipse.ceylon.cmr.spi.ContentTransformer) CMRJULLogger(org.eclipse.ceylon.cmr.impl.CMRJULLogger) Logger(org.eclipse.ceylon.common.log.Logger) CMRJULLogger(org.eclipse.ceylon.cmr.impl.CMRJULLogger)

Example 2 with MergeStrategy

use of org.eclipse.ceylon.cmr.spi.MergeStrategy in project ceylon by eclipse.

the class AbstractOpenNode method link.

@Override
public void link(OpenNode child) {
    if (child == null)
        throw new IllegalArgumentException("Null node!");
    OpenNode previous = children.putIfAbsent(child.getLabel(), child);
    if (previous == null) {
        if (child instanceof AbstractOpenNode) {
            AbstractOpenNode dn = (AbstractOpenNode) child;
            dn.parents.put(getLabel(), this);
        }
    } else {
        MergeStrategy ms = findService(MergeStrategy.class);
        ms.conflict(previous, child);
    }
}
Also used : MergeStrategy(org.eclipse.ceylon.cmr.spi.MergeStrategy) OpenNode(org.eclipse.ceylon.cmr.spi.OpenNode)

Aggregations

MergeStrategy (org.eclipse.ceylon.cmr.spi.MergeStrategy)2 RepositoryManagerBuilder (org.eclipse.ceylon.cmr.api.RepositoryManagerBuilder)1 CMRJULLogger (org.eclipse.ceylon.cmr.impl.CMRJULLogger)1 ContentTransformer (org.eclipse.ceylon.cmr.spi.ContentTransformer)1 OpenNode (org.eclipse.ceylon.cmr.spi.OpenNode)1 Logger (org.eclipse.ceylon.common.log.Logger)1