build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Fri, 19 Jun 2009 21:46:14 +0200
changeset 1246 293b390ba471
parent 1245 1f8950ac34bf
child 1247 b4727fd16c4b
permissions -rw-r--r--
Cleaning base from references to applet. All eliminated except RepaintManager which has been enriched in 1.6 with a public method that takes Applet as parameter.
jtulach@1237
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@1237
     2
<project name="modularize" default="all" basedir=".">
jtulach@1237
     3
    <description>Scripts to build JDK Java sources in modularized way</description>
jtulach@1237
     4
jtulach@1237
     5
    <target name="all">
jtulach@1238
     6
        <antcall target="base"/>
jtulach@1245
     7
        <antcall target="corba"/>
jtulach@1237
     8
    </target>
jtulach@1241
     9
jtulach@1237
    10
    <!-- basic parameters -->
jtulach@1242
    11
    <property name="plugs" value="../../plugs"/>
jtulach@1242
    12
    <fail message="You need to provide location of plugs">
jtulach@1242
    13
        <condition><not><available file="${plugs}/jre/lib/rt-closed.jar"/></not></condition>
jtulach@1242
    14
    </fail>
jtulach@1241
    15
    <pathconvert property="gensrc">
jtulach@1241
    16
        <path><dirset dir="../build"><include name="*/gensrc"/></dirset></path>
jtulach@1241
    17
    </pathconvert>
jtulach@1241
    18
    <fail message="You need to provide location of JDK's generated sources via -Dgensrc=...">
jtulach@1241
    19
        <condition><not><available file="${gensrc}"/></not></condition>
jtulach@1241
    20
    </fail>
jtulach@1243
    21
jtulach@1243
    22
    <target name="merge-sources"
jtulach@1243
    23
        description="Copies sources from all over the JDK tree into one place"
jtulach@1243
    24
    >
jtulach@1243
    25
        <mkdir dir="build/sources"/>
jtulach@1243
    26
        <copy todir="build/sources">
jtulach@1243
    27
            <fileset dir="${gensrc}"/>
jtulach@1243
    28
            <fileset dir="${gensrc}/../impsrc">
jtulach@1243
    29
                <exclude name="org/relaxng/datatype/**"/>
jtulach@1243
    30
            </fileset>
jtulach@1243
    31
            <fileset dir="../jaxp/src/share/classes/">
jtulach@1243
    32
                <exclude name="org/relaxng/datatype/**"/>
jtulach@1243
    33
            </fileset>
jtulach@1243
    34
            <fileset dir="../langtools/src/share/classes/">
jtulach@1243
    35
                <exclude name="org/relaxng/datatype/**"/>
jtulach@1243
    36
            </fileset>
jtulach@1243
    37
            <fileset dir="../jaxws/src/share/classes/">
jtulach@1243
    38
                <exclude name="org/relaxng/datatype/**"/>
jtulach@1243
    39
            </fileset>
jtulach@1243
    40
            <fileset dir="../corba/src/share/classes/"/>
jtulach@1243
    41
        </copy>
jtulach@1243
    42
    </target>
jtulach@1243
    43
jtulach@1237
    44
    <path id="src.path">
jtulach@1237
    45
        <pathelement location="src/share/classes"/>
jtulach@1243
    46
        <pathelement location="build/sources"/>
jtulach@1237
    47
        <pathelement location="src/solaris/classes"/>
jtulach@1242
    48
<!--        <pathelement location="src/windows/classes"/> -->
jtulach@1237
    49
    </path>
jtulach@1237
    50
    <property name="build.dir" location="build/modularize"/>
jtulach@1237
    51
jtulach@1237
    52
    <!-- this is the core of the separation - definition
jtulach@1237
    53
      of what classes belong into what compilation group.
jtulach@1237
    54
    -->
jtulach@1237
    55
    <selector id="applet">
jtulach@1246
    56
        <and>
jtulach@1246
    57
            <or>
jtulach@1246
    58
                <filename name="java/beans/AppletInitializer*"/>
jtulach@1246
    59
                <filename name="java/applet/**"/>
