Beispiel #1
0
 private void performCopy(String configdestdir, String filename) {
   try {
     String destdir = (configdestdir.length() > 0) ? configdestdir + File.separatorChar : "";
     if (filename.length() > 0) {
       File helpstylefile = new File(filename);
       String parent = helpstylefile.getParent();
       String helpstylefilename =
           (parent == null) ? filename : filename.substring(parent.length() + 1);
       File desthelpfile = new File(destdir + helpstylefilename);
       if (!desthelpfile.getCanonicalPath().equals(helpstylefile.getCanonicalPath())) {
         configuration.message.notice(
             (SourcePosition) null,
             "doclet.Copying_File_0_To_File_1",
             helpstylefile.toString(),
             desthelpfile.toString());
         Util.copyFile(desthelpfile, helpstylefile);
       }
     }
   } catch (IOException exc) {
     configuration.message.error(
         (SourcePosition) null, "doclet.perform_copy_exception_encountered", exc.toString());
     throw new DocletAbortException();
   }
 }
Beispiel #2
0
  /**
   * Start the generation of files. Call generate methods in the individual writers, which will in
   * turn genrate the documentation files. Call the TreeWriter generation first to ensure the Class
   * Hierarchy is built first and then can be used in the later generation.
   *
   * <p>For new format.
   *
   * @see pl.wcislo.sbql4j.javadoc.RootDoc
   */
  protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception {
    super.generateOtherFiles(root, classtree);
    if (configuration.linksource) {
      if (configuration.destDirName.length() > 0) {
        SourceToHTMLConverter.convertRoot(
            configuration,
            root,
            configuration.destDirName + File.separator + DocletConstants.SOURCE_OUTPUT_DIR_NAME);
      } else {
        SourceToHTMLConverter.convertRoot(
            configuration, root, DocletConstants.SOURCE_OUTPUT_DIR_NAME);
      }
    }

    if (configuration.topFile.length() == 0) {
      configuration.standardmessage.error("doclet.No_Non_Deprecated_Classes_To_Document");
      return;
    }
    boolean nodeprecated = configuration.nodeprecated;
    String configdestdir = configuration.destDirName;
    String confighelpfile = configuration.helpfile;
    String configstylefile = configuration.stylesheetfile;
    performCopy(configdestdir, confighelpfile);
    performCopy(configdestdir, configstylefile);
    Util.copyResourceFile(configuration, "inherit.gif", false);
    // do early to reduce memory footprint
    if (configuration.classuse) {
      ClassUseWriter.generate(configuration, classtree);
    }
    IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated);

    if (configuration.createtree) {
      TreeWriter.generate(configuration, classtree);
    }
    if (configuration.createindex) {
      if (configuration.splitindex) {
        SplitIndexWriter.generate(configuration, indexbuilder);
      } else {
        SingleIndexWriter.generate(configuration, indexbuilder);
      }
    }

    if (!(configuration.nodeprecatedlist || nodeprecated)) {
      DeprecatedListWriter.generate(configuration);
    }

    AllClassesFrameWriter.generate(
        configuration, new IndexBuilder(configuration, nodeprecated, true));

    FrameOutputWriter.generate(configuration);

    if (configuration.createoverview) {
      PackageIndexWriter.generate(configuration);
    }
    if (configuration.helpfile.length() == 0 && !configuration.nohelp) {
      HelpWriter.generate(configuration);
    }
    if (configuration.stylesheetfile.length() == 0) {
      StylesheetWriter.generate(configuration);
    }
  }