001: /*******************************************************************************
002: * Copyright (c) 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - Initial API and implementation
010: *******************************************************************************/package org.eclipse.pde.build;
011:
012: import java.util.Map;
013:
014: /**
015: * Interface providing helper methods to produce Ant scripts.
016: * <p>
017: * It contains convenience methods for creating the XML elements
018: * required for Ant scripts. See the <a href="http://ant.apache.org">Ant</a>
019: * website for more details on Ant scripts and the particular Ant tasks.
020: * </p>
021: * <p>
022: * This interface is not intended to be implemented by clients.
023: * </p>
024: */
025: public interface IAntScript {
026:
027: /**
028: * Print the given string to the Ant script.
029: *
030: * @param string the string to print.
031: */
032: public void print(String string);
033:
034: /**
035: * Print the given comment to the Ant script folled by a carriage-return.
036: *
037: * @param comment the comment to print.
038: */
039: public void printComment(String comment);
040:
041: /**
042: * Print the given string followed by a carriage-return.
043: *
044: * @param string the string to print.
045: */
046: public void println(String string);
047:
048: /**
049: * Print a empty line.
050: */
051: public void println();
052:
053: /**
054: * Print an ant call task as defined by <a href="http://ant.apache.org/manual/CoreTasks/antcall.html">AntCall</a>}.
055: * @param target the target executed by the call. This value can not be <code>null</code>.
056: * @param inheritAll If true, pass all properties to the new Ant project.
057: * @param params Specifies as key / value pairs, the properties to set before running the specified target. This value can be <code>null</code>
058: */
059: public void printAntCallTask(String target, boolean inheritAll,
060: Map params);
061:
062: /**
063: * Print an XML attribute. <code>name=value</code>.
064: * @param name the name of the attribute to print. This value can not be <code>null</code>.
065: * @param value the name of the value to print. This value can be <code>null</code>.
066: * @param mandatory indicate whether or not the value is mandatory.
067: * If the <code>value</code> is <code>null</code> and the attribute is mandatory, the printed value will be "".
068: */
069: public void printAttribute(String name, String value,
070: boolean mandatory);
071:
072: /**
073: * Print tagName as an xml begin tag (<code><tagName><code>).
074: * @param tagName the tag to print.
075: */
076: public void printStartTag(String tagName);
077:
078: /**
079: * Print tagName as an xml end tag (<code></tagName><code>).
080: * @param endTag the tag to print.
081: */
082: public void printEndTag(String endTag);
083:
084: /**
085: * Print as many tabs as current nesting level requires
086: */
087: public void printTabs();
088:
089: /**
090: * Print a target declaration. See <a href="http://ant.apache.org/manual/using.html#targets">Ant's targets</a>.
091: * @param name the name of the target. This value can not be <code>null</code>.
092: * @param depends a comma-separated list of names of targets on which this target depends. This value can be <code>null</code>.
093: * @param ifClause the name of the property that must be set in order for this target to execute. This value can be <code>null</code>
094: * @param unlessClause the name of the property that must not be set in order for this target to execute. This value can be <code>null</code>
095: * @param description a short description of this target's function. This value can be <code>null</code>
096: */
097: public void printTargetDeclaration(String name, String depends,
098: String ifClause, String unlessClause, String description);
099:
100: /**
101: * Print the end tag for a target declaration.
102: */
103: public void printTargetEnd();
104: }
|