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