Swagger-codegen: renaming input parameter for output directory and default test runner task

This commit is contained in:
Deepak Michael 2011-08-02 09:32:13 +05:30
parent 7ccf9df9e3
commit 8bd7111bda
2 changed files with 21 additions and 21 deletions

View File

@ -17,27 +17,28 @@
<condition property="outputPath.set"> <condition property="outputPath.set">
<and> <and>
<isset property="outputPath"/> <isset property="outputDir"/>
<isset property="apiServerRootDir"/> <isset property="apiServerRootDir"/>
</and> </and>
</condition> </condition>
<!-- generates the classes --> <!-- generates the classes -->
<target name="generate-java" depends="compile" description="generates APIs and model classes for java language"> <target name="generate-java" depends="compile" description="generates APIs and model classes for java language">
<fail unless="outputPath.set"> <fail unless="outputPath.set">
Must specify the parameters: outputPath and apiServerRootDir eg. -DoutputPath=../../api-server-lib/java/src/main/java/com/wordnik/ Must specify the parameters: outputDir and apiServerRootDir eg. -DoutputDir=../../api-server-lib/java/src/main/java/com/wordnik/
-DapiServerRootDir=../../api-server-lib/java/ -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) 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> </fail>
<mkdir dir="${outputPath}/api"/> <mkdir dir="${outputDir}/api"/>
<mkdir dir="${outputPath}/model"/> <mkdir dir="${outputDir}/model"/>
<echo> <echo>
outputPath for Api = ${outputPath} outputDir for Api = ${outputDir}
</echo> </echo>
<echo> <echo>
apiServerRootDir = ${apiServerRootDir} apiServerRootDir = ${apiServerRootDir}
</echo> </echo>
<delete> <delete>
<fileset dir="${outputPath}" includes="*.java"/> <fileset dir="${outputDir}" includes="*.java"/>
</delete> </delete>
<java classname="com.wordnik.swagger.codegen.config.java.JavaLibCodeGen"> <java classname="com.wordnik.swagger.codegen.config.java.JavaLibCodeGen">
<classpath> <classpath>
@ -46,7 +47,7 @@
<include name="**/*.jar"/> <include name="**/*.jar"/>
</fileset> </fileset>
</classpath> </classpath>
<arg value="${outputPath}"/> <arg value="${outputDir}"/>
</java> </java>
<copy todir="${apiServerRootDir}" overwrite="true"> <copy todir="${apiServerRootDir}" overwrite="true">
<fileset dir="conf/java/structure"/> <fileset dir="conf/java/structure"/>

View File

@ -3,24 +3,22 @@
<property environment="env" /> <property environment="env" />
<property name="version.identifier" value="4.04" /> <property name="version.identifier" value="4.04" />
<!-- property name="application.description" value="Wordnik Java Driver"/>
<property name="application.name" value="java-driver"/ -->
<condition property="build.common.dir" value="${env.BUILD_COMMON}"> <condition property="build.common.dir" value="${env.BUILD_COMMON}">
<isset property="env.BUILD_COMMON" /> <isset property="env.BUILD_COMMON" />
</condition> </condition>
<echo message="using build common dir: ${build.common.dir}"/> <echo message="using build common dir: ${build.common.dir}"/>
<target name="runtests" description="runs the test cases" depends="compile, test.compile"> <target name="run.tests" description="runs the test cases" depends="compile, test.compile">
<java classname="com.wordnik.swagger.test.APITestRunner"> <java classname="com.wordnik.swagger.test.APITestRunner">
<arg value="JAVA" /> <arg value="JAVA" />
<classpath> <classpath>
<pathelement location="build/main/java" /> <pathelement location="build/main/java" />
<pathelement location="build/test/java" /> <pathelement location="build/test/java" />
<fileset dir="lib"> <fileset dir="lib">
<include name="**/*.jar"/> <include name="**/*.jar"/>
</fileset> </fileset>
</classpath> </classpath>
</java> </java>
</target> </target>
<!-- Creating directories used in app structure if required--> <!-- Creating directories used in app structure if required-->
@ -32,6 +30,7 @@
<mkdir dir="src/main/java"/> <mkdir dir="src/main/java"/>
<mkdir dir="src/test/java"/> <mkdir dir="src/test/java"/>
<mkdir dir="src/test/scala"/> <mkdir dir="src/test/scala"/>
<mkdir dir="src/lang"/>
<target name="merge.custom" description="Copying from the lang folder to merge with generated"> <target name="merge.custom" description="Copying from the lang folder to merge with generated">
<copy todir="../java/src/main/java/" overwrite="true"> <copy todir="../java/src/main/java/" overwrite="true">