private void excludeDockerfile(DefaultFileSet fileSet, File dockerFile) { ArrayList<String> excludes = fileSet.getExcludes() != null ? new ArrayList<>(Arrays.asList(fileSet.getExcludes())) : new ArrayList<String>(); excludes.add(dockerFile.getName()); fileSet.setExcludes(excludes.toArray(new String[0])); }
private void addDockerExcludes(DefaultFileSet fileSet, MojoParameters params) throws IOException { File directory = fileSet.getDirectory(); List<String> excludes = new ArrayList<>(); // Output directory will be always excluded excludes.add(params.getOutputDirectory() + "/**"); for (String file : new String[] { DOCKER_EXCLUDE, DOCKER_IGNORE } ) { File dockerIgnore = new File(directory, file); if (dockerIgnore.exists()) { excludes.addAll(Arrays.asList(FileUtils.fileReadArray(dockerIgnore))); excludes.add(DOCKER_IGNORE); } } fileSet.setExcludes(excludes.toArray(new String[0])); }
/** * Adds a directory to a {@link JarArchiver} with a directory prefix. * * @param jarArchiver * @param directory The directory to add. * @param prefix An optional prefix for where in the Jar file the directory's contents should go. */ protected void addDirectory( JarArchiver jarArchiver, File directory, String prefix ) { if ( directory != null && directory.exists() ) { final DefaultFileSet fileSet = new DefaultFileSet(); fileSet.setPrefix( endWithSlash( prefix ) ); fileSet.setDirectory( directory ); // XXX: trying to avoid duplicated sources fileSet.setExcludes( new String[] { "**/R.java", "**/BuildConfig.java" } ); jarArchiver.addFileSet( fileSet ); getLog().debug( "Added files from " + directory ); } }
private void addDockerIgnoreIfPresent(DefaultFileSet fileSet) throws IOException { File directory = fileSet.getDirectory(); File dockerIgnore = new File(directory, DOCKER_IGNORE); if (dockerIgnore.exists()) { ArrayList<String> excludes = new ArrayList<>(Arrays.asList(FileUtils.fileReadArray(dockerIgnore))); excludes.add(DOCKER_IGNORE); fileSet.setExcludes(excludes.toArray(new String[excludes.size()])); } }
protected FileSet getFileSet( File basedir, List<String> includes, List<String> excludes ) { DefaultFileSet fileSet = new DefaultFileSet(); fileSet.setDirectory( basedir ); fileSet.setIncludes( includes.toArray( new String[includes.size()] ) ); Set<String> allExcludes = new LinkedHashSet<String>(); if ( excludes != null ) { allExcludes.addAll( excludes ); } if ( useDefaultSourceExcludes ) { allExcludes.addAll( Arrays.asList( AbstractScanner.DEFAULTEXCLUDES ) ); } fileSet.setExcludes( allExcludes.toArray( new String[allExcludes.size()] ) ); return fileSet; }
protected FileSet getFileSet( File basedir, List<String> includes, List<String> excludes ) { DefaultFileSet fileSet = new DefaultFileSet(); fileSet.setDirectory( basedir ); fileSet.setIncludes( includes.toArray( new String[includes.size()] ) ); Set<String> allExcludes = new LinkedHashSet<String>(); if ( excludes != null ) { allExcludes.addAll( excludes ); } if ( useDefaultExcludes ) { allExcludes.addAll( Arrays.asList( AbstractScanner.DEFAULTEXCLUDES ) ); } fileSet.setExcludes( allExcludes.toArray( new String[allExcludes.size()] ) ); return fileSet; } }
/** * {@inheritDoc} */ @Override public void addDirectory( @Nonnull final File directory, final String[] includes, final String[] excludes ) { inPublicApi.set( Boolean.TRUE ); try { final DefaultFileSet fs = new DefaultFileSet(); fs.setDirectory( directory ); fs.setIncludes( includes ); fs.setExcludes( excludes ); fs.setPrefix( rootPrefix ); fs.setFileSelectors( selectors ); debug( "Adding directory file-set in: " + directory + " to archive location: " + fs.getPrefix() ); doAddFileSet( fs ); } finally { inPublicApi.set( null ); } }
brandingToken + "/**", } ); fs.setExcludes( new String[] { brandingToken + "/bin/*", } );
brandingToken + "/**", } ); fs.setExcludes( new String[] { brandingToken + "/bin/*", } );
/** * {@inheritDoc} */ @Override public void addDirectory( @Nonnull final File directory, final String prefix, final String[] includes, final String[] excludes ) { inPublicApi.set( Boolean.TRUE ); try { final DefaultFileSet fs = new DefaultFileSet(); fs.setDirectory( directory ); fs.setIncludes( includes ); fs.setExcludes( excludes ); fs.setPrefix( rootPrefix + prefix ); fs.setFileSelectors( selectors ); debug( "Adding directory file-set in: " + directory + " to archive location: " + fs.getPrefix() ); doAddFileSet( fs ); } finally { inPublicApi.set( null ); } }
dfs.setExcludes( newEx.toArray( new String[newEx.size()] ) ); dfs.setFileSelectors( fs.getFileSelectors() ); dfs.setIncludes( newIn.toArray( new String[newIn.size()] ) );
fileSet.setExcludes(new String[]{ "**/build/temp/**", "**/" + PACKAGES_DIRECTORY_NAME + SEPARATOR + getSenchaPackageName(SENCHA_APP_TEMPLATE_GROUP_ID, SENCHA_APP_TEMPLATE_ARTIFACT_ID) + "/**",
fileset.setPrefix( "" ); fileset.setIncludes( ia ); fileset.setExcludes( ea ); fileset.setIncludingEmptyDirectories( copier.getIncludeEmptyDirs() ); fileset.setUsingDefaultExcludes( !dontUseDefaultExcludes );
fileset.setPrefix( "" ); fileset.setIncludes( ia ); fileset.setExcludes( ea ); fileset.setIncludingEmptyDirectories( copier.getIncludeEmptyDirs() ); fileset.setUsingDefaultExcludes( !dontUseDefaultExcludes );
fs.setDirectory( directory ); fs.setIncludes( includesArray ); fs.setExcludes( excludesArray ); if ( transformer != null )
fs.setExcludes( excludesArray ); fs.setPrefix( outputLocation ); fs.setStreamTransformer( transformer );