use of org.apache.tools.ant.types.FileSet in project hibernate-orm by hibernate.
the class SchemaUpdateTask method collectFiles.
private String[] collectFiles() {
List<String> files = new LinkedList<String>();
for (FileSet fileSet : fileSets) {
final DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());
final String[] dsFiles = ds.getIncludedFiles();
for (String dsFileName : dsFiles) {
File f = new File(dsFileName);
if (!f.isFile()) {
f = new File(ds.getBasedir(), dsFileName);
}
files.add(f.getAbsolutePath());
}
}
return ArrayHelper.toStringArray(files);
}
use of org.apache.tools.ant.types.FileSet in project hibernate-orm by hibernate.
the class SchemaValidatorTask method collectFiles.
private String[] collectFiles() {
List<String> files = new ArrayList<String>();
for (Object fileSet : fileSets) {
final FileSet fs = (FileSet) fileSet;
final DirectoryScanner ds = fs.getDirectoryScanner(getProject());
for (String dsFile : ds.getIncludedFiles()) {
File f = new File(dsFile);
if (!f.isFile()) {
f = new File(ds.getBasedir(), dsFile);
}
files.add(f.getAbsolutePath());
}
}
return ArrayHelper.toStringArray(files);
}
use of org.apache.tools.ant.types.FileSet in project processing by processing.
the class AppBundlerTask method copyLibraryPathEntries.
private void copyLibraryPathEntries(File macOSDirectory) throws IOException {
for (FileSet fileSet : libraryPath) {
File libraryPathDirectory = fileSet.getDir();
DirectoryScanner directoryScanner = fileSet.getDirectoryScanner(getProject());
String[] includedFiles = directoryScanner.getIncludedFiles();
for (String includedFile : includedFiles) {
File source = new File(libraryPathDirectory, includedFile);
File destination = new File(macOSDirectory, new File(includedFile).getName());
copy(source, destination);
}
}
}
use of org.apache.tools.ant.types.FileSet in project bnd by bndtools.
the class RepoIndexTask method execute.
@Override
public void execute() throws BuildException {
printCopyright(System.err);
if (repositoryFile == null)
throw new BuildException("Output file not specified");
try {
// Configure PojoSR
Map<String, Object> pojoSrConfig = new HashMap<String, Object>();
pojoSrConfig.put(PojoServiceRegistryFactory.BUNDLE_DESCRIPTORS, new ClasspathScanner());
// Start PojoSR 'framework'
Framework framework = new PojoServiceRegistryFactoryImpl().newFramework(pojoSrConfig);
framework.init();
framework.start();
if (knownBundles) {
registerKnownBundles(framework.getBundleContext());
}
// Look for indexer and run index generation
ServiceTracker<ResourceIndexer, ResourceIndexer> tracker = new ServiceTracker<ResourceIndexer, ResourceIndexer>(framework.getBundleContext(), ResourceIndexer.class, null);
tracker.open();
ResourceIndexer index = tracker.waitForService(1000);
if (index == null)
throw new IllegalStateException("Timed out waiting for ResourceIndexer service.");
// Flatten the file sets into a single list
Set<File> fileList = new LinkedHashSet<File>();
for (FileSet fileSet : fileSets) {
DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());
File basedir = ds.getBasedir();
String[] files = ds.getIncludedFiles();
for (int i = 0; i < files.length; i++) fileList.add(new File(basedir, files[i]));
}
// Run
try (OutputStream fos = Files.newOutputStream(repositoryFile.toPath())) {
index.index(fileList, fos, config);
}
} catch (Exception e) {
throw new BuildException(e);
}
}
use of org.apache.tools.ant.types.FileSet in project processdash by dtuma.
the class PackageLaunchProfile method createResourceJar.
private void createResourceJar(File tmpFile) throws IOException, ManifestException {
String contentToken = calculateContentToken();
Manifest mf = buildManifest(contentToken);
Jar jar = new Jar();
jar.bindToOwner(this);
jar.addConfiguredManifest(mf);
for (FileSet fs : filesets) jar.addFileset(fs);
tmpFile.delete();
jar.setDestFile(tmpFile);
jar.execute();
}
Aggregations