jtulach@1246
    60
                <filename name="javax/swing/JApplet*"/>
jtulach@1246
    61
                <filename name="sun/applet/**"/>
jtulach@1246
    62
                <filename name="META-INF/services/sun.beans.AppletProxy"/>
jtulach@1246
    63
                <!-- either this or include AudioClip in client package
jtulach@1246
    64
                <filename name="sun/net/www/content/audio/**"/>
jtulach@1246
    65
                -->
jtulach@1246
    66
            </or>
jtulach@1246
    67
            <none>
jtulach@1246
    68
                <filename name="java/applet/AudioClip*"/>
jtulach@1246
    69
                <filename name="sun/applet/AppletAudioClip*"/>
jtulach@1246
    70
            </none>
jtulach@1246
    71
        </and>
jtulach@1237
    72
    </selector>
jtulach@1245
    73
    <selector id="corba">
jtulach@1245
    74
        <or>
jtulach@1245
    75
            <filename name="org/omg/**"/>
jtulach@1245
    76
            <filename name="com/sun/corba/**"/>
jtulach@1245
    77
            <filename name="com/sun/jmx/remote/internal/ProxyInputStream.java"/>
jtulach@1245
    78
            <filename name="com/sun/jndi/cosnaming/**"/>
jtulach@1245
    79
            <filename name="com/sun/jndi/toolkit/corba/**"/>
jtulach@1245
    80
            <filename name="com/sun/jndi/url/iiop/**"/>
jtulach@1245
    81
            <filename name="com/sun/jndi/url/iiopname/**"/>
jtulach@1245
    82
            <filename name="com/sun/jndi/url/corbaname/**"/>
jtulach@1245
    83
            <filename name="javax/management/remote/rmi/RMIConnector.java"/>
jtulach@1245
    84
            <filename name="javax/management/remote/rmi/RMIConnectorServer.java"/>
jtulach@1245
    85
            <filename name="javax/management/remote/rmi/RMIServerImpl.java"/>
jtulach@1245
    86
            <filename name="javax/management/remote/rmi/RMIIIOPServerImpl.java"/>
jtulach@1245
    87
            <filename name="javax/management/remote/rmi/RMIConnectionImpl.java"/>
jtulach@1245
    88
            <filename name="javax/management/remote/rmi/RMIJRMPServerImpl.java"/>
jtulach@1245
    89
            <filename name="javax/rmi/PortableRemoteObject.java"/>
jtulach@1245
    90
            <filename name="com/sun/jmx/remote/security/FileLoginModule.java"/>
jtulach@1245
    91
            <filename name="com/sun/jmx/remote/security/JMXPluggableAuthenticator.java"/>
jtulach@1245
    92
            <filename name="com/sun/jmx/remote/protocol/rmi/ClientProvider.java"/>
jtulach@1245
    93
            <filename name="com/sun/jmx/remote/protocol/rmi/ClientProvider.java"/>
jtulach@1245
    94
            <filename name="com/sun/jmx/remote/protocol/iiop/ClientProvider.java"/>
jtulach@1245
    95
            <filename name="com/sun/jmx/remote/protocol/iiop/ServerProvider.java"/>
jtulach@1245
    96
            <filename name="com/sun/jmx/remote/protocol/rmi/ServerProvider.java"/>
jtulach@1245
    97
            <filename name="com/sun/jndi/url/iiop/iiopURLContextFactory.java"/>
jtulach@1245
    98
            <filename name="sun/rmi/rmic/RMIGenerator.java"/>
jtulach@1245
    99
            <filename name="sun/management/jmxremote/ConnectorBootstrap.java"/>
jtulach@1245
   100
            <filename name="sun/management/Agent.java"/>
jtulach@1245
   101
            <filename name="sun/management/snmp/AdaptorBootstrap.java"/>
jtulach@1245
   102
            <filename name="javax/rmi/CORBA/**"/>
jtulach@1245
   103
            <filename name="com/sun/org/omg/**"/>
jtulach@1245
   104
            <filename name="javax/management/remote/rmi/RMIConnectorServer.java"/>
