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