• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DuplicatesStrategy类的典型用法和代码示例

java 1次浏览

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

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

示例1: getDuplicatesStrategy

点赞 3

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    return this.duplicatesStrategy;
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:4,
代码来源:DefaultFileCopyDetails.java

示例2: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    if (duplicatesStrategy != null) {
        return duplicatesStrategy;
    }
    if (parentResolver != null) {
        return parentResolver.getDuplicatesStrategy();
    }
    return DuplicatesStrategy.INCLUDE;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:10,
代码来源:DefaultCopySpec.java

示例3: execute

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visitedFiles = new HashSet<RelativePath>();

    return delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    if (!details.isDirectory()) {
                        DuplicatesStrategy strategy = details.getDuplicatesStrategy();

                        if (!visitedFiles.add(details.getRelativePath())) {
                            if (strategy == DuplicatesStrategy.EXCLUDE) {
                                return;
                            } else if (strategy == DuplicatesStrategy.FAIL) {
                                throw new DuplicateFileCopyingException(String.format("Encountered duplicate path \"%s\" during copy operation configured with DuplicatesStrategy.FAIL", details.getRelativePath()));
                            } else if (strategy == DuplicatesStrategy.WARN) {
                                LOGGER.warn("Encountered duplicate path \"{}\" during copy operation configured with DuplicatesStrategy.WARN", details.getRelativePath());
                            }
                        }
                    }

                    action.processFile(details);
                }
            });
        }
    });
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:28,
代码来源:DuplicateHandlingCopyActionDecorator.java

示例4: WarOverlay

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public WarOverlay(String name, War warTask) {
    this.name = name;
    this.warTask = warTask;
    this.warCopySpec = warTask.getRootSpec().addChild();

    warCopySpec.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
    exclude("META-INF/maven/**");
    exclude("META-INF/MANIFEST.MF");
}
 

开发者ID:freefair,
项目名称:gradle-plugins,
代码行数:10,
代码来源:WarOverlay.java

示例5: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    throw new UnsupportedOperationException();
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:4,
代码来源:NormalizingCopyActionDecorator.java

示例6: configureJarMetaInfCopy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
/**
 * Searches the project for the META-INF folder and configures it in the jar task.
 * Using an Action to run after all build.gradle sourceSets are processed.
 */
private void configureJarMetaInfCopy(final Project project) {
  project.getTasks().findByName("jar")
  .doFirst(new Action<Task>() {
    @Override
    public void execute(Task task) {
      Jar jarTask = (Jar)task;
      SourceSet mainSourceSet = DependenciesUtil.getMainSourceSet(project);

      Set<File> files = mainSourceSet.getAllSource().getFiles();
      boolean metaInfFound = false;
      boolean manifestFound = false;
      for (File file : files) {
        String path = file.getPath();
        if (!metaInfFound && path.contains(META_INF)) {
          metaInfFound = true;
          String metaInfPath = getMetaInfFolderInPath(path);
          jarTask.getMetaInf().from(metaInfPath)
          //jar creates its own metainf.mf first, so this would be a duplicate
          .exclude(MANIFEST_MF)
          .setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
        }
        else if (!manifestFound && path.contains(MANIFEST_MF)) {
          manifestFound = true;
          //tell jar to use our manifest instead of creating one
          jarTask.getManifest().from(path);
        }
        else if (metaInfFound && manifestFound) {
          break; //we found both. nothing else to do
        }
      }
    }
  });
}
 

开发者ID:r-murphy,
项目名称:nw-gradle,
代码行数:38,
代码来源:NWEjbPlugin.java

示例7: setDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    getRootSpec().setDuplicatesStrategy(strategy);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:7,
代码来源:AbstractCopyTask.java

示例8: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Internal
public DuplicatesStrategy getDuplicatesStrategy() {
    return getRootSpec().getDuplicatesStrategy();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:8,
代码来源:AbstractCopyTask.java

示例9: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    return buildResolverRelativeToParent(parentResolver).getDuplicatesStrategy();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:SingleParentCopySpec.java

示例10: setDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    this.duplicatesStrategy = strategy;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:DefaultFileCopyDetails.java

示例11: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    return delegate.getDuplicatesStrategy();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:CopySpecWrapper.java

示例12: setDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public void setDuplicatesStrategy(@Nullable DuplicatesStrategy strategy) {
    delegate.setDuplicatesStrategy(strategy);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:CopySpecWrapper.java

示例13: getDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicatesStrategy() {
    return getDelegateCopySpec().getDuplicatesStrategy();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:DelegatingCopySpecInternal.java

示例14: setDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    getDelegateCopySpec().setDuplicatesStrategy(strategy);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:DelegatingCopySpecInternal.java

示例15: setDuplicatesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    throw new UnsupportedOperationException();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:NormalizingCopyActionDecorator.java

示例16: getDuplicateClassesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public DuplicatesStrategy getDuplicateClassesStrategy() {
    return duplicateClassesStrategy;
}
 

开发者ID:melix,
项目名称:jmh-gradle-plugin,
代码行数:4,
代码来源:JMHPluginExtension.java

示例17: setDuplicateClassesStrategy

点赞 2

import org.gradle.api.file.DuplicatesStrategy; //导入依赖的package包/类
public void setDuplicateClassesStrategy(DuplicatesStrategy duplicateClassesStrategy) {
    this.duplicateClassesStrategy = duplicateClassesStrategy;
}
 

开发者ID:melix,
项目名称:jmh-gradle-plugin,
代码行数:4,
代码来源:JMHPluginExtension.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)