Search in sources :

Example 1 with SpecIndexFile

use of org.eclipse.n4js.jsdoc2spec.adoc.SpecIndexFile in project n4js by eclipse.

the class TaskGenerateAdoc method getPackagesCountTotal.

int getPackagesCountTotal() {
    File docRootDir = configAdocPage.getConfig().getDocRootDir();
    String packagesDir = docRootDir + SEP + DIR_ADOC_GEN + SEP + DIR_PACKAGES;
    List<String> packageFileNames = FileSystem.getAdocFileNames(packagesDir);
    Collections.sort(packageFileNames);
    int changedPackageFiles = 0;
    int updated = 0;
    if (specChangeSet != null)
        for (SpecFile specFile : specChangeSet) {
            if (specFile instanceof SpecIndexFile) {
                // This is an approximation since e.g. the overview files are also SpecIndexFiles
                // Error: 0..+2
                changedPackageFiles++;
                if (packageFileNames.contains(specFile.getFile().getName()))
                    updated++;
            }
        }
    return packageFileNames.size() + changedPackageFiles - updated;
}
Also used : SpecModuleFile(org.eclipse.n4js.jsdoc2spec.adoc.SpecModuleFile) SpecFile(org.eclipse.n4js.jsdoc2spec.SpecFile) File(java.io.File) SpecIndexFile(org.eclipse.n4js.jsdoc2spec.adoc.SpecIndexFile) SpecIndexFile(org.eclipse.n4js.jsdoc2spec.adoc.SpecIndexFile) SpecFile(org.eclipse.n4js.jsdoc2spec.SpecFile)

Aggregations

File (java.io.File)1 SpecFile (org.eclipse.n4js.jsdoc2spec.SpecFile)1 SpecIndexFile (org.eclipse.n4js.jsdoc2spec.adoc.SpecIndexFile)1 SpecModuleFile (org.eclipse.n4js.jsdoc2spec.adoc.SpecModuleFile)1