<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM Corp.
- IBM UrbanCode Build
- IBM UrbanCode Deploy
- IBM UrbanCode Release
- IBM AnthillPro
- (c) Copyright IBM Corporation 2002, 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:server="http://www.urbancode.com/PluginServerXMLSchema_v1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <header>
    <identifier id="com.urbancode.air.plugin.source.fileSystemVersioned" name="File System (Versioned)" version="5"/>
    <description>
      The File System Versioned plugin automates uploading artifacts from a versioned file system.
    </description>
    <tag>Source and Repositories/File System Versioned</tag>
    <server:plugin-type>Source</server:plugin-type>
  </header>
  <step-type name="Import Version">
    <description>Description</description>
    <properties>
    </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="${JAVA_HOME}/bin/java">
      <arg value="-Dfile.encoding=${DS_SYSTEM_ENCODING}"/>
      <arg value="-Dconsole.encoding=${DS_SYSTEM_ENCODING}"/>
      <arg value="-jar"/>
      <arg file="FileSystemVersionedSourceConfig.jar"/>
      <arg value="ImportVersion"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>
  <!-- ==================================== -->
  <!--   Properties                         -->
  <!-- ==================================== -->
  <server:property-group type="Component" name="FileSystemVersionedComponentProperties">
    <server:property name="basePath" required="true">
      <server:property-ui type="textBox"
                          label="Base Path"
                          description="Specify the path to the directory that contains the
                          artifacts. The content of each subdirectory within this base directory
                          is considered a distinct component version. The subdirectory with the
                          most recent timestamp is considered to be the latest version."
                          placeholder= "/home/user/components"/>
    </server:property>
    <server:property name="saveFileExecuteBits">
      <server:property-ui type="checkBox"
                          label="Preserve Execute Permissions"
                          description="For Linux and UNIX operating systems, select this check box
                          to retain the execute permissions for each file." />
    </server:property>
    <server:property name="extensions">
      <server:property-ui type="textBox"
                          label="Text File Extensions"
                          description="If text-type files must be converted into another character
                          set, type the list of file extensions to be converted. Matching file
                          types are converted into the default character set of the system where
                          the agent is located. Separate list items with commas."
                          placeholder=".txt,.log,.properties" />
    </server:property>
    <server:property name="includes" required="false">
      <server:property-ui type="textAreaBox"
                          label="Include Files"
                          description="Files included in the version upload. The default setting
                          of **/* uploads all files. Separate files with commas or newline characters."
                          placeholder="**/*" />
    </server:property>
    <server:property name="excludes">
      <server:property-ui type="textAreaBox"
                          label="Exclude Files"
                          description="Files excluded in the version upload. Separate files with
                          commas or newline characters." />
    </server:property>
  </server:property-group>
</plugin>
