source: DCWoRMS/branches/coolemall/build.xml @ 1257

Revision 1257, 6.6 KB checked in by wojtekp, 11 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1<project name="dcworms" 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
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" />
13                <pathelement path="${jars}/commons-io-2.4.jar" />
14                <pathelement path="${jars}/commons-logging.jar" />
15                <pathelement path="${jars}/commons-math3-3.2.jar" />
16                <pathelement path="${jars}/gridsim.jar" />
17                <pathelement path="${jars}/gssim_workload3g.jar" />
18                <pathelement path="${jars}/guava-13.0.jar" />
19                <pathelement path="${jars}/jcommon-1.0.18.jar" />
20                <pathelement path="${jars}/jfreechart-1.0.15.jar" />
21                <pathelement path="${jars}/qcg_schemas_tools.jar" />
22                <pathelement path="${jars}/qcg_job_schemas.jar" />
23                <!--<pathelement path="${jars}/qcg-broker_schemas.jar" /> -->
24                <pathelement path="${jars}/dcworms_resource_schema.jar" />
25                <pathelement path="${jars}/simjava.jar" />
26                <pathelement path="${jars}/TimetableChart.jar" />
27                <pathelement path="${jars}/joda-time/joda-time-1.6.jar" />
28                <pathelement path="${jars}/log4j-1.2.17.jar" />
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" />
34        <pathelement path="${jars}/saxon9he.jar" />
35        <pathelement path="${jars}/saxon9-unpack.jar" />
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" />
55                                <exclude name="test/drs_tst/**" />
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.
67                dcworms.jar - contains all compiled classes
68                schedframe.jar - contains classes only from schedframe package
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
72                        packages
73        -->
74        <target name="jar" depends="compile,
75                                                                jar.schedframe,
76                                                                jar.dcworms.schedframe,
77                                                                jar.dcworms.light,
78                                                                jar.dcworms" />
79
80        <target name="jar.schedframe">
81                <jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" />
82        </target>
83
84        <target name="jar.dcworms.schedframe">
85                <jar destfile="${build}/dcworms_schedframe.jar" basedir="${build}/classes" includes="dcworms/schedframe/**" />
86        </target>
87
88        <target name="jar.dcworms.light">
89                <jar destfile="${build}/dcworms_light.jar" basedir="${build}/classes" excludes="schedframe/**,dcworms/schedframe/**" />
90        </target>
91
92        <target name="jar.dcworms">
93                <jar destfile="${build}/dcworms.jar" basedir="${build}/classes" />
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 -->
105        <target name="clean" >
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}" />
124                        <jvmarg value="-Xms512M"/> 
125                        <jvmarg value="-Xmx1024M"/> 
126                        <classpath>
127                                <path refid="class.path" />
128                                <pathelement path="${jars}/junit-4.4.jar" />
129                                <pathelement path="${jars}/log4j-1.2.17.jar" />
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
139        <target name="translate">
140                <available property="plmxml.file" type="file" file="${config}" value="${config}" />
141                <antcall target="runTranslate" />
142        </target>
143
144        <target name="runTranslate" depends="compile" if="plmxml.file">
145                <echo message="Running translation for file: ${plmxml.file}" />
146               
147                <java classname="test.DEBBTranslator.src.PLMXMLTranslator" classpath="${build}/classes" fork="true">
148                        <arg file="${plmxml.file}" />
149                        <jvmarg value="-Xms512M"/> 
150                        <jvmarg value="-Xmx1024M"/> 
151                        <classpath>
152                                <path refid="class.path" />
153                                <pathelement path="${jars}/junit-4.4.jar" />
154                                <pathelement path="${jars}/log4j-1.2.17.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                <pathelement path="${jars}/saxon9he.jar" />
159                <pathelement path="${jars}/saxon9-unpack.jar" />
160                                <dirset dir="properties" />
161                        </classpath>
162                </java>
163        </target>
164</project>
Note: See TracBrowser for help on using the repository browser.