Java 类org.gradle.api.file.DuplicatesStrategy 实例源码

项目:Pushjet-Android    文件:DefaultFileCopyDetails.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return this.duplicatesStrategy;
}
项目:Reer    文件:DefaultCopySpec.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    if (duplicatesStrategy != null) {
        return duplicatesStrategy;
    }
    if (parentResolver != null) {
        return parentResolver.getDuplicatesStrategy();
    }
    return DuplicatesStrategy.INCLUDE;
}
项目:Reer    文件:DuplicateHandlingCopyActionDecorator.java   
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);
                }
            });
        }
    });
}
项目:gradle-plugins    文件:WarOverlay.java   
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");
}
项目:gradle-plugins    文件:WarOverlay.java   
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");
}
项目:Pushjet-Android    文件:DuplicateHandlingCopyActionDecorator.java   
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);
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:DuplicateHandlingCopyActionDecorator.java   
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);
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:NormalizingCopyActionDecorator.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    throw new UnsupportedOperationException();
}
项目:nw-gradle    文件:NWEjbPlugin.java   
/**
 * 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
        }
      }
    }
  });
}
项目:Reer    文件:AbstractCopyTask.java   
/**
 * {@inheritDoc}
 */
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    getRootSpec().setDuplicatesStrategy(strategy);
}
项目:Reer    文件:AbstractCopyTask.java   
/**
 * {@inheritDoc}
 */
@Internal
public DuplicatesStrategy getDuplicatesStrategy() {
    return getRootSpec().getDuplicatesStrategy();
}
项目:Reer    文件:SingleParentCopySpec.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return buildResolverRelativeToParent(parentResolver).getDuplicatesStrategy();
}
项目:Reer    文件:DefaultFileCopyDetails.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    this.duplicatesStrategy = strategy;
}
项目:Reer    文件:DefaultFileCopyDetails.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return this.duplicatesStrategy;
}
项目:Reer    文件:CopySpecWrapper.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return delegate.getDuplicatesStrategy();
}
项目:Reer    文件:CopySpecWrapper.java   
public void setDuplicatesStrategy(@Nullable DuplicatesStrategy strategy) {
    delegate.setDuplicatesStrategy(strategy);
}
项目:Reer    文件:DefaultCopySpec.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return buildRootResolver().getDuplicatesStrategy();
}
项目:Reer    文件:DefaultCopySpec.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    this.duplicatesStrategy = strategy;
}
项目:Reer    文件:DelegatingCopySpecInternal.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return getDelegateCopySpec().getDuplicatesStrategy();
}
项目:Reer    文件:DelegatingCopySpecInternal.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    getDelegateCopySpec().setDuplicatesStrategy(strategy);
}
项目:Reer    文件:NormalizingCopyActionDecorator.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    throw new UnsupportedOperationException();
}
项目:Reer    文件:NormalizingCopyActionDecorator.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    throw new UnsupportedOperationException();
}
项目:Pushjet-Android    文件:SingleParentCopySpec.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return buildResolverRelativeToParent(parentResolver).getDuplicatesStrategy();
}
项目:Pushjet-Android    文件:DefaultFileCopyDetails.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    this.duplicatesStrategy = strategy;
}
项目:Pushjet-Android    文件:NormalizingCopyActionDecorator.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    throw new UnsupportedOperationException();
}
项目:Pushjet-Android    文件:NormalizingCopyActionDecorator.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    throw new UnsupportedOperationException();
}
项目:Pushjet-Android    文件:DefaultFileCopyDetails.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    this.duplicatesStrategy = strategy;
}
项目:Pushjet-Android    文件:DefaultFileCopyDetails.java   
public DuplicatesStrategy getDuplicatesStrategy() {
    return this.duplicatesStrategy;
}
项目:Pushjet-Android    文件:NormalizingCopyActionDecorator.java   
public void setDuplicatesStrategy(DuplicatesStrategy strategy) {
    throw new UnsupportedOperationException();
}
项目:jmh-gradle-plugin    文件:JMHPluginExtension.java   
public DuplicatesStrategy getDuplicateClassesStrategy() {
    return duplicateClassesStrategy;
}
项目:jmh-gradle-plugin    文件:JMHPluginExtension.java   
public void setDuplicateClassesStrategy(DuplicatesStrategy duplicateClassesStrategy) {
    this.duplicateClassesStrategy = duplicateClassesStrategy;
}