<?xml version="1.0"?>
<project default="swagger-ui">

  <target name="swagger-ui">
    <property name="buildDir" value="${basedir}${file.separator}target${file.separator}classes" />
    <property name="swaggerDir" value="${buildDir}${file.separator}swagger-ui" />
    <move file="node_modules${file.separator}swagger-ui-dist" tofile="${swaggerDir}"/>
    <replace file="${swaggerDir}/index.html" token="./" value="${swaggerPath}/" />
    <replace file="${swaggerDir}/index.html" token="https://petstore.swagger.io/v2/swagger.json" value="${openAPIPath}" />
    <delete>
      <fileset dir="${swaggerDir}" includes="package.json"/>
      <fileset dir="${swaggerDir}" includes="absolute-path.js"/>
      <fileset dir="${swaggerDir}" includes="swagger-ui.js"/>
      <fileset dir="${swaggerDir}" includes="*.gz"/>
      <fileset dir="${swaggerDir}" includes="*.js.map"/>
    </delete>
  </target>

</project>
