<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM Corp.
- IBM UrbanCode Build
- (c) Copyright IBM Corporation 2012, 2014. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-->
<plugin xmlns="http://www.urbancode.com/PluginXMLSchema_v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <header>
    <identifier id="com.urbancode.air.plugin.reportpublisher" name="Report Publisher" version="8"/>
    <description>
      Uploads specified files as reports to the server.
    </description>
    <tag>Reporting/Publishing</tag>
  </header>
  <step-type name="Publish Report">
    <description>Publish some files as a report</description>
    <properties>
      <property name="reportName" required="true">
        <property-ui type="textBox"
                            label="Report Name"
                            description="The name of the report for all uploaded documents to be filed under." />
      </property>
      <property name="includes">
        <property-ui type="textAreaBox"
                            label="Include Patterns"
                            description="Patterns for including files in the report, one per line. Patterns can include ?, *, or **." />
      </property>
      <property name="excludes">
        <property-ui type="textAreaBox"
                            label="Exclude Patterns"
                            description="Patterns for excluding files from the report, one per line. Files matching these
                            patterns are unconditionally excluded from the report. Patterns can include ?, *, or **." />
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/httpcore.jar:lib/httpclient.jar:lib/httpclient-cache.jar:lib/httpmime.jar:lib/HttpComponents-Util.jar:lib/CommonsUtil.jar:lib/commons-logging.jar:lib/commons-codec.jar:lib/log4j.jar:lib/CommonsFileUtils.jar:lib/securedata.jar:lib/jettison.jar" />
      <arg file="publish.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>
</plugin>
