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

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


   
    if(includes.isEmpty()) {
      includes.add("**/*.*"); // if no include is specified, include everything
    }
   
    SourceInclusionScanner scanner = new SimpleSourceInclusionScanner(includes, excludes);

    // Note: we must declare a dummy "source mapping", or the Plexus SimpleSourceInclusionScanner won't work
    // (as per http://maven.apache.org/plugins/maven-clover-plugin/2.4/xref/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.html )
    scanner.addSourceMapping( new SuffixMapping( "dummy", "dummy" ) );

    try {
      outputManifestFile.getParentFile().mkdirs();
      outputManifestFile.createNewFile(); // create it if it doesn't yet exist
    } catch (IOException e) {
      getLog().error("IOException creating manifest file: " + outputManifestFile.toString(), e);
      return;
    }
   
    try {
      // the manifest looks much nicer sorted - sort the set
      SortedSet<File> includedFiles = new TreeSet<File>((Set<File>)scanner.getIncludedSources(inputDirectory, null));
     
      Writer w = new BufferedWriter(new FileWriter(outputManifestFile));

      // build the header
      w.write("CACHE MANIFEST\n\n");
View Full Code Here


     * in the {@link #nodePackage} attribute.
     */
    private Set searchNodeFiles() throws MojoExecutionException {
        final SuffixMapping mapping    = new SuffixMapping(".java", ".java");
        final SuffixMapping mappingCAP = new SuffixMapping(".JAVA", ".JAVA");
        final SourceInclusionScanner scanner = new StaleSourceScanner(staleMillis);
        scanner.addSourceMapping(mapping);
        scanner.addSourceMapping(mappingCAP);
        File directory = new File(nodeDirectory);
        if (nodePackage!=null && nodePackage.trim().length()!=0) {
            directory = new File(directory, nodePackage.replace('.', '/'));
        }
        if (!directory.isDirectory()) {
            return Collections.EMPTY_SET;
        }
        final File outDir = new File(timestampDirectory);
        try {
            return scanner.getIncludedSources(directory, outDir);
        } catch (InclusionScanException e) {
            throw new MojoExecutionException("Error scanning \"" + directory.getPath() +
                                             "\" for Node.java to copy.", e);
        }
    }
View Full Code Here

            throws MojoExecutionException
    {
        final String        extCAP     = ext.toUpperCase();
        final SuffixMapping mapping    = new SuffixMapping(ext,    ext);
        final SuffixMapping mappingCAP = new SuffixMapping(extCAP, extCAP);
        final SourceInclusionScanner scanner = new StaleSourceScanner(staleMillis);
        scanner.addSourceMapping(mapping);
        scanner.addSourceMapping(mappingCAP);
        final File outDir = new File(timestampDirectory);
        try {
            return scanner.getIncludedSources(sourceDir, outDir);
        } catch (InclusionScanException e) {
            throw new MojoExecutionException("Error scanning source root \"" + sourceDir.getPath() +
                                             "\" for stale grammars to reprocess.", e);
        }
    }
View Full Code Here

        {
            // see MCOMPILER-199 GroovyEclipseCompiler doesn't set inputFileEnding
            // so we can presume it's all files from the source directory
            inputFileEnding = ".*";
        }
        SourceInclusionScanner scanner = getSourceInclusionScanner( inputFileEnding );

        SourceMapping mapping = getSourceMapping( compilerConfiguration, compiler );

        scanner.addSourceMapping( mapping );

        Set<File> compileSources = new HashSet<File>();

        for ( String sourceRoot : getCompileSourceRoots() )
        {
            File rootFile = new File( sourceRoot );

            if ( !rootFile.isDirectory() )
            {
                continue;
            }

            try
            {
                compileSources.addAll( scanner.getIncludedSources( rootFile, null ) );
            }
            catch ( InclusionScanException e )
            {
                throw new MojoExecutionException(
                    "Error scanning source root: \'" + sourceRoot + "\' for stale files to recompile.", e );
View Full Code Here

        return outputDirectory;
    }

    protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis )
    {
        SourceInclusionScanner scanner;

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

        return scanner;
    }

    protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding )
    {
        SourceInclusionScanner scanner;

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

        if ( testIncludes.isEmpty() && testExcludes.isEmpty() )
View Full Code Here

        }
    }

    protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis )
    {
        SourceInclusionScanner scanner;

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

        return scanner;
    }

    protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding )
    {
        SourceInclusionScanner scanner;

        // 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

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.