Search in sources :

Example 96 with DirectoryScanner

use of org.apache.tools.ant.DirectoryScanner in project mdw-designer by CenturyLinkCloud.

the class AutoTestAntTask method runTests.

public void runTests() throws Exception {
    if (!baseDir.exists() || !baseDir.isDirectory())
        throw new IOException("Directory does not exist: " + baseDir);
    ThreadPool threadPool = new ThreadPool(threadCount);
    HashMap<String, ProcessVO> processCache = new HashMap<>();
    boolean hasGherkin = false;
    boolean hasNonGherkin = false;
    if (workflowDir != null) {
        DirectoryScanner scanner = getDirectoryScanner(workflowDir);
        scanner.scan();
        String jsonString;
        if (testResultsSummaryFile.exists() && testResultsSummaryFile.getName().endsWith(".json")) {
            jsonString = new String(Files.readAllBytes(testResultsSummaryFile.toPath()));
            if (jsonString != null && !jsonString.isEmpty())
                testCaseList = new TestCaseList(workflowDir, new JSONObject(jsonString));
        }
        if (testCaseList == null) {
            testCaseList = new TestCaseList(workflowDir);
            testCaseList.setPackageTests(new ArrayList<PackageTests>());
        }
        String workflowPath = workflowDir.toString().replace('\\', '/');
        String[] caseFilePaths = scanner.getIncludedFiles();
        for (String caseFilePath : caseFilePaths) {
            String casePath = caseFilePath.replace('\\', '/');
            int lastSlash = casePath.lastIndexOf('/');
            String pkgName = casePath.substring(0, lastSlash).replace('/', '.');
            File caseFile = new File(workflowPath + "/" + casePath);
            PackageTests pkgTests = testCaseList.getPackageTests(pkgName);
            if (pkgTests == null) {
                PackageDir pkgDir = new PackageDir(workflowDir, caseFile.getParentFile(), null);
                pkgDir.parse();
                pkgTests = new PackageTests(pkgDir);
                pkgTests.setTestCases(new ArrayList<com.centurylink.mdw.test.TestCase>());
                testCaseList.getPackageTests().add(pkgTests);
            }
            pkgTests.getTestCases().add(new com.centurylink.mdw.test.TestCase(pkgName, new AssetInfo(caseFile)));
            TestCase tc = new TestCase(pkgName, caseFile);
            if (tc.isGherkin())
                hasGherkin = true;
            else
                hasNonGherkin = true;
            testCases.add(tc);
        }
    } else if (jdbcUrl != null) {
        // db asset tests
        if (dbAssetTests == null)
            throw new BuildException("Attribute dbAssetTests required for non-VCS asset tests");
        String[] assets = dbAssetTests.split("\\s?,\\s?");
        for (String asset : assets) {
            int lastSlash = asset.lastIndexOf('/');
            String pkg = asset.substring(0, lastSlash);
            String assetName = asset.substring(lastSlash + 1);
            String language = RuleSetVO.getLanguage(assetName.substring(assetName.lastIndexOf('.')));
            RuleSetVO ruleSet = designerDataAccess.getRuleSet(assetName, language, 0);
            ruleSet.setPackageName(pkg);
            TestCase tc = new TestCase(pkg, ruleSet);
            testCases.add(tc);
        }
    } else {
        throw new BuildException("Missing attribute: workflowDir");
    }
    if (hasGherkin && hasNonGherkin)
        throw new BuildException("Gherkin/non-Gherkin tests require separate task/target executions.");
    // gradle
    boolean useStdErr = System.getProperty("org.gradle.appname") != null;
    // does
    // not
    // show
    // output
    // otherwise
    LogMessageMonitor monitor = hasGherkin ? null : new LogMessageMonitor(designerDataAccess, oldNamespaces);
    if (monitor != null)
        monitor.start(true);
    for (TestCase testCase : testCases) {
        String masterRequestId = user + "-" + new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date());
        File resultDir = new File(testResultsDir + "/" + testCase.getPrefix());
        testCase.prepare();
        TestCaseRun run;
        if (testCase.isGherkin()) {
            // User defined masterRequestId
            if (testCase.getMasterRequestId() != null) {
                if (testCase.getMasterRequestId().indexOf("${masterRequestId}") != -1) {
                    masterRequestId = testCase.getMasterRequestId().replace("${masterRequestId}", masterRequestId);
                } else
                    masterRequestId = testCase.getMasterRequestId();
            }
            testCase.setMasterRequestId(masterRequestId);
            run = new GherkinTestCaseRun(testCase, 0, masterRequestId, new DesignerDataAccess(designerDataAccess), monitor, processCache, oldNamespaces, resultDir, stubbing, stubPort);
        } else if (testCase.isGroovy())
            run = new GroovyTestCaseRun(testCase, 0, masterRequestId, new DesignerDataAccess(designerDataAccess), monitor, processCache, loadTests, true, oldNamespaces, null);
        else
            run = new TestCaseRun(testCase, 0, masterRequestId, new DesignerDataAccess(designerDataAccess), monitor, processCache, loadTests, true, oldNamespaces);
        File executeLog = new File(resultDir.getPath() + "/" + testCase.getCaseName() + ".log");
        if (!executeLog.getParentFile().exists() && !executeLog.getParentFile().mkdirs())
            throw new IOException("Unable to create test run directory: " + executeLog.getParentFile());
        PrintStream log = verbose ? new TeePrintStream(useStdErr ? System.err : System.out, executeLog) : new PrintStream(executeLog);
        run.prepareTest(false, resultDir, true, singleServer, stubbing, log);
        if (verbose)
            log("Test case prepared: " + testCase.getCaseName(), useStdErr ? Project.MSG_ERR : Project.MSG_INFO);
        masterRequestRunMap.put(run.getMasterRequestId(), run);
        threadPool.execute(run);
        updateResults(false);
        try {
            Thread.sleep(intervalSecs * 1000);
        } catch (InterruptedException e) {
        }
    }
    log("All cases prepared. Waiting for completion ...", Project.MSG_INFO);
    threadPool.shutdown();
    while (!threadPool.isTerminated()) {
        updateResults(false);
        try {
            Thread.sleep(2500);
        } catch (InterruptedException e) {
        }
    }
    if (monitor != null)
        monitor.shutdown();
    updateResults(true);
    log("All cases completed.", Project.MSG_ERR);
}
Also used : HashMap(java.util.HashMap) AssetInfo(com.centurylink.mdw.test.AssetInfo) RuleSetVO(com.centurylink.mdw.model.value.attribute.RuleSetVO) PackageTests(com.centurylink.mdw.test.PackageTests) PackageDir(com.centurylink.mdw.dataaccess.file.PackageDir) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) DesignerDataAccess(com.centurylink.mdw.designer.DesignerDataAccess) TestCaseList(com.centurylink.mdw.test.TestCaseList) PrintStream(java.io.PrintStream) TeePrintStream(com.centurylink.mdw.common.utilities.file.TeePrintStream) TeePrintStream(com.centurylink.mdw.common.utilities.file.TeePrintStream) IOException(java.io.IOException) Date(java.util.Date) JSONObject(org.json.JSONObject) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat)

