当前位置: 首页>>代码示例>>Java>>正文


Java AddonRepositoryImpl.getRuntimeAPIVersion方法代码示例

本文整理汇总了Java中org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl.getRuntimeAPIVersion方法的典型用法代码示例。如果您正苦于以下问题:Java AddonRepositoryImpl.getRuntimeAPIVersion方法的具体用法?Java AddonRepositoryImpl.getRuntimeAPIVersion怎么用?Java AddonRepositoryImpl.getRuntimeAPIVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl的用法示例。


在下文中一共展示了AddonRepositoryImpl.getRuntimeAPIVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findCompatibleInstalledModule

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
private ModuleIdentifier findCompatibleInstalledModule(AddonId addonId)
{
   ModuleIdentifier result = null;

   Addon addon = currentAddon.get();
   Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();

   for (AddonRepository repository : stateManager.getViewsOf(addon).iterator().next().getRepositories())
   {
      List<AddonId> enabled = repository.listEnabledCompatibleWithVersion(runtimeAPIVersion);
      for (AddonId id : enabled)
      {
         if (id.getName().equals(addonId.getName()))
         {
            result = moduleCache.getModuleId(addon);
            break;
         }
      }
   }

   return result;
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:23,代码来源:AddonModuleLoader.java

示例2: getVersion

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
@Override
public Version getVersion()
{
   return AddonRepositoryImpl.getRuntimeAPIVersion();
}
 
开发者ID:forge,项目名称:furnace,代码行数:6,代码来源:FurnaceImpl.java

示例3: getVersion

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
@Override
public Version getVersion()
{
   return AddonRepositoryImpl.getRuntimeAPIVersion() == null ? null : AddonRepositoryImpl.getRuntimeAPIVersion();
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:6,代码来源:FurnaceImpl.java

示例4: install

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
void install(String coordinates, boolean batchMode)
{
    Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();
    try
    {
        AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
        AddonManagerImpl addonManager = new AddonManagerImpl(furnace, resolver);

        AddonId addonId;

        coordinates = convertColonVersionToComma(coordinates);

        // This allows windup --install maven
        if (coordinates.matches(artifactWithCommaVersionPattern))
        {
            addonId = AddonId.fromCoordinates(coordinates);
        }
        else if (coordinates.matches(artifactPattern))
        {
            AddonId[] versions = resolver.resolveVersions(coordinates).get();
            String coordinate = coordinates;

            if (versions.length == 0)
            {
                throw new IllegalArgumentException("No Artifact version found for " + coordinate);
            }
            else
            {
                AddonId selected = null;
                for (int i = versions.length - 1; selected == null && i >= 0; i--)
                {
                    String apiVersion = resolver.resolveAPIVersion(versions[i]).get();
                    if (apiVersion != null
                                && Versions.isApiCompatible(runtimeAPIVersion, SingleVersion.valueOf(apiVersion)))
                    {
                        selected = versions[i];
                    }
                }
                if (selected == null)
                {
                    throw new IllegalArgumentException("No compatible addon API version found for " + coordinate
                                + " for API " + runtimeAPIVersion);
                }

                addonId = selected;
            }
        }
        else
        {
            throw new IllegalArgumentException("Unrecognized format: " + coordinates + ", format must match: GROUP_ID:ARTIFACT_ID:VERSION");
        }

        AddonActionRequest request = addonManager.install(addonId);
        System.out.println(request);
        if (!batchMode)
        {
            String result = System.console().readLine("Confirm installation [Y/n]? ");
            if ("n".equalsIgnoreCase(result.trim()))
            {
                System.out.println("Installation aborted.");
                return;
            }
        }
        request.perform();
        System.out.println("Installation completed successfully.");
        System.out.println();
    }
    catch (Exception e)
    {
        e.printStackTrace();
        System.out.println("> Forge version [" + runtimeAPIVersion + "]");
    }
}
 
开发者ID:windup,项目名称:windup,代码行数:74,代码来源:InstallAddonCommand.java


注:本文中的org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl.getRuntimeAPIVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。