jtulach@1245
   105
            <filename name="com/sun/jndi/url/iiop/iiopURLContext.java"/>
jtulach@1245
   106
            <filename name="sun/rmi/rmic/iiop/**"/>
jtulach@1245
   107
jtulach@1245
   108
            <!-- now there are just two references in jconsole -->
jtulach@1245
   109
            <filename name="sun/tools/jconsole/**"/>
jtulach@1245
   110
        </or>
jtulach@1245
   111
    </selector>
jtulach@1237
   112
    <selector id="beans">
jtulach@1238
   113
        <and>
jtulach@1238
   114
            <or>
jtulach@1238
   115
                <filename name="java/beans/**"/>
jtulach@1238
   116
                <filename name="sun/beans/**"/>
jtulach@1238
   117
                <filename name="com/sun/beans/**"/>
jtulach@1238
   118
            </or>
jtulach@1238
   119
            <none>
jtulach@1238
   120
                <selector refid="applet"/>
jtulach@1240
   121
                <selector refid="deprecated7"/>
jtulach@1238
   122
            </none>
jtulach@1238
   123
        </and>
jtulach@1237
   124
    </selector>
jtulach@1237
   125
jtulach@1240
   126
    <selector id="deprecated7">
jtulach@1240
   127
        <or>
jtulach@1240
   128
            <filename name="java/beans/Beans*"/>
jtulach@1246
   129
jtulach@1246
   130
            <!-- tools -->
jtulach@1246
   131
            <filename name="sun/tools/serialver/**"/>
jtulach@1246
   132
            <filename name="com/sun/tools/corba/**"/>
jtulach@1240
   133
        </or>
jtulach@1240
   134
    </selector>
jtulach@1240
   135
jtulach@1237
   136
    <selector id="base">
jtulach@1245
   137
        <none>
jtulach@1245
   138
            <!-- exclude classes from other modules -->
jtulach@1245
   139
            <selector refid="corba"/>
jtulach@1246
   140
            <selector refid="applet"/>
jtulach@1246
   141
            <selector refid="deprecated7"/>
jtulach@1241
   142
        <!--
jtulach@1237
   143
            <selector refid="beans"/>
jtulach@1241
   144
            <selector refid="client"/>
jtulach@1241
   145
            <selector refid="enterprise"/>
jtulach@1240
   146
            <selector refid="deprecated7"/>
jtulach@1241
   147
            -->
jtulach@1245
   148
jtulach@1245
   149
jtulach@1245
   150
            <!-- non-important non-API things
jtulach@1245
   151
                which cannot be compiled easily
jtulach@1241
   152
            -->
jtulach@1241
   153
            <filename name="**/*-*"/>
jtulach@1241
   154
            <filename name="java/dyn/**"/>
jtulach@1241
   155
            <filename name="sun/dyn/**"/>
jtulach@1244
   156
            
jtulach@1242
   157
            <filename name="com/sun/script/javascript/**"/>
jtulach@1243
   158
            <filename name="sun/dc/**"/>
jtulach@1243
   159
            <filename name="sun/nio/fs/Solaris**"/>
jtulach@1241
   160
            <filename name="sun/tracing/**"/>
jtulach@1243
   161
            <filename name="com/sun/tracing/ProviderFactory*"/>
jtulach@1237
   162
        </none>
jtulach@1237
   163
    </selector>
jtulach@1237
   164
jtulach@1237
   165
    <!-- individual compilation tasks -->
jtulach@1237
   166
jtulach@1240
   167
    <target name="deprecated7">
jtulach@1240
   168
        <antcall target="-compile-one-module">
jtulach@1240
   169
            <param name="module" value="deprecated7"/>
jtulach@1246
   170
            <param name="depends" value="base:applet"/>
jtulach@1240
   171
        </antcall>
jtulach@1240
   172
    </target>
jtulach@1237
   173
    <target name="applet">
jtulach@1237
   174
        <antcall target="-compile-one-module">
jtulach@1237
   175
            <param name="module" value="applet"/>
