gpt4 book ai didi

org.shipkit.internal.comparison.ZipComparator.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 21:36:31 27 4
gpt4 key购买 nike

本文整理了Java中org.shipkit.internal.comparison.ZipComparator.<init>()方法的一些代码示例,展示了ZipComparator.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipComparator.<init>()方法的具体详情如下:
包路径:org.shipkit.internal.comparison.ZipComparator
类名称:ZipComparator
方法名:<init>

ZipComparator.<init>介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

@TaskAction public void comparePublications() {
  if(previousVersion == null){
    getLogger().lifecycle("{} - previousVersion is not set, nothing to compare", getPath());
    publicationsEqual = false;
    return;
  }
  GenerateMavenPom pomTask = (GenerateMavenPom) getProject().getTasks().getByName(pomTaskName);
  //TODO let's add decent validation and descriptive error messages to the user
  assert pomTask.getDestination().isFile();
  assert sourcesJar.getArchivePath().isFile();
  File currentVersionPomFile = pomTask.getDestination();
  File currentVersionSourcesJarFile = sourcesJar.getArchivePath();
  getLogger().lifecycle("{} - about to compare publications, for versions {} and {}",
        getPath(), previousVersion, currentVersion);
  PomComparator pomComparator = new PomComparator(projectGroup, previousVersion, currentVersion);
  Diff pomsDiff = pomComparator.areEqual(previousVersionPomFile, currentVersionPomFile);
  getLogger().lifecycle("{} - pom files equal: {}", getPath(), pomsDiff.areFilesEqual());
  ZipComparator sourcesJarComparator = new ZipComparator();
  Diff jarsDiff = sourcesJarComparator.areEqual(previousVersionSourcesJarFile, currentVersionSourcesJarFile);
  getLogger().lifecycle("{} - source jars equal: {}", getPath(), jarsDiff.areFilesEqual());
  differences.add(jarsDiff);
  differences.add(pomsDiff);
  this.publicationsEqual = jarsDiff.areFilesEqual() && pomsDiff.areFilesEqual();
}

代码示例来源:origin: org.shipkit/shipkit

public void comparePublications(ComparePublicationsTask task) {
  if (!task.getPreviousSourcesJar().exists()) {
    LOG.lifecycle("{} - previous publications not found, nothing to compare, skipping", task.getPath());
    return;
  }
  //TODO let's add decent validation and descriptive error messages to the user
  assert task.getSourcesJar().getArchivePath().isFile();
  File currentVersionSourcesJarFile = task.getSourcesJar().getArchivePath();
  LOG.lifecycle("{} - about to compare publications",
      task.getPath());
  Diff depInfoDiff = getDependencyInfoDiff(task, currentVersionSourcesJarFile);
  LOG.lifecycle("{} - {} files equal: {}", task.getPath(), DEPENDENCY_INFO_FILEPATH, depInfoDiff.areFilesEqual());
  ZipComparator sourcesJarComparator = new ZipComparator();
  Diff jarsDiff = sourcesJarComparator.areEqual(task.getPreviousSourcesJar(), currentVersionSourcesJarFile);
  LOG.lifecycle("{} - source jars equal: {}", task.getPath(), jarsDiff.areFilesEqual());
  String comparisonResult = new ComparePublicationsResultFormatter().formatResults(
    task.getPreviousSourcesJar(), currentVersionSourcesJarFile, jarsDiff, depInfoDiff);
  LOG.lifecycle("{} - You can find detailed publication comparison results in file {}.", task.getPath(), task.getComparisonResult());
  IOUtil.writeFile(task.getComparisonResult(), comparisonResult);
}

代码示例来源:origin: mockito/shipkit

public void comparePublications(ComparePublicationsTask task) {
  if (!task.getPreviousSourcesJar().exists()) {
    LOG.lifecycle("{} - previous publications not found, nothing to compare, skipping", task.getPath());
    return;
  }
  //TODO let's add decent validation and descriptive error messages to the user
  assert task.getSourcesJar().getArchivePath().isFile();
  File currentVersionSourcesJarFile = task.getSourcesJar().getArchivePath();
  LOG.lifecycle("{} - about to compare publications",
      task.getPath());
  Diff depInfoDiff = getDependencyInfoDiff(task, currentVersionSourcesJarFile);
  LOG.lifecycle("{} - {} files equal: {}", task.getPath(), DEPENDENCY_INFO_FILEPATH, depInfoDiff.areFilesEqual());
  ZipComparator sourcesJarComparator = new ZipComparator();
  Diff jarsDiff = sourcesJarComparator.areEqual(task.getPreviousSourcesJar(), currentVersionSourcesJarFile);
  LOG.lifecycle("{} - source jars equal: {}", task.getPath(), jarsDiff.areFilesEqual());
  String comparisonResult = new ComparePublicationsResultFormatter().formatResults(
    task.getPreviousSourcesJar(), currentVersionSourcesJarFile, jarsDiff, depInfoDiff);
  LOG.lifecycle("{} - You can find detailed publication comparison results in file {}.", task.getPath(), task.getComparisonResult());
  IOUtil.writeFile(task.getComparisonResult(), comparisonResult);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com