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

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


        return scanner;
    }

    protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding )
    {
        SourceInclusionScanner scanner = null;

        // it's not defined if we get the ending with or without the dot '.'
        String defaultIncludePattern = "**/*" + ( inputFileEnding.startsWith( "." ) ? "" : "." ) + inputFileEnding;

        if ( includes.isEmpty() && excludes.isEmpty() )
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

        projectArtifact.setFile(outputDirectory);
    }

    protected SourceInclusionScanner getSourceInclusionScanner(int staleMillis)
    {
        SourceInclusionScanner scanner = null;

        if (includes.isEmpty() && excludes.isEmpty()) {
            scanner = new StaleSourceScanner(staleMillis);
        } else {
            if (includes.isEmpty()) {
View Full Code Here

    }

    protected SourceInclusionScanner getSourceInclusionScanner(
            String inputFileEnding)
    {
        SourceInclusionScanner scanner = null;

        if (includes.isEmpty() && excludes.isEmpty()) {
            includes = Collections.singleton("**/*." + inputFileEnding);
            scanner = new SimpleSourceInclusionScanner(includes,
                    Collections.EMPTY_SET);
View Full Code Here

     * exclusion patterns. In our case at hand we include only Java sources as these are the only files we want
     * to instrument.
     */
    private SourceInclusionScanner getScanner()
    {
        SourceInclusionScanner scanner;
        Set includes = getConfiguration().getIncludes();
        Set excludes = getConfiguration().getExcludes();

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

        // Note: we shouldn't have to do this but this is a limitation of the Plexus SimpleSourceInclusionScanner
        scanner.addSourceMapping( new SuffixMapping( "dummy", "dummy" ) );

        return scanner;
    }
View Full Code Here

        return scanner;
    }

    private SourceInclusionScanner getExcludesScanner()
    {
        SourceInclusionScanner scanner;
        Set excludes = getConfiguration().getExcludes();

        if ( excludes.isEmpty() )
        {
            scanner = new SimpleSourceInclusionScanner( Collections.EMPTY_SET, Collections.EMPTY_SET );
        }
        else
        {
            scanner = new SimpleSourceInclusionScanner( excludes, Collections.EMPTY_SET );
        }

        // Note: we shouldn't have to do this but this is a limitation of the Plexus SimpleSourceInclusionScanner
        scanner.addSourceMapping( new SuffixMapping( "dummy", "dummy" ) );

        return scanner;
    }
View Full Code Here

        projectArtifact.setFile( outputDirectory );
    }

    protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis )
    {
        SourceInclusionScanner scanner = null;

        if ( includes.isEmpty() && excludes.isEmpty() )
        {
            scanner = new StaleSourceScanner( staleMillis );
        }
View Full Code Here

        return scanner;
    }

    protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding )
    {
        SourceInclusionScanner scanner = null;

        if ( includes.isEmpty() && excludes.isEmpty() )
        {
            includes = Collections.singleton( "**/*." + inputFileEnding );
            scanner = new SimpleSourceInclusionScanner( includes, Collections.EMPTY_SET );
View Full Code Here

    {
        getClassDirectory().mkdirs();

        try
        {
            SourceInclusionScanner scanner = new StaleSourceScanner( staleMillis, getIncludes(), excludes );
            if ( getTimestampDirectory().exists() )
            {
                scanner.addSourceMapping( new SingleTargetSourceMapping( ".class", getTimestampFile().getPath() ) );
            }
            else
            {
                scanner.addSourceMapping( new SuffixMapping( ".class", ".dummy" ) );
            }

            Set classes = scanner.getIncludedSources( getClassDirectory(), getTimestampDirectory() );

            if ( !classes.isEmpty() )
            {
                Set files = new HashSet();
                for ( Iterator i = classes.iterator(); i.hasNext(); )
View Full Code Here

TOP

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

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.