jtulach@1246
   176
            <param name="depends" value="base"/>
jtulach@1237
   177
        </antcall>
jtulach@1237
   178
    </target>
jtulach@1237
   179
    <target name="beans">
jtulach@1237
   180
        <antcall target="-compile-one-module">
jtulach@1237
   181
            <param name="module" value="beans"/>
jtulach@1237
   182
        </antcall>
jtulach@1237
   183
    </target>
jtulach@1245
   184
    <target name="corba">
jtulach@1245
   185
        <antcall target="-compile-one-module">
jtulach@1245
   186
            <param name="module" value="corba"/>
jtulach@1245
   187
            <param name="depends" value="base"/>
jtulach@1245
   188
        </antcall>
jtulach@1245
   189
    </target>
jtulach@1237
   190
jtulach@1241
   191
jtulach@1238
   192
    <target name="base">
jtulach@1241
   193
        <antcall target="-compile-one-module">
jtulach@1241
   194
            <param name="module" value="base"/>
jtulach@1241
   195
        </antcall>
jtulach@1237
   196
    </target>
jtulach@1237
   197
jtulach@1237
   198
    <!-- shared routine to compile one of the modules -->
jtulach@1237
   199
    <target name="-compile-one-module">
jtulach@1237
   200
        <mkdir dir="${build.dir}/classes/${module}"/>
jtulach@1240
   201
        <pathconvert pathsep=":"  property="module.cp">
jtulach@1238
   202
            <path path="${depends}"/>
jtulach@1238
   203
            <mapper type="regexp" from=".*[/\\]([^/\\]*)" to="${build.dir}/\1.jar"/>
jtulach@1238
   204
        </pathconvert>
jtulach@1242
   205
        <jar
jtulach@1242
   206
            basedir="${build.dir}/classes/${module}"
jtulach@1242
   207
            destfile="${build.dir}/empty.jar"
jtulach@1242
   208
            compress="false"
jtulach@1242
   209
        >
jtulach@1242
   210
            <exclude name="**"/>
jtulach@1242
   211
        </jar>
jtulach@1238
   212
        <javac
jtulach@1242
   213
            bootclasspath="${build.dir}/empty.jar"
jtulach@1238
   214
            sourcepath=""
jtulach@1238
   215
            destdir="${build.dir}/classes/${module}"
jtulach@1238
   216
            includejavaruntime="false"
jtulach@1238
   217
            includeantruntime="false"
jtulach@1242
   218
            classpath="${module.cp}:${plugs}/jre/lib/rt-closed.jar"
jtulach@1238
   219
        >
jtulach@1237
   220
            <src refid="src.path"/>
jtulach@1245
   221
            <and>
jtulach@1245
   222
                <selector refid="${module}"/>
jtulach@1245
   223
                <not><filename name="**/*-template.java"/></not>
jtulach@1245
   224
            </and>
jtulach@1237
   225
        </javac>
jtulach@1238
   226
        <copy todir="${build.dir}/classes/${module}">
jtulach@1238
   227
            <fileset dir="src/share/classes">
jtulach@1238
   228
                <and>
jtulach@1238
   229
                    <selector refid="${module}"/>
jtulach@1238
   230
                    <not>
jtulach@1238
   231
                        <filename name="**/*.java"/>
jtulach@1238
   232
                    </not>
jtulach@1238
   233
                </and>
jtulach@1238
   234
            </fileset>
jtulach@1238
   235
        </copy>
jtulach@1238
   236
jtulach@1238
   237
        <jar 
jtulach@1238
   238
            basedir="${build.dir}/classes/${module}"
jtulach@1238
   239
            destfile="${build.dir}/${module}.jar"
jtulach@1238
   240
            compress="false"
jtulach@1238
   241
        />
jtulach@1237
   242
    </target>
jtulach@1237
   243
jtulach@1237
   244
    <!-- clean everything -->
jtulach@1237
   245
    <target name="clean">
jtulach@1237
   246
        <delete dir="${build.dir}"/>
jtulach@1237
   247
    </target>
jtulach@1237
   248
</project>