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

53 lines
2.1 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>
<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="outputPath"/>
<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: outputPath and apiServerRootDir eg. -DoutputPath=../../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 structure is created)
</fail>
<mkdir dir="${outputPath}/api"/>
<mkdir dir="${outputPath}/model"/>
<echo>
outputPath for Api = ${outputPath}
</echo>
<echo>
apiServerRootDir = ${apiServerRootDir}
</echo>
<delete>
<fileset dir="${outputPath}" includes="*.java"/>
</delete>
<java classname="com.wordnik.codegen.config.java.JavaLibCodeGen">
<classpath>
<pathelement location="build/main/java" />
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<arg value="${outputPath}"/>
</java>
<copy todir="${apiServerRootDir}" overwrite="true">
<fileset dir="conf/java/structure"/>
</copy>
</target>
</project>