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

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