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