[104] | 1 | <project name="gssim" default="compile" basedir="."> |
---|
| 2 | |
---|
| 3 | <!-- declare location of basic directories and variables in the project--> |
---|
| 4 | <property name="src" location="src" /> |
---|
| 5 | <property name="db" location="db" /> |
---|
| 6 | <property name="build" location="build" /> |
---|
| 7 | <property name="jars" location="jars" /> |
---|
| 8 | <property name="to-grms" location="to-grms" /> |
---|
| 9 | <property name="sftp-grms" value="grass1.man.poznan.pl:/opt/app/gssim/" /> |
---|
| 10 | |
---|
| 11 | <!-- define basic classpath. This jars are required to compile source code. --> |
---|
| 12 | <path id="class.path"> |
---|
| 13 | <pathelement path="${jars}/commons-logging.jar" /> |
---|
| 14 | <pathelement path="${jars}/commons-compress-1.0.jar" /> |
---|
| 15 | <pathelement path="${jars}/grms3g_schedulingplan.jar" /> |
---|
| 16 | <pathelement path="${jars}/joda-time/joda-time-1.6.jar" /> |
---|
| 17 | <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" /> |
---|
| 18 | <pathelement path="${jars}/castor_snapshot/castor-codegen-1.2.1-SNAPSHOT.jar" /> |
---|
| 19 | <pathelement path="${jars}/castor_snapshot/castor-xml-schema-1.2.1-SNAPSHOT.jar" /> |
---|
| 20 | <pathelement path="${jars}/grms3g_resreqs.jar" /> |
---|
| 21 | <pathelement path="${jars}/grms3g_jobdesc.jar" /> |
---|
| 22 | <pathelement path="${jars}/grms3g_hostparams.jar" /> |
---|
| 23 | <pathelement path="${jars}/grms3g_SchemaTools.jar" /> |
---|
| 24 | <pathelement path="${jars}/qcg-broker_schemas.jar" /> |
---|
| 25 | <pathelement path="${jars}/qcg_schemas_tools.jar" /> |
---|
| 26 | <pathelement path="${jars}/gridsim.jar" /> |
---|
| 27 | <pathelement path="${jars}/simjava.jar" /> |
---|
| 28 | <pathelement path="${jars}/gssim_workload3g.jar" /> |
---|
| 29 | <pathelement path="${jars}/jfreechart-1.0.6.jar" /> |
---|
| 30 | <pathelement path="${jars}/jcommon-1.0.10.jar" /> |
---|
| 31 | <pathelement path="${jars}/TimetableChart.jar" /> |
---|
| 32 | <pathelement path="${jars}/colt.jar" /> |
---|
| 33 | <pathelement path="${jars}/bsh-2.0b4.jar" /> |
---|
| 34 | <pathelement path="${jars}/db_connectors/mysql-connector-java-5.1.13-bin.jar" /> |
---|
| 35 | </path> |
---|
| 36 | |
---|
| 37 | <!-- |
---|
| 38 | compile all source code, except test.* package. Class files are located in |
---|
| 39 | ${build}/classes directory along with the java files. |
---|
| 40 | --> |
---|
| 41 | <target name="compile" depends="init"> |
---|
| 42 | |
---|
| 43 | <copy todir="${build}/classes"> |
---|
| 44 | <fileset dir="${src}"> |
---|
| 45 | <exclude name="test/local/**" /> |
---|
| 46 | <exclude name="test/unit/**" /> |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | <exclude name="simulator/factory/QueueingSystemFactory.java" /> |
---|
| 50 | <exclude name="simulator/factory/ResourcesRandomNumbersFactory.java" /> |
---|
| 51 | <exclude name="simulator/factory/SingleResourceFactory.java" /> |
---|
| 52 | <exclude name="simulator/lists/ResourceUsage.java" /> |
---|
| 53 | <exclude name="simulator/lists/ResourceUsageDynamic.java" /> |
---|
| 54 | <exclude name="simulator/workload/generator/ResourceGeneratorInterface.java" /> |
---|
| 55 | <exclude name="simulator/workload/generator/impl/ResourceGenerator.java" /> |
---|
| 56 | <exclude name="simulator/workload/generator/validators/ResourceConfigValidator.java" /> |
---|
| 57 | <exclude name="simulator/workload/generator/validators/XMLValidator.java" /> |
---|
| 58 | |
---|
| 59 | </fileset> |
---|
| 60 | <fileset dir="${db}" /> |
---|
| 61 | </copy> |
---|
| 62 | |
---|
| 63 | <javac srcdir="${build}/classes" destdir="${build}/classes" debug="on" includeantruntime="false"> |
---|
| 64 | <classpath refid="class.path" /> |
---|
| 65 | </javac> |
---|
| 66 | |
---|
| 67 | </target> |
---|
| 68 | |
---|
| 69 | <!-- |
---|
| 70 | creates jar files from copiled classes. |
---|
| 71 | gssim.jar - contains all compiled classes |
---|
| 72 | schedframe.jar - contains classes only from schedframe package |
---|
| 73 | gssim_schedframe.jar - contains classes only from gssim.schedframe package, |
---|
| 74 | those classes are GSSIM specific implementations of interfaces from schedframe package |
---|
| 75 | gssim_light.jar - contains all classes except those from schedframe and gssim.schedframe |
---|
| 76 | packages |
---|
| 77 | --> |
---|
| 78 | <target name="jar" depends="compile, |
---|
| 79 | jar.schedframe, |
---|
| 80 | jar.gssim.db, |
---|
| 81 | jar.gssim.schedframe, |
---|
| 82 | jar.gssim.light, |
---|
| 83 | jar.gssim" /> |
---|
| 84 | |
---|
| 85 | <target name="jar.schedframe"> |
---|
| 86 | <jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" /> |
---|
| 87 | </target> |
---|
| 88 | |
---|
| 89 | <target name="jar.gssim.schedframe"> |
---|
| 90 | <jar destfile="${build}/gssim_schedframe.jar" basedir="${build}/classes" includes="gssim/schedframe/**" /> |
---|
| 91 | </target> |
---|
| 92 | |
---|
| 93 | <target name="jar.gssim.db"> |
---|
| 94 | <jar destfile="${build}/gssim_db.jar" basedir="${build}/classes" includes="gssim/db/**" /> |
---|
| 95 | </target> |
---|
| 96 | |
---|
| 97 | <target name="jar.gssim.light"> |
---|
| 98 | <jar destfile="${build}/gssim_light.jar" basedir="${build}/classes" excludes="schedframe/**,gssim/schedframe/**,gssim/db/**" /> |
---|
| 99 | </target> |
---|
| 100 | |
---|
| 101 | <target name="jar.gssim"> |
---|
| 102 | <jar destfile="${build}/gssim.jar" basedir="${build}/classes" /> |
---|
| 103 | </target> |
---|
| 104 | |
---|
| 105 | <!-- |
---|
| 106 | creates build directory where compiled classes and build jar |
---|
| 107 | will be placed |
---|
| 108 | --> |
---|
| 109 | <target name="init"> |
---|
| 110 | <mkdir dir="${build}/classes" /> |
---|
| 111 | </target> |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | <!-- prepares file structure to run on grms --> |
---|
| 115 | <target name="grms.prepare" depends="compile, jar.gssim"> |
---|
| 116 | <copy todir="${to-grms}/jars"> |
---|
| 117 | <fileset dir="${jars}" /> |
---|
| 118 | </copy> |
---|
| 119 | |
---|
| 120 | <copy todir="${to-grms}/simulator"> |
---|
| 121 | <fileset dir="simulator" /> |
---|
| 122 | </copy> |
---|
| 123 | |
---|
| 124 | <copy todir="${to-grms}/properties"> |
---|
| 125 | <fileset dir="properties" /> |
---|
| 126 | </copy> |
---|
| 127 | |
---|
| 128 | <copy file="${build}/gssim.jar" tofile="${to-grms}/gssim.jar" /> |
---|
| 129 | <copy file="start-gssim.sh" tofile="${to-grms}/start-gssim.sh" /> |
---|
| 130 | <chmod file="${to-grms}/start-gssim.sh" perm="ugo+rx" /> |
---|
| 131 | <copy file="start-db-analyzer.sh" tofile="${to-grms}/start-db-analyzer.sh" /> |
---|
| 132 | <chmod file="${to-grms}/start-db-analyzer.sh" perm="ugo+rx" /> |
---|
| 133 | </target> |
---|
| 134 | |
---|
| 135 | <target name="grms.sftp" description="Copies to sftp"> |
---|
| 136 | <scp todir="${username}:${password}@${sftp-grms}"> |
---|
| 137 | <fileset dir="${to-grms}"/> |
---|
| 138 | </scp> |
---|
| 139 | </target> |
---|
| 140 | |
---|
| 141 | <!-- removes directory for preparation to grms from the file system --> |
---|
| 142 | <target name="grms.clean"> |
---|
| 143 | <delete dir="${to-grms}" /> |
---|
| 144 | </target> |
---|
| 145 | |
---|
| 146 | <target name="grms.install" depends="grms.prepare, grms.sftp, grms.clean"/> |
---|
| 147 | |
---|
| 148 | <!-- removes build directory from the file system --> |
---|
| 149 | <target name="clean" depends="grms.clean"> |
---|
| 150 | <delete dir="${build}" /> |
---|
| 151 | </target> |
---|
| 152 | |
---|
| 153 | <!-- |
---|
| 154 | Start expetiment execution. This target requires an additional parameter |
---|
| 155 | -Dconfig which points experiment configuration file. |
---|
| 156 | Usage: ant run -Dconfig="example/experiment.properties" |
---|
| 157 | --> |
---|
| 158 | <target name="run"> |
---|
| 159 | <available property="properties.file" type="file" file="${config}" value="${config}" /> |
---|
| 160 | <antcall target="runExperiment" /> |
---|
| 161 | </target> |
---|
| 162 | |
---|
| 163 | <target name="runExperiment" depends="compile" if="properties.file"> |
---|
| 164 | <echo message="Running experiment described in: ${properties.file}" /> |
---|
| 165 | |
---|
| 166 | <java classname="simulator.GridSchedulingSimulator" classpath="${build}/classes" fork="true"> |
---|
| 167 | <arg file="${properties.file}" /> |
---|
| 168 | <classpath> |
---|
| 169 | <path refid="class.path" /> |
---|
| 170 | <pathelement path="${jars}/commons-beanutils.jar" /> |
---|
| 171 | <pathelement path="${jars}/commons-digester-1.7.jar" /> |
---|
| 172 | <pathelement path="${jars}/junit-4.4.jar" /> |
---|
| 173 | <pathelement path="${jars}/log4j-1.2.13.jar" /> |
---|
| 174 | <pathelement path="${jars}/xalan-2.6.jar" /> |
---|
| 175 | <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" /> |
---|
| 176 | <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" /> |
---|
| 177 | <dirset dir="properties" /> |
---|
| 178 | </classpath> |
---|
| 179 | </java> |
---|
| 180 | </target> |
---|
| 181 | |
---|
| 182 | </project> |
---|