當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。