Package org.apache.maven.shared.model.fileset

Examples of org.apache.maven.shared.model.fileset.FileSet


        if ( workingDirectory.exists() )
        {
            getLogger().debug( "Cleaning working directory " + workingDirectory.getAbsolutePath() );

            FileSetManager fileSetManager = new FileSetManager();
            FileSet fileSet = new FileSet();
            fileSet.setDirectory( workingDirectory.getPath() );
            fileSet.addInclude( "**/**" );
            // TODO : this with a configuration option somewhere ?
            fileSet.setFollowSymlinks( false );
            fileSetManager.delete( fileSet );
        }
    }
View Full Code Here


  }

  private String[] getIncludedFiles(String absPath, String[] excludes,
      String[] includes) {
    FileSetManager fileSetManager = new FileSetManager();
    FileSet fs = new FileSet();
    fs.setDirectory(absPath);
    fs.setFollowSymlinks(false);
    for (String include : includes) {
      fs.addInclude(include);
    }
    for (String exclude : excludes) {
      fs.addExclude(exclude);
    }
    return fileSetManager.getIncludedFiles(fs);
  }
View Full Code Here

    final TestingClient testingClient;
    testingClient = new TestingClient(runner,context, new ClassPathResolver(
        Thread.currentThread().getContextClassLoader()));

    final String baseDirectory = System.getProperty("user.dir");
    final FileSet tests = new FileSet();

    tests.setDirectory(baseDirectory + "/src/test/resources/org/moyrax/");
    tests.addInclude("**/*.html");

    context.setFiles(tests.getDirectory(),
        fileSetManager.getIncludedFiles(tests),
        fileSetManager.getExcludedFiles(tests));

    context.setLookupPackages(new String[] {
        "classpath:/org/moyrax/javascript/common/**"
 
View Full Code Here

  @Test
  public void testExecute() throws Exception {
    final QUnitPlugin runner = new QUnitPlugin();

    final String baseDirectory = System.getProperty("user.dir");
    final FileSet tests = new FileSet();

    tests.setDirectory(baseDirectory + "/src/test/resources/org/moyrax/");
    tests.addInclude("**/*test.html");

    MavenProject project = createMock(MavenProject.class);
    Artifact artifact = createMock(Artifact.class);
    ArtifactFactory artifactFactory = createMock(ArtifactFactory.class);
    ArtifactResolver artifactResolver = createMock(ArtifactResolver.class);
View Full Code Here

    Validate.notNull(baseDirectory, "The parameter baseDirectory cannot be " +
        "null.");
    Validate.notNull(baseDirectory, "The parameter includes cannot be null.");
    Validate.notNull(baseDirectory, "The parameter excludes cannot be null.");

    final FileSet fileSet = new FileSet();

    fileSet.setDirectory(baseDirectory);

    for (int i = 0, j = includes.length; i < j; i++) {
      fileSet.addInclude(includes[i]);
    }

    for (int i = 0, j = excludes.length; i < j; i++) {
      fileSet.addExclude(excludes[i]);
    }

    contextPath.add(new Entry(fileSet));
  }
View Full Code Here

            return;
        }

        FileSetManager fileSetManager = new FileSetManager();

        FileSet fileset = new FileSet();
        fileset.setDirectory( checkoutDirectory.getAbsolutePath() );
        fileset.setIncludes( excludes );//revert the order to do the delete
        fileset.setExcludes( includes );
        fileset.setUseDefaultExcludes( false );

        try
        {
            fileSetManager.delete( fileset );
        }
View Full Code Here

      getLog().info("generating sources into: " + generatedSourcesDirectory.getPath());
      getLog().debug("created " + generatedSourcesDirectory.mkdirs());
    }

    if (properties == null) {
      properties = new FileSet();
      properties.setDirectory(resourceDirectory.getAbsolutePath());
      properties.addInclude("**/*.properties");
    }

    FileLocations config = new FileLocations();
View Full Code Here

  }

  private String[] getIncludedFiles(String absPath, String[] excludes,
      String[] includes) {
    FileSetManager fileSetManager = new FileSetManager();
    FileSet fs = new FileSet();
    fs.setDirectory(absPath);
    fs.setFollowSymlinks(false);
   
    //exclude imports directory since it has already been compiled.
    if (imports != null) {
      String importExclude = null;

      for (String importFile : this.imports) {
        File file = new File(importFile);

        if (file.isDirectory()) {
          importExclude = file.getName() + "/**";
        } else if (file.isFile()) {
          importExclude = "**/" + file.getName();
        }

        fs.addExclude(importExclude);
      }
    }
    for (String include : includes) {
      fs.addInclude(include);
    }
    for (String exclude : excludes) {
      fs.addExclude(exclude);
    }
    return fileSetManager.getIncludedFiles(fs);
  }
View Full Code Here

        File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
   
        if ( workingDirectory.exists() )
        {
            FileSetManager fileSetManager = new FileSetManager();
            FileSet fileSet = new FileSet();
            fileSet.setDirectory( workingDirectory.getPath() );
            fileSet.addInclude( "**/**" );
            // TODO : this with a configuration option somewhere ?
            fileSet.setFollowSymlinks( false );
            fileSetManager.delete( fileSet );
        }
    }
View Full Code Here

            return;
        }

        FileSetManager fileSetManager = new FileSetManager();

        FileSet fileset = new FileSet();
        fileset.setDirectory( checkoutDirectory.getAbsolutePath() );
        fileset.setIncludes( excludes ); // revert the order to do the delete
        fileset.setExcludes( includes );
        fileset.setUseDefaultExcludes( false );

        try
        {
            fileSetManager.delete( fileset );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.model.fileset.FileSet

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.