Example 97 with DirectoryScanner

use of org.apache.tools.ant.DirectoryScanner in project ph-schematron by phax.

the class Schematron method _performValidation.

private void _performValidation(@Nonnull final ISchematronResource aSch, @Nonnull final ICommonsList<ResourceCollection> aResCollections, @Nullable final File aSVRLDirectory, final boolean bExpectSuccess) throws BuildException {
    // Resolve resourceCollections - pain in the ass
    final ICommonsMap<File, DirectoryData> aFiles = new CommonsHashMap<>();
    for (final ResourceCollection aResCollection : aResCollections) {
        if (!aResCollection.isFilesystemOnly())
            _error("Only FileSystem resources are supported.");
        else
            for (final Resource aRes : aResCollection) {
                if (!aRes.isExists()) {
                    _error("Could not find resource " + aRes.toLongString() + " to copy.");
                    continue;
                }
                File baseDir = NULL_FILE_PLACEHOLDER;
                String name = aRes.getName();
                final FileProvider fp = aRes.as(FileProvider.class);
                if (fp != null) {
                    final FileResource fr = ResourceUtils.asFileResource(fp);
                    baseDir = _getKeyFile(fr.getBaseDir());
                    if (baseDir == NULL_FILE_PLACEHOLDER)
                        name = fr.getFile().getAbsolutePath();
                }
                if ((aRes.isDirectory() || fp != null) && name != null) {
                    final DirectoryData aBaseDir = aFiles.computeIfAbsent(_getKeyFile(baseDir), k -> new DirectoryData(k));
                    if (aRes.isDirectory())
                        aBaseDir.addDir(name);
                    else
                        aBaseDir.addFile(name);
                } else
                    _error("Could not resolve resource " + aRes.toLongString() + " to a file.");
            }
    }
    for (final DirectoryData aBaseDir : aFiles.values()) {
        log("Scanning directory " + aBaseDir.getBaseDir() + " for XMLs to be Schematron validated", Project.MSG_DEBUG);
        final ICommonsList<String> aIncludes = new CommonsArrayList<>();
        aIncludes.addAll(aBaseDir.getFiles());
        for (final String sFile : aBaseDir.getDirs()) aIncludes.add(sFile + "/**");
        final DirectoryScanner aScanner = new DirectoryScanner();
        aScanner.setBasedir(aBaseDir.getBaseDir());
        if (aIncludes.isNotEmpty())
            aScanner.setIncludes(aIncludes.toArray(new String[0]));
        aScanner.setCaseSensitive(true);
        aScanner.scan();
        final String[] aXMLFilenames = aScanner.getIncludedFiles();
        if (aXMLFilenames != null) {
            for (final String sXMLFilename : aXMLFilenames) {
                final File aXMLFile = new File(aBaseDir.getBaseDir(), sXMLFilename);
                // Validate XML file
                log("Validating XML file '" + aXMLFile.getPath() + "' against Schematron rules from '" + m_aSchematronFile.getName() + "' expecting " + (bExpectSuccess ? "success" : "failure"), Project.MSG_INFO);
                try {
                    final SchematronOutputType aSOT = aSch.applySchematronValidationToSVRL(TransformSourceFactory.create(aXMLFile));
                    if (aSVRLDirectory != null) {
                        // Save SVRL
                        final File aSVRLFile = new File(aSVRLDirectory, sXMLFilename + ".svrl");
                        if (!aSVRLFile.getParentFile().mkdirs())
                            log("Failed to create parent directory of '" + aSVRLFile.getAbsolutePath() + "'!", Project.MSG_ERR);
                        if (new SVRLMarshaller().write(aSOT, aSVRLFile).isSuccess())
                            log("Successfully saved SVRL file '" + aSVRLFile.getPath() + "'", Project.MSG_INFO);
                        else
                            log("Error saving SVRL file '" + aSVRLFile.getPath() + "'", Project.MSG_ERR);
                    }
                    if (false)
                        System.out.println(new SVRLMarshaller().getAsString(aSOT));
                    final ICommonsList<AbstractSVRLMessage> aMessages = SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSOT);
                    final int nErrorMessages = aMessages.getCount(x -> x.getFlag().isError());
                    final int nWarningMessages = aMessages.size() - nErrorMessages;
                    final String sErrors = nErrorMessages + " Schematron error" + (nErrorMessages == 1 ? "" : "s");
                    final String sWarnings = nWarningMessages + " Schematron warning" + (nWarningMessages == 1 ? "" : "s");
                    if (bExpectSuccess) {
                        // No failed assertions expected
                        if (nErrorMessages > 0) {
                            final StringBuilder aMessage = new StringBuilder();
                            aMessage.append(sErrors + (nWarningMessages > 0 ? " and " + sWarnings : "") + " for XML file '" + aXMLFile.getPath() + "'");
                            for (final AbstractSVRLMessage aMsg : aMessages) {
                                aMessage.append("\n  ").append(ErrorTextProvider.DEFAULT.getErrorText(aMsg.getAsResourceError(aXMLFile.getPath()), Locale.US));
                            }
                            // As at least one error is contained, it's okay to throw an
                            // exception in case
                            _error(aMessage.toString());
                            continue;
                        }
                        // Success as expected
                        log("XML file '" + aXMLFile.getPath() + "' was validated against Schematron '" + aSch.getResource().getPath() + "' and matches the rules" + (nWarningMessages > 0 ? " - only " + sWarnings + " are contained" : ""), Project.MSG_INFO);
                    } else {
                        // At least one failed assertions expected
                        if (nErrorMessages == 0) {
                            String sMessage = "No Schematron errors for erroneous XML file '" + aXMLFile.getPath() + "'";
                            if (nWarningMessages > 0)
                                sMessage += " - only " + sWarnings + " are contained";
                            _error(sMessage);
                            continue;
                        }
                        // Success as expected
                        log("XML file '" + aXMLFile.getPath() + "' was validated against Schematron '" + aSch.getResource().getPath() + "' " + sErrors + (nWarningMessages > 0 ? " and " + sWarnings : "") + " were found (as expected)", Project.MSG_INFO);
                    }
                } catch (final BuildException up) {
                    throw up;
                } catch (final Exception ex) {
                    final String sMessage = "Exception validating XML '" + aXMLFile.getPath() + "' against Schematron rules from '" + m_aSchematronFile.getName() + "'. Technical details: " + ex.getClass().getSimpleName() + " - " + ex.getMessage();
                    _error(sMessage, ex);
                    continue;
                }
            }
        }
    }
}
Also used : OverrideOnDemand(com.helger.commons.annotation.OverrideOnDemand) Task(org.apache.tools.ant.Task) IError(com.helger.commons.error.IError) FileSystemResource(com.helger.commons.io.resource.FileSystemResource) URIResolver(javax.xml.transform.URIResolver) ResourceCollection(org.apache.tools.ant.types.ResourceCollection) FileResource(org.apache.tools.ant.types.resources.FileResource) SchematronResourceXSLT(com.helger.schematron.xslt.SchematronResourceXSLT) AbstractSVRLMessage(com.helger.schematron.svrl.AbstractSVRLMessage) SVRLHelper(com.helger.schematron.svrl.SVRLHelper) ESchematronMode(com.helger.schematron.ESchematronMode) Locale(java.util.Locale) Project(org.apache.tools.ant.Project) CollectingTransformErrorListener(com.helger.xml.transform.CollectingTransformErrorListener) Nonnull(javax.annotation.Nonnull) TransformSourceFactory(com.helger.xml.transform.TransformSourceFactory) Nullable(javax.annotation.Nullable) EntityResolver(org.xml.sax.EntityResolver) ErrorTextProvider(com.helger.commons.error.ErrorTextProvider) Resource(org.apache.tools.ant.types.Resource) EErrorLevel(com.helger.commons.error.level.EErrorLevel) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) StringHelper(com.helger.commons.string.StringHelper) SVRLMarshaller(com.helger.schematron.svrl.SVRLMarshaller) CollectingPSErrorHandler(com.helger.schematron.pure.errorhandler.CollectingPSErrorHandler) BuildException(org.apache.tools.ant.BuildException) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) File(java.io.File) SchematronOutputType(org.oclc.purl.dsdl.svrl.SchematronOutputType) XMLCatalog(org.apache.tools.ant.types.XMLCatalog) ISchematronResource(com.helger.schematron.ISchematronResource) CommonsHashMap(com.helger.commons.collection.impl.CommonsHashMap) ICommonsList(com.helger.commons.collection.impl.ICommonsList) SchematronResourceSCH(com.helger.schematron.xslt.SchematronResourceSCH) FileProvider(org.apache.tools.ant.types.resources.FileProvider) ICommonsMap(com.helger.commons.collection.impl.ICommonsMap) SchematronResourcePure(com.helger.schematron.pure.SchematronResourcePure) IErrorList(com.helger.commons.error.list.IErrorList) ResourceUtils(org.apache.tools.ant.util.ResourceUtils) FileSystemResource(com.helger.commons.io.resource.FileSystemResource) FileResource(org.apache.tools.ant.types.resources.FileResource) Resource(org.apache.tools.ant.types.Resource) ISchematronResource(com.helger.schematron.ISchematronResource) FileResource(org.apache.tools.ant.types.resources.FileResource) SVRLMarshaller(com.helger.schematron.svrl.SVRLMarshaller) AbstractSVRLMessage(com.helger.schematron.svrl.AbstractSVRLMessage) BuildException(org.apache.tools.ant.BuildException) SchematronOutputType(org.oclc.purl.dsdl.svrl.SchematronOutputType) CommonsHashMap(com.helger.commons.collection.impl.CommonsHashMap) FileProvider(org.apache.tools.ant.types.resources.FileProvider) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) ResourceCollection(org.apache.tools.ant.types.ResourceCollection)

