Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.Scanner


    private Set<File> getJavaFiles(File directory) {
        String[] filters = ALL_JAVA_FILES_FILTER;

        Set<File> files = new HashSet<File>();
        // support for incremental build in m2e context
        Scanner scanner = buildContext.newScanner(directory);
        scanner.setIncludes(filters);
        scanner.scan();

        String[] includedFiles = scanner.getIncludedFiles();
        if (includedFiles != null) {
            for (String includedFile : includedFiles) {
                files.add(new File(scanner.getBasedir(), includedFile));
            }
        }
        return files;
    }
View Full Code Here


                 * content and unconditionally re-compile all resource files as soon as at least one file has
                 * been modified. This is okay for now since changes in resource files are rare and compiling
                 * them is very fast.
                 */
                if (isIncremental) {
                    Scanner scanner = buildContext.newScanner(directory);
                    scanner.setIncludes(PROPERTIES_PATTERN);
                    scanner.scan();
                    final String[] includedFiles = scanner.getIncludedFiles();
                    if (includedFiles == null || includedFiles.length == 0) {
                        continue;
                    }
                }
                javaDirectoryFile = directory;
View Full Code Here

    if (notCleanFullBuild(kind)) {
      Collection<String> includedFiles = new ArrayList<String>();
      // check if any of the web resource files changed
      for (File source : sources){
        // TODO also analyze output classes folders as wro4j can use classpath files
        Scanner ds = currentBuildContext.newScanner(source); // delta or full scanner
        ds.scan();
        includedFiles.addAll(Arrays.asList(ds.getIncludedFiles()));
      }
      if (isPomModified() || interestingFileChangeDetected(includedFiles, WRO4J_FILES_PATTERN)) {
        //treat as new full build as wro4j only checks for classic resources changes during    incremental builds
        IProject project = getMavenProjectFacade().getProject();
      currentBuildContext = new CleanBuildContext(originalBuildContext);
View Full Code Here

        if (!outputDirectory.exists()) {
            outputDirectory.mkdirs();
        }

        Scanner fileScanner = context.newScanner(sourceDirectory, true);
        fileScanner.setIncludes(includes);
        fileScanner.setExcludes(excludes);
        fileScanner.scan();
        File basedir = fileScanner.getBasedir();

        List<File> changedFiles = new ArrayList<File>();
        for (String fileName : fileScanner.getIncludedFiles()) {
            File file = new File(basedir, fileName);
            changedFiles.add(file);
            context.removeMessages(file);
        }
        if (!changedFiles.isEmpty()) {
View Full Code Here

   * Scans for the COFFEE sources that should be compiled.
   *
   * @return The list of COFFEE sources.
   */
  protected String[] getIncludedFiles() {
    Scanner scanner = buildContext.newScanner(sourceDirectory, true);
    scanner.setIncludes(includes);
    scanner.setExcludes(excludes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

   * Scans for the LESS sources that should be compiled.
   *
   * @return The list of LESS sources.
   */
  protected String[] getIncludedFiles() {
    Scanner scanner = buildContext.newScanner(sourceDirectory, true);
    scanner.setIncludes(includes);
    scanner.setExcludes(excludes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

   * @return list of relative paths
   */
  protected String[] contextChanged(final File folder,
      final String... includes) {
    final boolean ignoreDelta = !buildContext.isIncremental();
    final Scanner scanner = buildContext.newScanner(folder, ignoreDelta);
    scanner.setIncludes(includes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

   *
   * @return list of relative paths
   */
  protected String[] contextDeleted(final File folder,
      final String... includes) {
    final Scanner scanner = buildContext.newDeleteScanner(folder);
    scanner.setIncludes(includes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

   * @return list of relative paths
   */
  protected String[] contextChanged(final File folder,
      final String... includes) {
    final boolean ignoreDelta = !buildContext.isIncremental();
    final Scanner scanner = buildContext.newScanner(folder, ignoreDelta);
    scanner.setIncludes(includes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

   *
   * @return list of relative paths
   */
  protected String[] contextDeleted(final File folder,
      final String... includes) {
    final Scanner scanner = buildContext.newDeleteScanner(folder);
    scanner.setIncludes(includes);
    scanner.scan();
    return scanner.getIncludedFiles();
  }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.Scanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.