Subversion Repositories DevTools

Rev

Rev 227 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 4995
Line 1... Line 1...
1
<project name="reports" default="make_package" basedir=".">
1
<project name="PACKAGE" default="make_package" basedir=".">
2
 
2
 
-
 
3
    <!--
-
 
4
        Import files that specify versions of this and other packages
-
 
5
     -->
3
<import file="auto.xml"/>
6
    <import file="auto.xml" optional="true"/> <!-- Created by the ABT -->
4
<import file="${ant.project.name}depends.xml"/>
7
    <import file="${ant.project.name}depends.xml"/>  <!-- Non ABT use -->
-
 
8
 
5
 
9
 
-
 
10
    <!--
6
<target name="build"/>
11
      Common properties using within the build
-
 
12
    -->
7
<target name="make_package" depends="my_make_package"/>
13
   	<description>Example of Building with ant</description>
-
 
14
 
8
<target name="run_tests"/>
15
	<property name="env" environment="env" value="not used"/>
9
 
16
 
10
<!-- =================================================================== -->
17
   	<property name="src.dir"         value="${basedir}/src"/>
11
<!--  Import packages                                                    -->
18
   	<property name="build.dir"       value="${basedir}/build"/>
12
<!-- =================================================================== -->
19
   	<property name="classes.dir"     value="${build.dir}/classes"/>
13
<property name="env" environment="env" value="not used"/>
20
   	<property name="jar.dir"         value="${build.dir}/jar"/>
-
 
21
   	<property name="pkg.dir"         value="${build.dir}/pkg"/>	
-
 
22
 
-
 
23
    <!--
-
 
24
      Provide access to components in dependent packages
-
 
25
      The package versions are specified as properties in the
-
 
26
      'depends' file and are used here by the 'using' task.
-
 
27
    -->
14
<import file="${env.JATS_HOME}/ant-manifest/${ant-manifest}/ant-manifest.xml"/>
28
	<import file="${env.GBE_DPKG}/ant-using/${ant-using}/ant-using.xml"/>
-
 
29
    <usingall/>
-
 
30
 
15
 
31
 
-
 
32
 <!--
-
 
33
      B U I L D
-
 
34
      This target is required by the Automated Build Environment
-
 
35
      The target should setup the 'sandbox'
-
 
36
      In many cases this will be empty
-
 
37
     -->
16
<property name="pkg" value="build/pkg"/>
38
      <target name="build" 
-
 
39
		     depends="" 
-
 
40
		     description="Setup build sandbox">
-
 
41
	</target>
17
 
42
 
-
 
43
	<!--
-
 
44
	  M A K E _ P A C K A G E
18
<!-- =================================================================== -->
45
        This target is required by the Automated Build Environment
-
 
46
        It should:
-
 
47
          1) Compile / Build stuff
19
<!--  Package up the files and create the manifest (deskpkg)             -->
48
          2) Package up the build artefacts that are being exported
20
<!-- =================================================================== -->
49
          3) Create the 'descpkg' file
21
 
50
 
-
 
51
      In this example the process is broken into three other targets for
-
 
52
      the purpose of illustrating the steps.
-
 
53
	  -->
22
<target name="my_make_package" depends="clean">
54
	<target name="make_package" 
-
 
55
			 depends="clean,compile,package">
-
 
56
	</target>
23
 
57
 
-
 
58
    <!--
-
 
59
      R U N _ T E S T S
-
 
60
      This target is optional in the Automated Build Environment
24
    <echo message="Create the package image" />
61
      If the Release Manager entry advertises that the package has unit 
-
 
62
      tests, then this target must exist
-
 
63
 
-
 
64
      It should run automated unit tests which conform to the Unit Test 
25
    <mkdir dir="${pkg}"/>
65
      Automation Paper
-
 
66
      It does not have to be dependent on the build process as this will 
-
 
67
      already have been performed.
-
 
68
     -->
26
 
69
 
27
    <!-- Copy in files -->
70
    <target name="run_tests" 
28
	<mkdir dir="${pkg}/dml"/>
