[1031] | 1 | <project name="dcworms" default="compile" basedir="."> |
---|
[477] | 2 | |
---|
| 3 | <!-- declare location of basic directories and variables in the project--> |
---|
| 4 | <property name="src" location="src" /> |
---|
| 5 | <property name="build" location="build" /> |
---|
| 6 | <property name="jars" location="jars" /> |
---|
| 7 | |
---|
| 8 | <!-- define basic classpath. This jars are required to compile source code. --> |
---|
| 9 | <path id="class.path"> |
---|
| 10 | <pathelement path="${jars}/bsh-2.0b4.jar" /> |
---|
| 11 | <pathelement path="${jars}/colt.jar" /> |
---|
| 12 | <pathelement path="${jars}/commons-lang-2.6.jar" /> |
---|
[1227] | 13 | <pathelement path="${jars}/commons-io-2.4.jar" /> |
---|
[477] | 14 | <pathelement path="${jars}/commons-logging.jar" /> |
---|
[1251] | 15 | <pathelement path="${jars}/commons-math3-3.2.jar" /> |
---|
[477] | 16 | <pathelement path="${jars}/gridsim.jar" /> |
---|
| 17 | <pathelement path="${jars}/gssim_workload3g.jar" /> |
---|
| 18 | <pathelement path="${jars}/guava-13.0.jar" /> |
---|
[1257] | 19 | <pathelement path="${jars}/jcommon-1.0.18.jar" /> |
---|
| 20 | <pathelement path="${jars}/jfreechart-1.0.15.jar" /> |
---|
[477] | 21 | <pathelement path="${jars}/qcg_schemas_tools.jar" /> |
---|
[936] | 22 | <pathelement path="${jars}/qcg_job_schemas.jar" /> |
---|
[973] | 23 | <!--<pathelement path="${jars}/qcg-broker_schemas.jar" /> --> |
---|
[1250] | 24 | <pathelement path="${jars}/dcworms_resource_schema.jar" /> |
---|
[477] | 25 | <pathelement path="${jars}/simjava.jar" /> |
---|
| 26 | <pathelement path="${jars}/TimetableChart.jar" /> |
---|
| 27 | <pathelement path="${jars}/joda-time/joda-time-1.6.jar" /> |
---|
[1254] | 28 | <pathelement path="${jars}/log4j-1.2.17.jar" /> |
---|
[477] | 29 | <pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-codegen.jar" /> |
---|
| 30 | <pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-core.jar" /> |
---|
| 31 | <pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-xml-schema.jar" /> |
---|
| 32 | <pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-xml.jar" /> |
---|
| 33 | <pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1.jar" /> |
---|
[1255] | 34 | <pathelement path="${jars}/saxon9he.jar" /> |
---|
| 35 | <pathelement path="${jars}/saxon9-unpack.jar" /> |
---|
[477] | 36 | </path> |
---|
| 37 | |
---|
| 38 | <!-- |
---|
| 39 | compile all source code, except test.* package. Class files are located in |
---|
| 40 | ${build}/classes directory along with the java files. |
---|
| 41 | --> |
---|
| 42 | <target name="compile" depends="init"> |
---|
| 43 | |
---|
| 44 | <copy todir="${build}/classes"> |
---|
| 45 | <fileset dir="${src}"> |
---|
| 46 | <exclude name="simulator/factory/QueueingSystemFactory.java" /> |
---|
| 47 | <exclude name="simulator/factory/ResourcesRandomNumbersFactory.java" /> |
---|
| 48 | <exclude name="simulator/factory/SingleResourceFactory.java" /> |
---|
| 49 | <exclude name="simulator/lists/ResourceUsage.java" /> |
---|
| 50 | <exclude name="simulator/lists/ResourceUsageDynamic.java" /> |
---|
| 51 | <exclude name="simulator/workload/generator/ResourceGeneratorInterface.java" /> |
---|
| 52 | <exclude name="simulator/workload/generator/impl/ResourceGenerator.java" /> |
---|
| 53 | <exclude name="simulator/workload/generator/validators/ResourceConfigValidator.java" /> |
---|
| 54 | <exclude name="simulator/workload/generator/validators/XMLValidator.java" /> |
---|
[1141] | 55 | <exclude name="test/drs_tst/**" /> |
---|
[477] | 56 | </fileset> |
---|
| 57 | </copy> |
---|
| 58 | |
---|
| 59 | <javac srcdir="${build}/classes" destdir="${build}/classes" debug="on" includeantruntime="false"> |
---|
| 60 | <classpath refid="class.path" /> |
---|
| 61 | </javac> |
---|
| 62 | |
---|
| 63 | </target> |
---|
| 64 | |
---|
| 65 | <!-- |
---|
| 66 | creates jar files from copiled classes. |
---|
[1031] | 67 | dcworms.jar - contains all compiled classes |
---|
[477] | 68 | schedframe.jar - contains classes only from schedframe package |
---|
[1031] | 69 | dcworms_schedframe.jar - contains classes only from dcworms.schedframe package, |
---|
| 70 | those classes are DCworms specific implementations of interfaces from schedframe package |
---|
| 71 | dcworms_light.jar - contains all classes except those from schedframe and dcworms.schedframe |
---|
[477] | 72 | packages |
---|
| 73 | --> |
---|
| 74 | <target name="jar" depends="compile, |
---|
| 75 | jar.schedframe, |
---|
[1031] | 76 | jar.dcworms.schedframe, |
---|
| 77 | jar.dcworms.light, |
---|
| 78 | jar.dcworms" /> |
---|
[477] | 79 | |
---|
| 80 | <target name="jar.schedframe"> |
---|
| 81 | <jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" /> |
---|
| 82 | </target> |
---|
| 83 | |
---|
[1031] | 84 | <target name="jar.dcworms.schedframe"> |
---|
| 85 | <jar destfile="${build}/dcworms_schedframe.jar" basedir="${build}/classes" includes="dcworms/schedframe/**" /> |
---|
[477] | 86 | </target> |
---|
| 87 | |
---|
[1031] | 88 | <target name="jar.dcworms.light"> |
---|
| 89 | <jar destfile="${build}/dcworms_light.jar" basedir="${build}/classes" excludes="schedframe/**,dcworms/schedframe/**" /> |
---|
[477] | 90 | </target> |
---|
| 91 | |
---|
[1031] | 92 | <target name="jar.dcworms"> |
---|
| 93 | <jar destfile="${build}/dcworms.jar" basedir="${build}/classes" /> |
---|
[477] | 94 | </target> |
---|
| 95 | |
---|
| 96 | <!-- |
---|
| 97 | creates build directory where compiled classes and build jar |
---|
| 98 | will be placed |
---|
| 99 | --> |
---|
| 100 | <target name="init"> |
---|
| 101 | <mkdir dir="${build}/classes" /> |
---|
| 102 | </target> |
---|
| 103 | |
---|
| 104 | <!-- removes build directory from the file system --> |
---|
[1031] | 105 | <target name="clean" > |
---|
[477] | 106 | <delete dir="${build}" /> |
---|
| 107 | </target> |
---|
| 108 | |
---|
| 109 | <!-- |
---|
| 110 | Start expetiment execution. This target requires an additional parameter |
---|
| 111 | -Dconfig which points experiment configuration file. |
---|
| 112 | Usage: ant run -Dconfig="example/experiment.properties" |
---|
| 113 | --> |
---|
| 114 | <target name="run"> |
---|
| 115 | <available property="properties.file" type="file" file="${config}" value="${config}" /> |
---|
| 116 | <antcall target="runExperiment" /> |
---|
| 117 | </target> |
---|
| 118 | |
---|
| 119 | <target name="runExperiment" depends="compile" if="properties.file"> |
---|
| 120 | <echo message="Running experiment described in: ${properties.file}" /> |
---|
| 121 | |
---|
| 122 | <java classname="simulator.DataCenterWorkloadSimulator" classpath="${build}/classes" fork="true"> |
---|
| 123 | <arg file="${properties.file}" /> |
---|
[688] | 124 | <jvmarg value="-Xms512M"/> |
---|
[971] | 125 | <jvmarg value="-Xmx1024M"/> |
---|
[477] | 126 | <classpath> |
---|
| 127 | <path refid="class.path" /> |
---|
| 128 | <pathelement path="${jars}/junit-4.4.jar" /> |
---|
[1254] | 129 | <pathelement path="${jars}/log4j-1.2.17.jar" /> |
---|
[477] | 130 | <pathelement path="${jars}/xalan-2.6.jar" /> |
---|
| 131 | <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" /> |
---|
| 132 | <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" /> |
---|
| 133 | <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" /> |
---|
| 134 | <dirset dir="properties" /> |
---|
| 135 | </classpath> |
---|
| 136 | </java> |
---|
| 137 | </target> |
---|
| 138 | |
---|
[1014] | 139 | <target name="translate"> |
---|
[1015] | 140 | <available property="plmxml.file" type="file" file="${config}" value="${config}" /> |
---|
[1014] | 141 | <antcall target="runTranslate" /> |
---|
[926] | 142 | </target> |
---|
| 143 | |
---|
[1015] | 144 | <target name="runTranslate" depends="compile" if="plmxml.file"> |
---|
| 145 | <echo message="Running translation for file: ${plmxml.file}" /> |
---|
[1012] | 146 | |
---|
[926] | 147 | <java classname="test.DEBBTranslator.src.PLMXMLTranslator" classpath="${build}/classes" fork="true"> |
---|
[1015] | 148 | <arg file="${plmxml.file}" /> |
---|
[926] | 149 | <jvmarg value="-Xms512M"/> |
---|
[936] | 150 | <jvmarg value="-Xmx1024M"/> |
---|
[926] | 151 | <classpath> |
---|
| 152 | <path refid="class.path" /> |
---|
| 153 | <pathelement path="${jars}/junit-4.4.jar" /> |
---|
[1254] | 154 | <pathelement path="${jars}/log4j-1.2.17.jar" /> |
---|
[926] | 155 | <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" /> |
---|
| 156 | <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" /> |
---|
| 157 | <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" /> |
---|
[1015] | 158 | <pathelement path="${jars}/saxon9he.jar" /> |
---|
| 159 | <pathelement path="${jars}/saxon9-unpack.jar" /> |
---|
[926] | 160 | <dirset dir="properties" /> |
---|
| 161 | </classpath> |
---|
| 162 | </java> |
---|
| 163 | </target> |
---|
[477] | 164 | </project> |
---|