Example 98 with DirectoryScanner

use of org.apache.tools.ant.DirectoryScanner in project sql-boot by sql-boot.

the class LocalFileSystem method listFiles.

@Override
public List<File> listFiles(final String mask) {
    try {
        DirectoryScanner scanner = new DirectoryScanner();
        scanner.setIncludes(new String[] { mask });
        scanner.setBasedir(this.basedir.replace("\\", "/"));
        scanner.setCaseSensitive(false);
        scanner.scan();
        String[] files = scanner.getIncludedFiles();
        List<File> result = new ArrayList<>();
        for (String file : files) {
            result.add(new SimpleFile(file, FileUtils.readFileToByteArray(new java.io.File(basedir + "/" + file))));
        }
        return result;
    } catch (IOException exception) {
        throw new BootException(exception);
    }
}
Also used : DirectoryScanner(org.apache.tools.ant.DirectoryScanner) ArrayList(java.util.ArrayList) SimpleFile(com.github.mgramin.sqlboot.tools.files.file.impl.SimpleFile) IOException(java.io.IOException) BootException(com.github.mgramin.sqlboot.exceptions.BootException) File(com.github.mgramin.sqlboot.tools.files.file.File) SimpleFile(com.github.mgramin.sqlboot.tools.files.file.impl.SimpleFile)

