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