71
		     depends="test_1"  
29
	<copy todir="${pkg}/dml" verbose="false" flatten="false" includeEmptyDirs="false">
72
		     description="Run automated unit tests">
30
	    <fileset dir="${basedir}/../../dml" />
73
    </target>
31
	</copy>
74
     
-
 
75
<!-- End of Mandatory Target ======================================= -->
-
 
76
<!-- The following targets are used by the mandatory targets         -->
32
 
77
 
-
 
78
	<target name="compile" 
-
 
79
              depends=""  description="Compile stuff">
33
	<mkdir dir="${pkg}/rpt"/>
80
        <mkdir dir="${classes.dir}"/>
34
	<copy todir="${pkg}/rpt" verbose="false" flatten="true" includeEmptyDirs="false">
81
        <javac srcdir="${src.dir}" destdir="${classes.dir}"/>
-
 
82
 
35
	    <fileset dir="${basedir}/../../src">
83
        <mkdir dir="${jar.dir}"/>
36
            <exclude name="*/ObsoleteReports/*" />
84
        <jar destfile="${jar.dir}/${packagename}.jar"
37
            <exclude name="*/Configuration Data/*" />
85
             basedir="${classes.dir}">
38
            <exclude name="*/Exports/*" />
86
            <manifest>
39
            <exclude name="*/Payment Management/*" />
87
                <attribute name="Main-Class" value="HelloWorld"/>
40
            <exclude name="*/Actionlist/*" />
88
            </manifest>
41
        </fileset>
89
        </jar>
42
	</copy>
90
	</target>
-
 
91
 
43
 
92
 
-
 
93
    <!--
44
	<mkdir dir="${pkg}/jsp"/>
94
      Create the package image
45
	<copy todir="${pkg}/jsp" verbose="false" flatten="false" includeEmptyDirs="false">
95
      This must be in the directory ${basedir}/build/pkg, as other 
46
	    <fileset dir="${basedir}/../../CEParams" >
96
      build tools will assume that directory as the location of 
-
 
97
      the package.
-
 
98
 
-
 
99
      Note: The structure of the package is not free-form.
47
            <include name="rptschedule.csp" />
100
            Jar files should go into a 'jar' subdirectory
48
            <include name="rptviewer.csp" />
101
            No files should be places in the package root directory
-
 
102
     -->
-
 
103
	<target name="package" 
49
        </fileset>
104
               depends=""  
-
 
105
               description="Package build artifacts">
-
 
106
 
-
 
107
        <mkdir dir="${pkg.dir}/jar"/>
-
 
108
	    <copy todir="${pkg.dir}/jar">
-
 
109
		    <fileset dir="${jar.dir}" includes="**/*"/>
50
	</copy>
110
		</copy>
-
 
111
		<summarise-manifest/>
51
    
112
    
-
 
113
	</target>
52
 
114
 
-
 
115
	<!--
-
 
116
	  -    This target executes all unit tests in MyPackageTestSuite
53
    <!-- Create the descpkg file -->
117
	  -    It depends on the junit framework.
54
    <summarise-manifest package="${packagename}" version="${packageversion}"/>
118
	  -	Further details regarding how to unit test under ANT are
-
 
119
	  -	present in the ANT manual
55
</target>
120
	  -->
56
 
-
 
57
 
-
 
-
 
121
       <target name = "test_1">
58
<!-- =================================================================== -->
122
		<junit printsummary="yes" fork="yes" haltonfailure="no">
-
 
123
			<classpath>
59
<!--  Clean up build artifacts                                           -->
124
				<pathelement location="${build.dir}/classes" />
-
 
125
			</classpath>
-
 
126
			<formatter type="xml"/>
60
<!-- =================================================================== -->
127
			<test name="com.vixtechnology.MyPackage.tests.MyPackageTestSuite"/>
-
 
128
		</junit>
-
 
129
	</target>
61
 
130
 
62
<target name="clean">
-
 
63
    <delete dir="build"/>
-
 
64
</target>
131
</project> 
65
 
132
 
66
</project>
-