cloudstack/build/developer.xml
Vijayendra Bhamidipati b0facd16e4 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
At this point, the mgmt server comes up, loading the
	   Nexus related modules without dying.

Description:

	1) Added a new properties file for Cisco N1kv VSM commands:
		cisconexusvsm_commands.properties.in

	2) Added the CiscoNexusVSMElement to the components.xml file.

	3) Modified CiscoNexusVSMElement to implement NetworkElement.

		The NetworkElement interface functions are not
	  	relevant to the N1KV VSM, so we override them
	  	with noops.

	4) Added an addDao() of CiscoNexusVSMDeviceDaoImpl in populateDaos(),
	   else we'd run into a failure to look up the VSM's dao when the
	   mgmt server is starting up:

		com.cloud.utils.exception.CloudRuntimeException: Unable to find DAO com.cloud.network.dao.CiscoNexusVSMDeviceDao

	5) Also added the CiscoNexusVSMElementService in populateServices(),
	   and modified CiscoNexusVSMElement to implement Manager as well.

	6) populateServices() was running into an exception that indicated
	   that it was unable to find a commands.properties file for the
	   cisco n1kv vsm service. Fixed it by changing getProperties() in
	   CiscoNexusVSMElement to return the correct string
	   "cisconexusvsm_commands.properties", and putting in an @Override
	   for getProperties() in CiscoNexusVSMElement. Also fixed up all
	   the other functions in CiscoNexusVSMElement that needed to have
	   @Override. Also updated build/developers.xml with this file
	   location. And did other small cleanup.

	7) More clean up in CiscoNexusVSMDeviceManagerImpl.

Conflicts:

	server/src/com/cloud/configuration/DefaultComponentLibrary.java
2012-05-25 17:07:03 -07:00