Example 99 with DirectoryScanner

use of org.apache.tools.ant.DirectoryScanner in project ant by apache.

the class Javadoc method doJava14.

// Do java1.4 arguments
private void doJava14(final Commandline toExecute) {
    for (final Object element : tags) {
        if (element instanceof TagArgument) {
            final TagArgument ta = (TagArgument) element;
            final File tagDir = ta.getDir(getProject());
            if (tagDir == null) {
                // The tag element is not used as a fileset,
                // but specifies the tag directly.
                toExecute.createArgument().setValue("-tag");
                toExecute.createArgument().setValue(ta.getParameter());
            } else {
                // The tag element is used as a
                // fileset. Parse all the files and create
                // -tag arguments.
                final DirectoryScanner tagDefScanner = ta.getDirectoryScanner(getProject());
                for (String file : tagDefScanner.getIncludedFiles()) {
                    final File tagDefFile = new File(tagDir, file);
                    try (final BufferedReader in = new BufferedReader(new FileReader(tagDefFile))) {
                        String line;
                        while ((line = in.readLine()) != null) {
                            toExecute.createArgument().setValue("-tag");
                            toExecute.createArgument().setValue(line);
                        }
                    } catch (final IOException ioe) {
                        throw new BuildException("Couldn't read tag file from " + tagDefFile.getAbsolutePath(), ioe);
                    }
                }
            }
        } else {
            final ExtensionInfo tagletInfo = (ExtensionInfo) element;
            toExecute.createArgument().setValue("-taglet");
            toExecute.createArgument().setValue(tagletInfo.getName());
            if (tagletInfo.getPath() != null) {
                final Path tagletPath = tagletInfo.getPath().concatSystemClasspath("ignore");
                if (!tagletPath.isEmpty()) {
                    toExecute.createArgument().setValue("-tagletpath");
                    toExecute.createArgument().setPath(tagletPath);
                }
            }
        }
    }
    final String sourceArg = source != null ? source : getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE);
    if (sourceArg != null) {
        toExecute.createArgument().setValue("-source");
        toExecute.createArgument().setValue(sourceArg);
    }
    if (linksource && doclet == null) {
        toExecute.createArgument().setValue("-linksource");
    }
    if (noqualifier != null && doclet == null) {
        toExecute.createArgument().setValue("-noqualifier");
        toExecute.createArgument().setValue(noqualifier);
    }
}
Also used : Path(org.apache.tools.ant.types.Path) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) IOException(java.io.IOException) BuildException(org.apache.tools.ant.BuildException) File(java.io.File)

