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

Revision 1251, 6.5 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.10.jar" />
20                <pathelement path="${jars}/jfreechart-1.0.6.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.13.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        </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="simulator/factory/QueueingSystemFactory.java" />
45                                <exclude name="simulator/factory/ResourcesRandomNumbersFactory.java" />
46                                <exclude name="simulator/factory/SingleResourceFactory.java" />
47                                <exclude name="simulator/lists/ResourceUsage.java" />
48                                <exclude name="simulator/lists/ResourceUsageDynamic.java" />
49                                <exclude name="simulator/workload/generator/ResourceGeneratorInterface.java" />
50                                <exclude name="simulator/workload/generator/impl/ResourceGenerator.java" />
51                                <exclude name="simulator/workload/generator/validators/ResourceConfigValidator.java" />
52                                <exclude name="simulator/workload/generator/validators/XMLValidator.java" />
53                                <exclude name="test/drs_tst/**" />
54                        </fileset>
55                </copy>
56
57                <javac srcdir="${build}/classes" destdir="${build}/classes" debug="on" includeantruntime="false">
58                        <classpath refid="class.path" />
59                </javac>
60
61        </target>
62
63        <!--
64                creates jar files from copiled classes.
65                dcworms.jar - contains all compiled classes
66                schedframe.jar - contains classes only from schedframe package
67                dcworms_schedframe.jar - contains classes only from dcworms.schedframe package,
68                        those classes are DCworms specific implementations of interfaces from schedframe package
69                dcworms_light.jar - contains all classes except those from schedframe and dcworms.schedframe
70                        packages
71        -->
72        <target name="jar" depends="compile,
73                                                                jar.schedframe,
74                                                                jar.dcworms.schedframe,
75                                                                jar.dcworms.light,
76                                                                jar.dcworms" />
77
78        <target name="jar.schedframe">
79                <jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" />
80        </target>
81
82        <target name="jar.dcworms.schedframe">
83                <jar destfile="${build}/dcworms_schedframe.jar" basedir="${build}/classes" includes="dcworms/schedframe/**" />
84        </target>
85
86        <target name="jar.dcworms.light">
87                <jar destfile="${build}/dcworms_light.jar" basedir="${build}/classes" excludes="schedframe/**,dcworms/schedframe/**" />
88        </target>
89
90        <target name="jar.dcworms">
91                <jar destfile="${build}/dcworms.jar" basedir="${build}/classes" />
92        </target>
93
94        <!--
95                creates build directory where compiled classes and build jar
96                will be placed
97        -->
98        <target name="init">
99                <mkdir dir="${build}/classes" />
100        </target>
101
102        <!-- removes build directory from the file system -->
103        <target name="clean" >
104                <delete dir="${build}" />
105        </target>
106       
107        <!--
108                Start expetiment execution. This target requires an additional parameter
109                -Dconfig which points experiment configuration file.
110                Usage: ant run -Dconfig="example/experiment.properties"
111        -->
112        <target name="run">
113                <available property="properties.file" type="file" file="${config}" value="${config}" />
114                <antcall target="runExperiment" />
115        </target>
116
117        <target name="runExperiment" depends="compile" if="properties.file">
118                <echo message="Running experiment described in: ${properties.file}" />
119
120                <java classname="simulator.DataCenterWorkloadSimulator" classpath="${build}/classes" fork="true">
121                        <arg file="${properties.file}" />
122                        <jvmarg value="-Xms512M"/> 
123                        <jvmarg value="-Xmx1024M"/> 
124                        <classpath>
125                                <path refid="class.path" />
126                                <pathelement path="${jars}/junit-4.4.jar" />
127                                <pathelement path="${jars}/log4j-1.2.13.jar" />
128                                <pathelement path="${jars}/xalan-2.6.jar" />
129                                <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" />
130                                <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" />
131                                <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" />
132                                <dirset dir="properties" />
133                        </classpath>
134                </java>
135        </target>
136
137        <target name="translate">
138                <available property="plmxml.file" type="file" file="${config}" value="${config}" />
139                <antcall target="runTranslate" />
140        </target>
141
142        <target name="runTranslate" depends="compile" if="plmxml.file">
143                <echo message="Running translation for file: ${plmxml.file}" />
144               
145                <java classname="test.DEBBTranslator.src.PLMXMLTranslator" classpath="${build}/classes" fork="true">
146                        <arg file="${plmxml.file}" />
147                        <jvmarg value="-Xms512M"/> 
148                        <jvmarg value="-Xmx1024M"/> 
149                        <classpath>
150                                <path refid="class.path" />
151                                <pathelement path="${jars}/junit-4.4.jar" />
152                                <pathelement path="${jars}/log4j-1.2.13.jar" />
153                                <pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" />
154                                <pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" />
155                                <pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" />
156                <pathelement path="${jars}/saxon9he.jar" />
157                <pathelement path="${jars}/saxon9-unpack.jar" />
158                                <dirset dir="properties" />
159                        </classpath>
160                </java>
161        </target>
162</project>
Note: See TracBrowser for help on using the repository browser.