Swagger: AS3 sdk - Updated build config for as3 code gen and sample file for build

This commit is contained in:
Deepak Michael 2011-08-25 09:34:24 +05:30
parent 62288f0e62
commit cc52b080fc
3 changed files with 160 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{
"apiUrl":"http://swagr.api.wordnik.com/v4/",
"apiUrl":"http://localhost:8002/api/",
"apiKey":"special-key",
@ -20,11 +20,11 @@
"apiPackageName":"com.wordnik.swagger.api",
"ignoreMethods":["WordAPI.getWordFrequency","WordAPI.getAudio","WordAPI.getWordStats","WordAPI.getFlickrImages"],
"ignoreMethods":[],
"ignoreModels":["wordStats","photo","sizes"],
"ignoreModels":[],
"outputDirectory":"../api-server-temp/as3ApiSDK/src/main/as3/com/wordnik/swagger/",
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/as3/com/wordnik/swagger/",
"libraryHome":"../api-server-temp/as3ApiSDK"
"libraryHome":"../swagger-sample-app/sdk-libs"
}

View File

@ -0,0 +1,28 @@
# Window and document title for the documentation
title=Sample app AS3 SDK API Documentation
#Path to the source folder where the .as files are located
sourcepath = ./src/main/as3
# Class-folders you want to search for classes to be included in the docs, seperated by spaces (for example ../com/ ../net/ )
# to include every .as and .mxml file within your project, just state ../
domainextensions = ./src/main/as3
# The Location of deployment library on your Computer (PC/Mac) for compiled SWC file
liboutputfolder = bin
liboutputfile = as3-sample-sdk.swc
libpath = lib
# The Location of the output folder for your generated documents
docsoutputfolder = asdoc
# Home directory for flex sdk 3, change this to build for Mac or PC using # as comment
# SDK_HOME = C:/Program Files/Adobe/Flash Builder 4/sdks/3.5.0
# SDK_HOME = /Applications/Adobe Flash Builder 4/sdks/3.5.0
# SDK_HOME = /usr/local/flex_sdk_4.1.0/
# FLEX_HOME = /usr/local/flex_sdk_4.1.0/
# The location of your asdoc.exe, change this to build for Mac or PC using # as comment
#asdoc.exe = C:/Program Files/Adobe/Flash Builder 4/sdks/3.5.0/bin/asdoc.exe
#asdoc.exe = /Applications/Adobe Flash Builder 4/sdks/3.5.0/bin/asdoc

127
conf/as3/sample/build.xml Normal file
View File

@ -0,0 +1,127 @@
<!-- Flex Library Project ASDocs -->
<project name="AS3SDKCompile" default="compile" basedir=".">
<!-- import our build properties file -->
<property file="./build.properties"/>
<property environment="env"/>
<property name="FLEX_HOME" value="${env.SDK_HOME}"/>
<!-- Flex Ant Tasks used to perform compc and mxml compiling more info at http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks -->
<taskdef resource="flexTasks.tasks" classpath="${env.SDK_HOME}/ant/lib/flexTasks.jar"/>
<target name="setup" description="perform an setup operations"/>
<!-- Execute the ASDoc Compile wich runs 3 seperate tasks in a series -->
<target name="compile" description="series of tasks to create docs and swc">
<!--<antcall target="cleanDir" description="clean the docs directory"/>-->
<!--<antcall target="asDocs" description="full build of asdocs"/>-->
<antcall target="buildSWC" description="build the SWC file"/>
</target>
<target name="deploy" description="perform an deployment operations"/>
<target name="install" description="perform an installation operations"/>
<!--
DELETE the existing output folder and files and then re-generate the output folder
-->
<target name="clean" description="DELETE the existing output folder and files and then re-generate the output folder">
<delete dir="${basedir}/${docsoutputfolder}" failonerror="true" includeemptydirs="true"/>
<delete file="${basedir}/${liboutputfolder}/${liboutputfile}"/>
<delete dir="${basedir}/dist" failonerror="true" includeemptydirs="true"/>
<mkdir dir="${basedir}/${docsoutputfolder}"/>
</target>
<!--
Run the ASDoc executable and generate the ASDocs to the new output folder
-->
<target name="docs" description="Run the ASDoc executable and generate the ASDocs to the new output folder">
<exec executable="${env.SDK_HOME}/bin/asdoc" failonerror="true">
<arg line="-doc-sources ${sourcepath}"/>
<arg line="-source-path ${sourcepath}"/>
<arg line="-footer 'Copyright Wordnik'"/>
<arg line="-package com.wordnik.swagger.api 'Contains the apis which are used by clients to make calls to the services deployed'"/>
<arg line="-package com.wordnik.swagger.model 'Contains common classes which encapsulate data elements required'"/>
<arg line="-package com.wordnik.swagger.common 'Contains classes which are used by the api classes to invoke the deployed api like SwaggerApi - a base class, ApiUserCredentials, etc.''"/>
<arg line="-package com.wordnik.swagger.event 'Results of calls made to Wordnik are returned via dispatched events. This package contains such event classes. Right now thats just ApiClientEvent and Response.'"/>
<arg line="-package com.wordnik.swagger.exception 'Contains classes that encapsulate the errors generated'"/>
<arg value="-window-title"/>
<arg value="${title}"/>
<arg value="-main-title"/>
<arg value="${title}"/>
<arg value="-output"/>
<arg value="${basedir}/${docsoutputfolder}"/>
<arg value="-external-library-path"/>
<arg value="${basedir}/${libpath}"/>
</exec>
<echo>docs created</echo>
</target>
<!--
Compile the SWC file library including lib folder and the path to our classes, we use compc for library,
check the docs for Flex Ant Tasks, http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks.
-->
<target name="buildSWC" description="Compile the SWC file for the Librayr Project">
<compc output="${basedir}/${liboutputfolder}/${liboutputfile}">
<!--
Include the path to any external SWC files used in the sdk, you may have to place name of SWC (ASAXB-0.1.1.swc) at end of path.
So file path would be file="${basedir}/${libpath}/ASAXB-0.1.1.swc"
-->
<include-libraries file="${basedir}/${libpath}/" />
<source-path path-element="${sourcepath}" />
<!-- include our Class packages into the build (com folder) -->
<include-sources dir="${sourcepath}" includes="*" />
</compc>
<echo>SWC created</echo>
</target>
<target name="dist" depends="clean, buildSWC, docs">
<mkdir dir="${basedir}/dist/lib"/>
<mkdir dir="${basedir}/dist/docs"/>
<mkdir dir="${basedir}/dist/sample"/>
<copy file="${basedir}/${liboutputfolder}/${liboutputfile}" todir="${basedir}/dist/lib/">
</copy>
<copy todir="${basedir}/dist/docs/">
<fileset dir="${basedir}/asdoc"/>
</copy>
<zip destfile="sample-as3-sdk.zip" basedir="${basedir}/dist" />
</target>
</project>