Example 100 with DirectoryScanner

use of org.apache.tools.ant.DirectoryScanner in project ant by apache.

the class Javadoc method parsePackages.

/**
 * Add the directories matched by the nested dirsets to the Vector
 * and the base directories of the dirsets to the Path.  It also
 * handles the packages and excludepackages attributes and
 * elements.
 *
 * @since 1.5
 */
private void parsePackages(final List<String> pn, final Path sp) {
    final Set<String> addedPackages = new HashSet<>();
    final List<DirSet> dirSets = new ArrayList<>(packageSets);
    // and nested excludepackage elements
    if (sourcePath != null) {
        final PatternSet ps = new PatternSet();
        ps.setProject(getProject());
        if (packageNames.isEmpty()) {
            ps.createInclude().setName("**");
        } else {
            packageNames.stream().map(PackageName::getName).map(s -> s.replace('.', '/').replaceFirst("\\*$", "**")).forEach(pkg -> ps.createInclude().setName(pkg));
        }
        excludePackageNames.stream().map(PackageName::getName).map(s -> s.replace('.', '/').replaceFirst("\\*$", "**")).forEach(pkg -> ps.createExclude().setName(pkg));
        for (String pathElement : sourcePath.list()) {
            final File dir = new File(pathElement);
            if (dir.isDirectory()) {
                final DirSet ds = new DirSet();
                ds.setProject(getProject());
                ds.setDefaultexcludes(useDefaultExcludes);
                ds.setDir(dir);
                ds.createPatternSet().addConfiguredPatternset(ps);
                dirSets.add(ds);
            } else {
                log("Skipping " + pathElement + " since it is no directory.", Project.MSG_WARN);
            }
        }
    }
    for (DirSet ds : dirSets) {
        final File baseDir = ds.getDir(getProject());
        log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG);
        final DirectoryScanner dsc = ds.getDirectoryScanner(getProject());
        boolean containsPackages = false;
        for (String dir : dsc.getIncludedDirectories()) {
            // are there any java files in this directory?
            final File pd = new File(baseDir, dir);
            final String[] files = pd.list((directory, name) -> name.endsWith(".java") || (includeNoSourcePackages && name.equals("package.html")));
            if (files.length > 0) {
                if ("".equals(dir)) {
                    log(baseDir + " contains source files in the default package, you must specify them as source files not packages.", Project.MSG_WARN);
                } else {
                    containsPackages = true;
                    final String packageName = dir.replace(File.separatorChar, '.');
                    if (!addedPackages.contains(packageName)) {
                        addedPackages.add(packageName);
                        pn.add(packageName);
                    }
                }
            }
        }
        if (containsPackages) {
            // We don't need to care for duplicates here,
            // Path.list does it for us.
            sp.createPathElement().setLocation(baseDir);
        } else {
            log(baseDir + " doesn\'t contain any packages, dropping it.", Project.MSG_VERBOSE);
        }
    }
}
Also used : Commandline(org.apache.tools.ant.types.Commandline) DirSet(org.apache.tools.ant.types.DirSet) Enumeration(java.util.Enumeration) URL(java.net.URL) Task(org.apache.tools.ant.Task) JavaEnvUtils(org.apache.tools.ant.util.JavaEnvUtils) ResourceCollection(org.apache.tools.ant.types.ResourceCollection) ArrayList(java.util.ArrayList) Path(org.apache.tools.ant.types.Path) HashSet(java.util.HashSet) Vector(java.util.Vector) Locale(java.util.Locale) StringTokenizer(java.util.StringTokenizer) FileSet(org.apache.tools.ant.types.FileSet) OutputStreamWriter(java.io.OutputStreamWriter) Project(org.apache.tools.ant.Project) ProjectComponent(org.apache.tools.ant.ProjectComponent) FileUtils(org.apache.tools.ant.util.FileUtils) Resource(org.apache.tools.ant.types.Resource) Iterator(java.util.Iterator) MalformedURLException(java.net.MalformedURLException) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) FileWriter(java.io.FileWriter) Set(java.util.Set) IOException(java.io.IOException) BuildException(org.apache.tools.ant.BuildException) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) InputStreamReader(java.io.InputStreamReader) Collectors(java.util.stream.Collectors) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) List(java.util.List) EnumeratedAttribute(org.apache.tools.ant.types.EnumeratedAttribute) PatternSet(org.apache.tools.ant.types.PatternSet) FileProvider(org.apache.tools.ant.types.resources.FileProvider) StringUtils(org.apache.tools.ant.util.StringUtils) BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) Collections(java.util.Collections) MagicNames(org.apache.tools.ant.MagicNames) InputStream(java.io.InputStream) Reference(org.apache.tools.ant.types.Reference) ArrayList(java.util.ArrayList) DirSet(org.apache.tools.ant.types.DirSet) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) PatternSet(org.apache.tools.ant.types.PatternSet) File(java.io.File) HashSet(java.util.HashSet)

Aggregations

DirectoryScanner (org.apache.tools.ant.DirectoryScanner)150 File (java.io.File)122 FileSet (org.apache.tools.ant.types.FileSet)84 BuildException (org.apache.tools.ant.BuildException)73 IOException (java.io.IOException)38 ArrayList (java.util.ArrayList)32 Project (org.apache.tools.ant.Project)14 Resource (org.apache.tools.ant.types.Resource)11 Test (org.junit.Test)11 FileResource (org.apache.tools.ant.types.resources.FileResource)8 HashMap (java.util.HashMap)7 Path (org.apache.tools.ant.types.Path)7 Hashtable (java.util.Hashtable)6 PatternSet (org.apache.tools.ant.types.PatternSet)6 FileWriter (java.io.FileWriter)5 LinkedList (java.util.LinkedList)5 List (java.util.List)5 StringTokenizer (java.util.StringTokenizer)5 Vector (java.util.Vector)5 DirSet (org.apache.tools.ant.types.DirSet)5