<project name="deleteProfile" default="init" basedir=".">

    <taskdef name="wscmtlog" 
        classname="com.ibm.ws.install.configmanager.actionengine.ant.utils.AntTaskToLogToConfigManagersLogFiles"/>

    <target name="init" description="Set platform properties">
      <condition property="isOS400" value="true">
        <equals arg1="${os.name}" arg2="OS/400"/>
      </condition>

      <antcall target="deleteProfile"/>
      <antcall target="deleteProfileOS400"/>
    </target>

    <target name="deleteProfile" unless="isOS400" 
            description="Deletes the given profile">
        
        <wscmtlog>Deleting profile: ${profileName}, at: ${profilePath}</wscmtlog>
        <delete failonerror="true" includeEmptyDirs="true">
            <fileset dir="${profilePath}" includes="**/*" excludes="logs/**" />
        </delete>
    </target>

    <target name="deleteProfileOS400" if="isOS400" 
            description="Deletes the given profile">
        
        <wscmtlog>Deleting profile: ${profileName}, at: ${profilePath}</wscmtlog>
        <delete dir="${profilePath}" failonerror="true"/>
    </target>
</project>