411 lines
17 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<project name="CloudStack Developer Targets" basedir=".">
<description>
This is a developer.xml with tools to start and stop tomcat and
generally developer targets that has nothing to do with compiling.
</description>
<dirname property="base.dir" file="${ant.file.CloudStack Developer Targets}/.."/>
<property name="build.dir" location="${base.dir}/build"/>
<property name="tomcat.home" location="${env.CATALINA_HOME}"/>
<property name="assertion" value="-ea"/>
<property name="dist.dir" location="${base.dir}/dist"/>
<property name="deploy.work.dir" location="${dist.dir}"/>
<property name="server.deploy.to.dir" location="${tomcat.home}"/>
<property name="unittest.dir" location="${base.dir}/unittest"/>
<property name="unittest.target.dir" location="${unittest.dir}/classes"/>
<property name="unittest.jar.dir" location="${unittest.dir}/jar"/>
<property name="ovm.dir" location="${base.dir}/ovm" />
<property name="ovm-scripts.dir" location="${ovm.dir}/scripts" />
<!-- directories for api doc -->
<property name="api.docs.dir" location="${dist.dir}/apidocs" />
<condition property="jmxport" value="${jmxport.override}" else="45219">
<isset property="jmxport.override" />
</condition>
<macrodef name="compile-test">
<attribute name="top.dir" description="Top Directory of the source. We will add src to this to get the source code."/>
<attribute name="jar.name" description="Name of the jar file"/>
<attribute name="classpath" description="class path to use"/>
<element name="include-files" optional="true"/>
<element name="exclude-files" optional="true"/>
<sequential>
<mkdir dir="${unittest.target.dir}/@{jar.name}"/>
<depend srcdir="@{top.dir}/test" destdir="${unittest.target.dir}/@{jar.name}" cache="${dep.cache.dir}" />
<echo message="Compiling @{top.dir}/test"/>
<javac srcdir="@{top.dir}/test" debug="${debug}" debuglevel="${debuglevel}" deprecation="${deprecation}" destdir="${unittest.target.dir}/@{jar.name}" source="${source.compat.version}" target="${target.compat.version}" includeantruntime="false" compiler="javac1.6">
<compilerarg line="-Xlint:-path"/>
<classpath refid="@{classpath}" />
<exclude-files/>
</javac>
<jar jarfile="${unittest.jar.dir}/@{jar.name}" basedir="${unittest.target.dir}/@{jar.name}" update="true"/>
</sequential>
</macrodef>
<target name="clean-edits" description="Delete all the editor backup files in the source tree.">
<delete>
<fileset dir="${base.dir}" includes="**/*~" />
</delete>
</target>
<target name="run" depends="start-tomcat"/>
<target name="stop" depends="stop-tomcat"/>
<target name="debug" depends="debug-tomcat"/>
<target name="setup">
<mkdir dir="${build.dir}/override"/>
<copy todir="${build.dir}/override">
<fileset dir="${build.dir}">
<include name="build-cloud.properties"/>
<include name="replace.properties"/>
</fileset>
</copy>
<loadproperties srcfile="${build.dir}/override/replace.properties" resource="propertyresource"/>
<!-- propertyfile file="${build.dir}/override/replace.properties"/ -->
</target>
<target name="debug-suspend">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
<jvmarg value="-ea"/>
<jvmarg value="-Xms256m"/>
<jvmarg value="-Xmx384m"/>
</java>
</target>
<target name="stop-tomcat">
<java dir="${tomcat.home}/bin/" jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<arg value="stop"/>
</java>
</target>
<target name="start-tomcat" depends="stop-tomcat">
<echo message="Start Tomcat" />
<java dir="${tomcat.home}/bin/" jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="${assertion}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
<jvmarg value="-Xms256m"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-XX:MaxPermSize=128m"/>
<jvmarg value="-ea"/>
<arg value="start"/>
</java>
</target>
<target name="debug-tomcat">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="${debug.jvmarg}"/>
<jvmarg value="-ea"/>
<jvmarg value="-Xms256m"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-XX:MaxPermSize=128m"/>
</java>
</target>
<target name="clean-tomcat" depends="stop-tomcat,clean-awsapi-tomcat">
<delete dir="${tomcat.home}/webapps/client"/>
<delete dir="${tomcat.home}/webapps/awsapi" />
<delete dir="${tomcat.home}/work/Catalina"/>
<delete dir="${tomcat.home}/temp" />
<delete dir="${tomcat.home}/logs" />
<delete quiet="false" >
<fileset dir="${tomcat.home}/conf" >
<include name="**/component*.xml" />
</fileset>
</delete>
</target>
<target name="unzip" if="zip.uptodate">
<unzip src="${deploy.work.dir}/client.zip" dest="${deploy.work.dir}/client"/>
</target>
<target name="unzip-usage" if="usagezip.uptodate">
<unzip src="${deploy.work.dir}/usage.zip" dest="${deploy.work.dir}/usage"/>
</target>
<target name="deploy-ovm" >
<copy todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts">
<fileset dir="${ovm-scripts.dir}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="deploy-server" depends="deploy-common, deploy-ovm, deploy-awsapi" >
<copy todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/vms" file="${dist.dir}/systemvm.iso" />
</target>
<target name="deploy-common" >
<condition property="zip.uptodate">
<available file="${deploy.work.dir}/client.zip" type="file"/>
</condition>
<antcall target="unzip" inheritAll="true"/>
<unwar overwrite="true" src="${deploy.work.dir}/client/client.war" dest="${server.deploy.to.dir}/webapps/client"/>
<!-- <copy todir="${server.deploy.to.dir}/lib">
<fileset dir="${deploy.work.dir}/client/lib/">
<include name="*.jar"/>
</fileset>
</copy>
-->
<touch file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version"/>
<echo file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version" append="false" message="${version}.${build.number}"/>
<copy overwrite="true" todir="${server.deploy.to.dir}/conf">
<fileset dir="${deploy.work.dir}/client/conf/">
<include name="**/*"/>
</fileset>
</copy>
<chmod perm="755">
<fileset dir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib">
<include name="**/*"/>
</fileset>
</chmod>
<copy overwrite="true" todir="${server.deploy.to.dir}/lib" file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/cloud-mysql-connector-java-5.1.7-bin.jar" />
<delete file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/cloud-mysql-connector-java-5.1.7-bin.jar" />
<replace file="${server.deploy.to.dir}/conf/catalina.properties" summary="true">
<replacetoken><![CDATA[shared.loader=
]]></replacetoken>
<replacevalue><![CDATA[shared.loader=${catalina.home},${catalina.home}/conf
]]></replacevalue> </replace>
</target>
<target name="deploy-usage">
<condition property="usagezip.uptodate">
<available file="${deploy.work.dir}/usage.zip" type="file" />
</condition>
<antcall target="unzip-usage" inheritAll="true" />
<copy todir="${server.deploy.to.dir}/bin">
<fileset dir="${deploy.work.dir}/usage/bin/">
<include name="*.sh"/>
</fileset>
</copy>
<copy overwrite="true" todir="${server.deploy.to.dir}/conf">
<fileset dir="${deploy.work.dir}/usage/conf/">
<include name="**/*"/>
</fileset>
</copy>
<copy overwrite="true" todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib">
<fileset dir="${deploy.work.dir}/usage/lib/">
<include name="**/*.jar"/>
</fileset>
</copy>
</target>
<target name="deploy-cloudstack-db">
<condition property="server-setup.file" value="override/server-setup.xml" else="server-setup.xml">
<available file="${setup.db.dir}/override/server-setup.xml" />
</condition>
<condition property="templates.file" value="override/templates.sql" else="templates.sql" >
<available file="${setup.db.dir}/override/templates.sql" />
</condition>
<echo message="deploydb ${server-setup.file} ${templates.file} ${DBROOTPW}" />
<exec dir="${db.scripts.dir}" executable="bash">
<arg value="deploy-db-dev.sh" />
<arg value="${server-setup.file}" />
<arg value="${templates.file}" />
<arg value="${DBROOTPW}" />
<env key="CATALINA_HOME" value="${tomcat.home}"/>
</exec>
<chmod perm="666">
<fileset dir="${db.scripts.dir}">
<include name="**/*"/>
</fileset>
</chmod>
</target>
<target name="deploydb" depends="deploy-cloudstack-db, deploy-awsapi-db">
</target>
<target name="deploydb-simulator">
<condition property="server-setup.file" value="${setup.db.dir}/override/server-setup.xml" else="server-setup.xml">
<available file="${setup.db.dir}/override/server-setup.xml" />
</condition>
<condition property="templates.file" value="${setup.db.dir}/override/templates.sql" else="templates.sql" >
<available file="${setup.db.dir}/override/templates.sql" />
</condition>
<echo message="deploydb ${server-setup.file} ${templates.file} ${DBROOTPW}" />
<exec dir="${db.scripts.dir}" executable="bash">
<arg value="deploy-db-simulator.sh" />
<arg value="${server-setup.file}" />
<arg value="${templates.file}" />
<arg value="${DBROOTPW}" />
<env key="CATALINA_HOME" value="${tomcat.home}"/>
</exec>
<chmod perm="666">
<fileset dir="${db.scripts.dir}">
<include name="**/*"/>
</fileset>
</chmod>
</target>
<path id="test.classpath">
<path refid="deps.classpath" />
<path refid="dist.classpath"/>
<fileset dir="${unittest.jar.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${tools.dir}">
<include name="**/junit-4.8.1.jar"/>
</fileset>
<dirset dir="${utils.test.dir}/resources"/>
<dirset dir="${server.test.dir}/resources"/>
<dirset dir="${base.dir}/setup/db"/>
</path>
<target name="compile-tests" depends="compile-all">
<mkdir dir="${unittest.dir}"/>
<mkdir dir="${unittest.target.dir}"/>
<mkdir dir="${unittest.jar.dir}"/>
<compile-test jar.name="utils-test.jar" top.dir="${utils.dir}" classpath="test.classpath"/>
<compile-test jar.name="server-test.jar" top.dir="${server.dir}" classpath="test.classpath"/>
</target>
<target name="unittest" description="Execute unit tests" depends="compile-tests">
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
the former, we will get no detailed report about the failure.
If the test fails, the fail element below will still assure that
the Ant run will exit with error status.
-->
<!--bootclasspath refid="test.classpath"/-->
<classpath refid="test.classpath"/>
<jvmarg value="${debug.jvmarg}"/>
<batchtest todir="${unittest.dir}">
<formatter type="plain"/>
<fileset dir="${utils.test.dir}">
<include name="**/*Test.java"/>
</fileset>
<fileset dir="${server.test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${unittest.dir}">
<fileset dir="${unittest.dir}"/>
<report todir="${unittest.dir}/test-reports"/>
</junitreport>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target>
<target name="test" description="Execute one unit test" depends="compile-tests">
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
the former, we will get no detailed report about the failure.
If the test fails, the fail element below will still assure that
the Ant run will exit with error status.
-->
<classpath refid="test.classpath"/>
<jvmarg value="${debug.jvmarg}"/>
<jvmarg value="-ea"/>
<jvmarg value="-Xms1024m"/>
<jvmarg value="-Xmx1024m"/>
<batchtest todir="${unittest.dir}">
<formatter type="plain"/>
<fileset dir="${utils.test.dir}">
<include name="**/${test}.java"/>
</fileset>
<fileset dir="${server.test.dir}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${unittest.dir}">
<fileset dir="${unittest.dir}"/>
<report todir="${unittest.dir}/test-reports"/>
</junitreport>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target>
<target name="test-suspend" description="Execute one unit test" depends="compile-tests">
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
the former, we will get no detailed report about the failure.
If the test fails, the fail element below will still assure that
the Ant run will exit with error status.
-->
<classpath refid="test.classpath"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
<jvmarg value="${assertion}"/>
<batchtest todir="${unittest.dir}">
<formatter type="plain"/>
<fileset dir="${utils.test.dir}">
<include name="**/${test}.java"/>
</fileset>
<fileset dir="${server.test.dir}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${unittest.dir}">
<fileset dir="${unittest.dir}"/>
<report todir="${unittest.dir}/test-reports"/>
</junitreport>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target>
<target name="build-apidocs" description="Generate api documentation" depends="build-all">
<property name="commands.file" location="${dist.dir}/client/conf/commands.properties" />
<property name="commands.ext.file" location="${dist.dir}/client/conf/commands-ext.properties" />
<property name="commands.f5.file" location="${dist.dir}/client/conf/f5bigip_commands.properties" />
<property name="commands.juniper.file" location="${dist.dir}/client/conf/junipersrx_commands.properties" />
<property name="commands.cisco.file" location="${dist.dir}/client/conf/cisconexusvsm_commands.properties" />
<property name="commands.netscaler.file" location="${dist.dir}/client/conf/netscalerloadbalancer_commands.properties" />
<property name="commands.vr.file" location="${dist.dir}/client/conf/virtualrouter_commands.properties" />
<echo message="build-apidocs" />
<exec dir="${apidoc.scripts.dir}" executable="bash">
<arg value="build-apidoc.sh" />
<arg value="${target.dir}/jar" />
<arg value="${deps.dir}" />
<arg value="${dist.dir}" />
<arg value="-f ${commands.cisco.file},${commands.file},${commands.ext.file},${commands.f5.file},${commands.juniper.file},${commands.netscaler.file},${commands.vr.file}" />
</exec>
<echo message="Result locates at ${dist.dir}/commands.xml" />
<chmod perm="666">
<fileset dir="${apidoc.scripts.dir}">
<include name="**/*"/>
</fileset>
</chmod>
</target>
<target name="build-apidocs-zip" depends="build-apidocs">
<delete file="${dist.dir}/apidocs-${version}.zip" />
<zip destfile="${dist.dir}/apidocs-${version}.zip" basedir="${dist.dir}/xmldoc/html" />
</target>
</project>