summaryrefslogtreecommitdiffstats
path: root/org.aspectj.lib/build-aspectjlib.xml
blob: f35a25b9a9ba3decf84f95c6d3f5a6913739d847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!-- wrapped at 70 characters, long elements wrapped -->
<!-- =========================================================================== 

 Copyright (c) 2005 Contributors.
 All rights reserved. 
 This program and the accompanying materials are made available 
 under the terms of the Eclipse Public License v1.0 
 which accompanies this distribution and is available at 
 http://eclipse.org/legal/epl-v10.html 

 Contributors: 
     Wes Isberg       initial implementation 
	
============================================================================ -->

<project name="aspectj-library" default="aspectjlib" basedir=".">

    <target name="aspectjlib" depends="compile" />
    <target name="info">
        <echo>
  This script builds the AspectJ library.  

  Relevant targets:
     aspectjlib      build library

  Setup:
     - Run from the doc/aspectjlib directory in your AspectJ distribution.
       The tasks in ../../lib/aspectjtools.jar are used automatically.

  Variants:
     - To define a variable, use the Ant -D option - e.g., on Windows:
  
         ant -f build.xml -DJAVA_HOME=c:\jdk1.3.1 -Dnorun=skip

      </echo>
    </target>


    <!-- ============================================================= -->
    <!-- setup and cleanup targets                                     -->
    <!-- ============================================================= -->

    <target name="clean"
            depends="init"
            description="clean and create classes/jar dir, .ajesym files"
    >
        <delete quiet="on" dir="${jar.dir}" />
        <delete quiet="on">
            <fileset dir="${org.aspectj.lib.dir}"
                     includes="**/*.ajesym"
            />
        </delete>
        <mkdir dir="${jar.dir}" />
    </target>

    <target name="init" depends="init.variables,init.taskdefs" />

    <target name="init.variables" description="init variables">

        <property name="org.aspectj.lib.dir" location="${basedir}" />
        <property name="src.dir"
                  location="${org.aspectj.lib.dir}/src"
        />

        <!-- find AspectJ lib dir in distribution or AspectJ CVS tree -->
        <property name="aspectj.dist.lib"
                  location="${basedir}/../../lib"
        />

        <property name="aspectj.tree.lib"
                  location="${basedir}/../lib/aspectj/lib"
        />

        <condition property="aspectj.lib.dir"
                   value="${aspectj.dist.lib}"
        >
            <available file="${aspectj.dist.lib}/aspectjtools.jar" />
        </condition>

        <condition property="aspectj.lib.dir"
                   value="${aspectj.tree.lib}"
        >
            <available file="${aspectj.tree.lib}/aspectjtools.jar" />
        </condition>

        <property name="aspectjrt.jar"
                  location="${aspectj.lib.dir}/aspectjrt.jar"
        />
        <property name="aspectjtools.jar"
                  location="${aspectj.lib.dir}/aspectjtools.jar"
        />
        <property name="aspectjweaver.jar"
                  location="${aspectj.lib.dir}/aspectjweaver.jar"
        />

        <property name="jar.dir"
                  location="${org.aspectj.lib.dir}/jars"
        />
        <property name="aspectjlib.out.jar"
                  location="${jar.dir}/aspectjlib.out.jar"
        />

        <available file="${aspectjtools.jar}"
                   property="aspectjtools.jar.available"
        />
        <available file="${aspectjrt.jar}"
                   property="aspectjrt.jar.available"
        />

        <property name="library.packages" value="org.aspectj.lib" />
    </target>

    <target name="init.taskdefs"
            depends="init.variables, 
         aspectjtools.jar.available,
         aspectjrt.jar.available"
            unless="taskdefs.init"
    >
        <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"
        >
            <classpath>
                <pathelement path="${aspectjtools.jar}" />
            </classpath>
        </taskdef>
        <property name="taskdefs.init" value="true" />
    </target>

    <target name="aspectjrt.jar.available"
            depends="init.variables"
            unless="aspectjrt.jar.available"
    >
        <fail message="expecting aspectjrt.jar at ${aspectjrt.jar}" />
    </target>

    <target name="aspectjtools.jar.available"
            depends="init.variables"
            unless="aspectjtools.jar.available"
    >
        <fail message="expecting aspectjtools.jar at ${aspectjtools.jar}"
        />
    </target>

    <target name="compile"
            depends="init"
            description="compile library"
    >
        <antcall target="clean" />
        <!-- can use ajc or iajc here -->
        <iajc sourceroots="${src.dir}"
              fork="true"
              forkclasspath="${aspectjtools.jar}"
              classpath="${aspectjrt.jar}"
              outjar="${aspectjlib.out.jar}"
        />

    </target>

</project>