• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BuildNumber类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.util.BuildNumber的典型用法代码示例。如果您正苦于以下问题:Java BuildNumber类的具体用法?Java BuildNumber怎么用?Java BuildNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BuildNumber类属于com.intellij.openapi.util包,在下文中一共展示了BuildNumber类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createDownloader

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@NotNull
public static PluginDownloader createDownloader(@NotNull IdeaPluginDescriptor descriptor,
                                                @Nullable String host,
                                                @Nullable BuildNumber buildNumber) throws IOException {
  try {
    String url = getUrl(descriptor, host, buildNumber);
    String id = descriptor.getPluginId().getIdString();
    PluginDownloader downloader = new PluginDownloader(id, url, descriptor.getName(), descriptor.getVersion(), buildNumber);
    downloader.setDescriptor(descriptor);
    downloader.setDescription(descriptor.getDescription());
    List<PluginId> depends;
    if (descriptor instanceof PluginNode) {
      depends = ((PluginNode)descriptor).getDepends();
    }
    else {
      depends = new ArrayList<PluginId>(Arrays.asList(descriptor.getDependentPluginIds()));
    }
    downloader.setDepends(depends);
    return downloader;
  }
  catch (URISyntaxException e) {
    throw new IOException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PluginDownloader.java


示例2: getUrl

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@NotNull
private static String getUrl(@NotNull IdeaPluginDescriptor descriptor,
                             @Nullable String host,
                             @Nullable BuildNumber buildNumber) throws URISyntaxException, MalformedURLException {
  if (host != null && descriptor instanceof PluginNode) {
    String url = ((PluginNode)descriptor).getDownloadUrl();
    return new URI(url).isAbsolute() ? url : new URL(new URL(host), url).toExternalForm();
  }
  else {
    Application app = ApplicationManager.getApplication();
    ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();

    String buildNumberAsString = buildNumber != null ? buildNumber.asString() :
                                 app != null ? ApplicationInfo.getInstance().getApiVersion() :
                                 appInfo.getBuild().asString();

    String uuid = app != null ? UpdateChecker.getInstallationUID(PropertiesComponent.getInstance()) : UUID.randomUUID().toString();

    URIBuilder uriBuilder = new URIBuilder(appInfo.getPluginsDownloadUrl());
    uriBuilder.addParameter("action", "download");
    uriBuilder.addParameter("id", descriptor.getPluginId().getIdString());
    uriBuilder.addParameter("build", buildNumberAsString);
    uriBuilder.addParameter("uuid", uuid);
    return uriBuilder.build().toString();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:PluginDownloader.java


示例3: testNewChannelAppears

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Test
public void testNewChannelAppears() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channel appears - eap of version 10 is there
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.RELEASE);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.627"), InfoReader.read("idea-newChannel-release.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNull(update);

  UpdateChannel newChannel = result.getChannelToPropose();
  assertNotNull(newChannel);
  assertEquals("IDEA10EAP", newChannel.getId());
  assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UpdateStrategyTest.java


示例4: testNewChannelAndNewBuildAppear

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Test
public void testNewChannelAndNewBuildAppear() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channels appears - eap of version 10 is there
  // and new build withing old channel appears also
  // we need to show only one dialog
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), InfoReader.read("idea-newChannel.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());
  BuildInfo update = result.getNewBuildInSelectedChannel();
  assertNotNull(update);
  assertEquals("95.627", update.getNumber().toString());

  UpdateChannel newChannel = result.getChannelToPropose();
  assertNotNull(newChannel);
  assertEquals("IDEA10EAP", newChannel.getId());
  assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:UpdateStrategyTest.java


示例5: testChannelWithCurrentStatusPreferred

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Test
public void testChannelWithCurrentStatusPreferred() {
  BuildNumber currentBuild = BuildNumber.fromString("IU-139.658");
  TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  UpdateStrategyCustomization customization = new UpdateStrategyCustomization();
  UpdateStrategy strategy = new UpdateStrategy(14, currentBuild, InfoReader.read("idea-patchAvailable.xml"), settings, customization);

  CheckForUpdateResult result = strategy.checkForUpdates();
  assertEquals(UpdateStrategy.State.LOADED, result.getState());

  UpdateChannel channel = result.getUpdatedChannel();
  assertNotNull(channel);
  assertEquals(ChannelStatus.EAP, channel.getStatus());

  BuildInfo selectedChannel = result.getNewBuildInSelectedChannel();
  assertNotNull(selectedChannel);
  assertNotNull(selectedChannel.findPatchForBuild(currentBuild));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UpdateStrategyTest.java


示例6: testValidXmlParsing

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Test
public void testValidXmlParsing() {
  UpdatesInfo info = InfoReader.read("current.xml");
  assertEquals(5, info.getProductsCount());

  Product product = info.getProduct("IU");
  assertNotNull(product);
  checkProduct(product, "IntelliJ IDEA", "maiaEAP", "IDEA10EAP", "idea90");

  UpdateChannel channel = product.findUpdateChannelById("IDEA10EAP");
  assertNotNull(channel);

  BuildInfo build = channel.getLatestBuild();
  assertNotNull(build);
  assertEquals(BuildNumber.fromString("98.520"), build.getNumber());
  Date date = build.getReleaseDate();
  assertNotNull(date);
  assertEquals("2011-04-03", new SimpleDateFormat("yyyy-MM-dd").format(date));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:UpdatesInfoParserTest.java


示例7: testOneProductOnly

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Test
public void testOneProductOnly() {
  UpdatesInfo info = InfoReader.read("oneProductOnly.xml");
  assertNotNull(info);

  Product product = info.getProduct("IU");
  assertNotNull(product);
  checkProduct(product, "IntelliJ IDEA", "maiaEAP", "IDEA10EAP", "idea90");

  UpdateChannel channel = product.findUpdateChannelById("IDEA10EAP");
  assertNotNull(channel);

  BuildInfo build = channel.getLatestBuild();
  assertNotNull(build);
  assertEquals(BuildNumber.fromString("98.520"), build.getNumber());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:UpdatesInfoParserTest.java


示例8: readPluginIdFromJar

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Nullable
private static String readPluginIdFromJar(String buildNumber, File jar)
    throws ExecutionException {
  IdeaPluginDescriptor pluginDescriptor = PluginManagerCore.loadDescriptor(jar, "plugin.xml");
  if (pluginDescriptor == null) {
    return null;
  }
  if (PluginManagerCore.isIncompatible(pluginDescriptor, BuildNumber.fromString(buildNumber))) {
    throw new ExecutionException(
        String.format(
            "Plugin SDK version '%s' is incompatible with this plugin "
                + "(since: '%s', until: '%s')",
            buildNumber, pluginDescriptor.getSinceBuild(), pluginDescriptor.getUntilBuild()));
  }
  return pluginDescriptor.getPluginId().getIdString();
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:17,代码来源:BlazeIntellijPluginDeployer.java


示例9: doCheckForUpdates

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@NotNull
public static CheckForUpdateResult doCheckForUpdates(final UpdateSettings settings) {
  ApplicationInfo appInfo = ApplicationInfo.getInstance();
  BuildNumber currentBuild = appInfo.getBuild();
  int majorVersion = Integer.parseInt(appInfo.getMajorVersion());
  final UpdatesXmlLoader loader = new UpdatesXmlLoader(getUpdateUrl());
  final UpdatesInfo info;
  try {
    info = loader.loadUpdatesInfo();
    if (info == null) {
      return new CheckForUpdateResult(UpdateStrategy.State.NOTHING_LOADED);
    }
  }
  catch (ConnectionException e) {
    return new CheckForUpdateResult(UpdateStrategy.State.CONNECTION_ERROR, e);
  }

  UpdateStrategy strategy = new UpdateStrategy(majorVersion, currentBuild, info, settings);
  return strategy.checkForUpdates();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UpdateChecker.java


示例10: testValidXmlParsing

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public void testValidXmlParsing() throws Exception {
  final UpdatesInfo info = InfoReader.read("current.xml");
  Assert.assertNotNull(info);
  Assert.assertEquals(5, info.getProductsCount());

  final Product iu = info.getProduct("IU");

  checkProduct(iu, "IntelliJ IDEA", new String[]{"maiaEAP", "IDEA10EAP", "idea90"});

  final UpdateChannel channel = iu.findUpdateChannelById("IDEA10EAP");
  final BuildInfo build = channel.getLatestBuild();

  Assert.assertEquals(BuildNumber.fromString("98.520"), build.getNumber());
  Calendar releaseDate = Calendar.getInstance();
  releaseDate.setTime(build.getReleaseDate());
  Assert.assertEquals(3, releaseDate.get(Calendar.DAY_OF_MONTH));
  Assert.assertEquals(Calendar.APRIL, releaseDate.get(Calendar.MONTH));
  Assert.assertEquals(2011, releaseDate.get(Calendar.YEAR));

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UpdatesInfoXppParserTest.java


示例11: testNewChannelAppears

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public void testNewChannelAppears() {
  // assume user has version 9 eap subscription (default or selected)
  // and new channel appears - eap of version 10 is there
  final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.RELEASE);
  //first time load
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.627"), UpdatesInfoXppParserTest.InfoReader.read("idea-newChannel-release.xml"), settings);


  final CheckForUpdateResult result = strategy.checkForUpdates();
  Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());
  final BuildInfo update = result.getNewBuildInSelectedChannel();
  Assert.assertNull(update);

  final UpdateChannel newChannel = result.getChannelToPropose();
  Assert.assertNotNull(newChannel);
  Assert.assertEquals("IDEA10EAP", newChannel.getId());
  Assert.assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:UpdateStrategyTest.java


示例12: testNewChannelAndNewBuildAppear

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public void testNewChannelAndNewBuildAppear() {
  //assume user has version 9 eap subscription (default or selected)
  //and new channels appears - eap of version 10 is there
  //and new build withing old channel appears also
  //we need to show only one dialog
  final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);
  //first time load
  UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString("IU-95.429"), UpdatesInfoXppParserTest.InfoReader.read("idea-newChannel.xml"), settings);

  final CheckForUpdateResult result = strategy.checkForUpdates();
  Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());
  final BuildInfo update = result.getNewBuildInSelectedChannel();
  Assert.assertNotNull(update);
  Assert.assertEquals("95.627", update.getNumber().toString());

  final UpdateChannel newChannel = result.getChannelToPropose();
  Assert.assertNotNull(newChannel);
  Assert.assertEquals("IDEA10EAP", newChannel.getId());
  Assert.assertEquals("IntelliJ IDEA X EAP", newChannel.getName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UpdateStrategyTest.java


示例13: initComponent

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Override
  public void initComponent() {
    LOG.info("Lombok plugin initialized for IntelliJ");

    final LombokSettings settings = LombokSettings.getInstance();
    updated = !Version.PLUGIN_VERSION.equals(settings.getVersion());
    if (updated) {
      settings.setVersion(Version.PLUGIN_VERSION);
    }

    final boolean unitTestMode = ApplicationManager.getApplication().isUnitTestMode();
    if (unitTestMode || settings.isEnableRuntimePatch()) {
      LOG.info("Runtime path support is enabled");
      injectAgent();
    } else {
      LOG.info("Runtime path support is disabled");
    }

    final BuildNumber currentBuild = ApplicationInfo.getInstance().getBuild();
    if (currentBuild.getBaselineVersion() < 173) {
//    Overwrite IntelliJ Diamond inspection, to filter out val declarations only for IntelliJ < 2017.3
      addCustomDiamondInspectionExtension();
    }
  }
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:25,代码来源:LombokPluginApplicationComponent.java


示例14: getStackTraceAsString

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public static String getStackTraceAsString(Throwable throwable) {
    StringWriter stringWriter = new StringWriter();
    throwable.printStackTrace(new PrintWriter(stringWriter));
    BuildNumber number = ApplicationInfo.getInstance().getBuild();
    stringWriter.append("\n").append("BuildNumber:").append(number.asString());
    return stringWriter.toString();
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:8,代码来源:StringUtils.java


示例15: main

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public static void main(String[] args) {
    BuildNumber number = ApplicationInfo.getInstance().getBuild();
    // IU-171.4249.39
    System.out.println(number.asString());
    // IU
    System.out.println(number.getProductCode());
    // 171
    System.out.println(number.getBaselineVersion());
    // 171.4249.39
    System.out.println(number.asStringWithoutProductCode());
    System.out.println(number.asStringWithoutProductCodeAndSnapshot());
    // false
    System.out.println(number.isSnapshot());
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:15,代码来源:BuildNumberTest.java


示例16: BuildInfo

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public BuildInfo(Element node) {
  myNumber = BuildNumber.fromString(node.getAttributeValue("number"));

  String apiVersion = node.getAttributeValue("apiVersion");
  if (apiVersion != null) {
    myApiVersion = BuildNumber.fromString(apiVersion, myNumber.getProductCode());
  }
  else {
    myApiVersion = myNumber;
  }

  myVersion = node.getAttributeValue("version");

  Element messageTag = node.getChild("message");
  myMessage = messageTag != null ? messageTag.getValue() : "";

  Date releaseDate = null;
  final String date = node.getAttributeValue("releaseDate");
  if (date != null) {
    try {
      releaseDate = new SimpleDateFormat("yyyyMMdd", Locale.US).parse(date);
    }
    catch (ParseException e) {
      Logger.getInstance(BuildInfo.class).info("Failed to parse build release date " + date);
    }
  }
  myReleaseDate = releaseDate;

  myPatches = new ArrayList<PatchInfo>();
  for (Object patchNode : node.getChildren("patch")) {
    myPatches.add(new PatchInfo((Element)patchNode));
  }
  
  myButtons = new ArrayList<ButtonInfo>();
  for (Object buttonNode : node.getChildren("button")) {
    myButtons.add(new ButtonInfo((Element) buttonNode));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:BuildInfo.java


示例17: findPatchForBuild

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
@Nullable
public PatchInfo findPatchForBuild(BuildNumber currentBuild) {
  for (PatchInfo each : myPatches) {
    if (each.isAvailable() && each.getFromBuild().asStringWithoutProductCode().equals(currentBuild.asStringWithoutProductCode())) {
      return each;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:BuildInfo.java


示例18: PatchInfo

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
public PatchInfo(Element node) {
  myFromBuild = BuildNumber.fromString(node.getAttributeValue("from"));
  mySize = node.getAttributeValue("size");

  String excluded = node.getAttributeValue("exclusions");
  if (excluded != null) {
    myExcludedOSes.addAll(ContainerUtil.map(StringUtil.split(excluded, ","), new Function<String, String>() {
      @Override
      public String fun(String s) {
        return s.trim();
      }
    }));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PatchInfo.java


示例19: UpdateStrategy

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
/** @deprecated use {@link #UpdateStrategy(int, BuildNumber, UpdatesInfo, UserUpdateSettings, UpdateStrategyCustomization)} */
@SuppressWarnings("unused")
public UpdateStrategy(int majorVersion,
                      @NotNull BuildNumber currentBuild,
                      @NotNull UpdatesInfo updatesInfo,
                      @NotNull UserUpdateSettings updateSettings) {
  this(majorVersion, currentBuild, updatesInfo, updateSettings, UpdateStrategyCustomization.getInstance());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:UpdateStrategy.java


示例20: PluginDownloader

import com.intellij.openapi.util.BuildNumber; //导入依赖的package包/类
private PluginDownloader(@NotNull String pluginId,
                         @NotNull String pluginUrl,
                         @Nullable String pluginName,
                         @Nullable String pluginVersion,
                         @Nullable BuildNumber buildNumber) {
  myPluginId = pluginId;
  myPluginUrl = pluginUrl;
  myPluginVersion = pluginVersion;
  myPluginName = pluginName;
  myBuildNumber = buildNumber;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PluginDownloader.java



注:本文中的com.intellij.openapi.util.BuildNumber类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormulaParseException类代码示例发布时间:2022-05-22
下一篇:
Java OpenIdService类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap