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

Revision 1227, 6.4 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}/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                                <exclude name="test/drs_tst/**" />
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                dcworms.jar - contains all compiled classes
65                schedframe.jar - contains classes only from schedframe package
66                dcworms_schedframe.jar - contains classes only from dcworms.schedframe package,
67                        those classes are DCworms specific implementations of interfaces from schedframe package
68                dcworms_light.jar - contains all classes except those from schedframe and dcworms.schedframe
69                        packages
70        -->
71        <target name="jar" depends="compile,
72                                                                jar.schedframe,
73                                                                jar.dcworms.schedframe,
74                                                                jar.dcworms.light,
75                                                                jar.dcworms" />
76
77        <target name="jar.schedframe">
78                <jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" />
79        </target>
80
81        <target name="jar.dcworms.schedframe">
82                <jar destfile="${build}/dcworms_schedframe.jar" basedir="${build}/classes" includes="dcworms/schedframe/**" />
83        </target>
84
85        <target name="jar.dcworms.light">
86                <jar destfile="${build}/dcworms_light.jar" basedir="${build}/classes" excludes="schedframe/**,dcworms/schedframe/**" />
87        </target>
88
89        <target name="jar.dcworms">
90                <jar destfile="${build}/dcworms.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        <!-- removes build directory from the file system -->
102        <target name="clean" >
103                <delete dir="${build}" />
104        </target>
105       
106        <!--
107                Start expetiment execution. This target requires an additional parameter
108                -Dconfig which points experiment configuration file.
109                Usage: ant run -Dconfig="example/experiment.properties"
110        -->
111        <target name="run">
112                <available property="properties.file" type="file" file="${config}" value="${config}" />
113                <antcall target="runExperiment" />
114        </target>
115
116        <target name="runExperiment" depends="compile" if="properties.file">
117                <echo message="Running experiment described in: ${properties.file}" />
118
119                <java classname="simulator.DataCenterWorkloadSimulator" classpath="${build}/classes" fork="true">
120                        <arg file="${properties.file}" />
121                        <jvmarg value="-Xms512M"/> 
122                        <jvmarg value="-Xmx1024M"/> 
123                        <classpath>
124                                <path refid="class.path" />
125                                <pathelement path="${jars}/junit-4.4.jar" />
126                                <pathelement path="${jars}/log4j-1.2.13.jar" />
127                                <pathelement path="${jars}/xalan-2.6.jar" />
128                                <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" />
129                                <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" />
130                                <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" />
131                                <dirset dir="properties" />
132                        </classpath>
133                </java>
134        </target>
135
136        <target name="translate">
137                <available property="plmxml.file" type="file" file="${config}" value="${config}" />
138                <antcall target="runTranslate" />
139        </target>
140
141        <target name="runTranslate" depends="compile" if="plmxml.file">
142                <echo message="Running translation for file: ${plmxml.file}" />
143               
144                <java classname="test.DEBBTranslator.src.PLMXMLTranslator" classpath="${build}/classes" fork="true">
145                        <arg file="${plmxml.file}" />
146                        <jvmarg value="-Xms512M"/> 
147                        <jvmarg value="-Xmx1024M"/> 
148                        <classpath>
149                                <path refid="class.path" />
150                                <pathelement path="${jars}/junit-4.4.jar" />
151                                <pathelement path="${jars}/log4j-1.2.13.jar" />
152                                <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" />
153                                <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" />
154                                <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" />
155                <pathelement path="${jars}/saxon9he.jar" />
156                <pathelement path="${jars}/saxon9-unpack.jar" />
157                                <dirset dir="properties" />
158                        </classpath>
159                </java>
160        </target>
161</project>
Note: See TracBrowser for help on using the repository browser.