Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 151   Methods: 6
NCLOC: 47   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
StyleBook.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 package org.apache.tools.ant.taskdefs.optional;
 55   
 
 56   
 import java.io.File;
 57   
 import org.apache.tools.ant.BuildException;
 58   
 import org.apache.tools.ant.taskdefs.Java;
 59   
 
 60   
 /**
 61   
  * Executes the Apache Stylebook documentation generator.
 62   
  * Unlike the commandline version of this tool, all three arguments
 63   
  * are required to run stylebook.
 64   
  * <p>
 65   
  * Being extended from &lt;Java&gt;, all the parent's attributes
 66   
  * and options are available. Do not set any apart from the <tt>classpath</tt>
 67   
  * as they are not guaranteed to be there in future.
 68   
  * @todo stop extending from Java.
 69   
  * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
 70   
  * @author <a href="mailto:marcus.boerger@post.rwth-aachen.de">Marcus
 71   
  *      B&ouml;rger</a>
 72   
  */
 73   
 public class StyleBook
 74   
      extends Java {
 75   
     protected File m_targetDirectory;
 76   
     protected File m_skinDirectory;
 77   
     protected String m_loaderConfig;
 78   
     protected File m_book;
 79   
 
 80   
 
 81  0
     public StyleBook() {
 82  0
         setClassname("org.apache.stylebook.StyleBook");
 83  0
         setFork(true);
 84  0
         setFailonerror(true);
 85   
     }
 86   
 
 87   
     /**
 88   
      * The book xml file that the documentation generation starts from; 
 89   
      * required.
 90   
      */
 91   
      
 92  0
     public void setBook(final File book) {
 93  0
         m_book = book;
 94   
     }
 95   
 
 96   
 
 97   
     /**
 98   
      * the directory that contains the stylebook skin;
 99   
      * required.
 100   
      */
 101  0
     public void setSkinDirectory(final File skinDirectory) {
 102  0
         m_skinDirectory = skinDirectory;
 103   
     }
 104   
 
 105   
 
 106   
     /**
 107   
      * the destination directory where the documentation is generated;
 108   
      * required.
 109   
      */
 110  0
     public void setTargetDirectory(final File targetDirectory) {
 111  0
         m_targetDirectory = targetDirectory;
 112   
     }
 113   
 
 114   
     /**
 115   
      * A loader configuration to send to stylebook; optional.
 116   
      */
 117  0
     public void setLoaderConfig(final String loaderConfig) {
 118  0
         m_loaderConfig = loaderConfig;
 119   
     }
 120   
 
 121   
 
 122   
     /**
 123   
      * call the program
 124   
      */
 125  0
     public void execute()
 126   
          throws BuildException {
 127   
 
 128  0
         if (null == m_targetDirectory) {
 129  0
             throw new BuildException("TargetDirectory attribute not set.");
 130   
         }
 131   
 
 132  0
         if (null == m_skinDirectory) {
 133  0
             throw new BuildException("SkinDirectory attribute not set.");
 134   
         }
 135   
 
 136  0
         if (null == m_book) {
 137  0
             throw new BuildException("book attribute not set.");
 138   
         }
 139   
 
 140  0
         createArg().setValue("targetDirectory=" + m_targetDirectory);
 141  0
         createArg().setValue(m_book.toString());
 142  0
         createArg().setValue(m_skinDirectory.toString());
 143  0
         if (null != m_loaderConfig) {
 144  0
             createArg().setValue("loaderConfig=" + m_loaderConfig);
 145   
         }
 146   
 
 147  0
         super.execute();
 148   
     }
 149   
 }
 150   
 
 151