Files
openapi-generator/code-gen/build.xml

59 lines
2.2 KiB
XML

<project name="wordnik-libs-gen" default="compile" basedir=".">
<property environment="env" />
<property name="version.identifier" value="1.0" />
<condition property="build.common.dir" value="${env.BUILD_COMMON}">
<isset property="env.BUILD_COMMON" />
</condition>
<mkdir dir="lib"/>
<mkdir dir="lib/ext"/>
<mkdir dir="build"/>
<mkdir dir="src/main/scala"/>
<echo message="using build common dir: ${build.common.dir}"/>
<import file="${build.common.dir}/ant/ant-common.xml" />
<import file="${build.common.dir}/ant/ant-server.xml" />
<import file="${build.common.dir}/ant/ant-test.xml" />
<condition property="outputPath.set">
<and>
<isset property="outputDir"/>
<isset property="apiServerRootDir"/>
</and>
</condition>
<!-- generates the classes -->
<target name="generate-java" depends="compile" description="generates APIs and model classes for java language">
<fail unless="outputPath.set">
Must specify the parameters: outputDir and apiServerRootDir eg. -DoutputDir=../../api-server-lib/java/src/main/java/com/wordnik/
-DapiServerRootDir=../../api-server-lib/java/
These are the output path of the Apis
and the root directory that will be created for the api server (directory where artifacts like build.xml and other contents from the structure are created)
</fail>
<mkdir dir="${outputDir}/api"/>
<mkdir dir="${outputDir}/model"/>
<echo>
outputDir for Api = ${outputDir}
</echo>
<echo>
apiServerRootDir = ${apiServerRootDir}
</echo>
<delete>
<fileset dir="${outputDir}" includes="*.java"/>
</delete>
<java classname="com.wordnik.swagger.codegen.config.java.JavaLibCodeGen">
<classpath>
<pathelement location="build/main/java" />
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<arg value="${outputDir}"/>
</java>
<copy todir="${apiServerRootDir}" overwrite="true">
<fileset dir="conf/java/structure"/>
</copy>
</target>
</project>