Package org.codehaus.plexus.compiler.util.scan

Examples of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner


  public void execute() throws MojoExecutionException, MojoFailureException {

    SourceInclusionScanner scanner = includeStale
            ? new StaleSourceScanner(1024, Collections.singleton("**/*." + extension), Collections.<String>emptySet())
            : new SimpleSourceInclusionScanner(Collections.singleton("**/*." + extension), Collections.<String>emptySet());

    scanner.addSourceMapping(new SuffixMapping("." + extension, "." + extension));

    MustacheFactory mustacheFactory = new DefaultMustacheFactory();
    try {
View Full Code Here


        // as this is autoscanned for importd grammars and so is auto-excluded from the
        // set of gramamr fiels we shuold be analyzing.
        //
        excludes.add("imports/**");

        SourceInclusionScanner scan = new SimpleSourceInclusionScanner(includes, excludes);

        scan.addSourceMapping(mapping);
        Set<File> grammarFiles = scan.getIncludedSources(sourceDirectory, null);

        if (grammarFiles.isEmpty()) {
            if (getLog().isInfoEnabled()) {
                getLog().info("No grammars to process");
            }
View Full Code Here

    }
  }

  private Set<File> collectIncludedSourceGrammars() throws MojoExecutionException {
    SourceMapping mapping = new SuffixMapping( "g", Collections.<String>emptySet() );
        SourceInclusionScanner scan = new SimpleSourceInclusionScanner( getIncludePatterns(), getExcludePatterns() );
        scan.addSourceMapping( mapping );
    try {
      return scan.getIncludedSources( sourceDirectory, null );
    }
    catch ( InclusionScanException e ) {
      throw new MojoExecutionException( "Error determining gUnit sources", e );
    }
  }
View Full Code Here

        // Now, to the excludes, we need to add the imports directory
        // as this is autoscanned for imported grammars and so is auto-excluded from the
        // set of grammar fields we should be analyzing.
        excludes.add("imports/**");

        SourceInclusionScanner scan = new SimpleSourceInclusionScanner(includes, excludes);
        scan.addSourceMapping(mapping);
        Set<File> grammarFiles = scan.getIncludedSources(sourceDirectory, null);

        if (grammarFiles.isEmpty()) {
            getLog().info("No grammars to process");
      return Collections.emptyList();
    }
View Full Code Here

        return namespaces;
    }

    protected SourceInclusionScanner getSourceInclusionScanner(boolean includeStale) {
        return includeStale
                ? new SimpleSourceInclusionScanner(Collections.singleton("**/*"), Collections.EMPTY_SET)
                : new StaleSourceScanner(1024);
    }
View Full Code Here

            excludes = new HashSet<String>();
        }

        if (includes.isEmpty() && excludes.isEmpty()) {
            includes = Collections.singleton("**/*Model.java");
            scanner = new SimpleSourceInclusionScanner(includes, excludes);
        } else {
            if (includes.isEmpty()) {
                includes = Collections.singleton("**/*Model.java");
            }
            scanner = new SimpleSourceInclusionScanner(includes, excludes);
        }
        scanner.addSourceMapping(new SourceMapping() {

            @SuppressWarnings("rawtypes")
            @Override
View Full Code Here

        String defaultIncludePattern = "**/*" + ( inputFileEnding.startsWith( "." ) ? "" : "." ) + inputFileEnding;

        if ( testIncludes.isEmpty() && testExcludes.isEmpty() )
        {
            testIncludes = Collections.singleton( defaultIncludePattern );
            scanner = new SimpleSourceInclusionScanner( testIncludes, Collections.<String>emptySet() );
        }
        else
        {
            if ( testIncludes.isEmpty() )
            {
                testIncludes.add( defaultIncludePattern );
            }
            scanner = new SimpleSourceInclusionScanner( testIncludes, testExcludes );
        }

        return scanner;
    }
View Full Code Here

        String defaultIncludePattern = "**/*" + ( inputFileEnding.startsWith( "." ) ? "" : "." ) + inputFileEnding;

        if ( includes.isEmpty() && excludes.isEmpty() )
        {
            includes = Collections.singleton( defaultIncludePattern );
            scanner = new SimpleSourceInclusionScanner( includes, Collections.<String>emptySet() );
        }
        else
        {
            if ( includes.isEmpty() )
            {
                includes.add( defaultIncludePattern );
            }
            scanner = new SimpleSourceInclusionScanner( includes, excludes );
        }

        return scanner;
    }
View Full Code Here

    }
  }

  private Set<File> collectIncludedSourceGrammars() throws MojoExecutionException {
    SourceMapping mapping = new SuffixMapping( "g", Collections.EMPTY_SET );
        SourceInclusionScanner scan = new SimpleSourceInclusionScanner( getIncludePatterns(), getExcludePatterns() );
        scan.addSourceMapping( mapping );
    try {
      Set scanResults = scan.getIncludedSources( sourceDirectory, null );
      Set<File> results = new HashSet<File>();
      for ( Object result : scanResults ) {
        if ( result instanceof File ) {
          results.add( ( File ) result );
        }
View Full Code Here

        // as this is autoscanned for importd grammars and so is auto-excluded from the
        // set of gramamr fiels we shuold be analyzing.
        //
        excludes.add("imports/**");

        SourceInclusionScanner scan = new SimpleSourceInclusionScanner(includes, excludes);

        scan.addSourceMapping(mapping);
        Set grammarFiles = scan.getIncludedSources(sourceDirectory, null);

        if (grammarFiles.isEmpty()) {
            if (getLog().isInfoEnabled()) {
                getLog().info("No grammars to process");
            }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner

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.