build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Fri, 19 Jun 2009 17:10:53 +0200
changeset 1245 1f8950ac34bf
parent 1244 f2029f449786
child 1246 293b390ba471
permissions -rw-r--r--
corba classes separated, base does not depend on them anymore
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@1237
    56
        <or>
jtulach@1238
    57
            <filename name="java/beans/AppletInitializer*"/>
jtulach@1237
    58
            <filename name="java/applet/**"/>
jtulach@1237
    59
            <filename name="sun/applet/**"/>
jtulach@1238
    60
            <filename name="META-INF/services/sun.beans.AppletProxy"/>
jtulach@1237
    61
        </or>
jtulach@1237
    62
    </selector>
jtulach@1245
    63
    <selector id="corba">
jtulach@1245
    64
        <or>
jtulach@1245
    65
            <filename name="org/omg/**"/>
jtulach@1245
    66
            <filename name="com/sun/corba/**"/>
jtulach@1245
    67
            <filename name="com/sun/jmx/remote/internal/ProxyInputStream.java"/>
jtulach@1245
    68
            <filename name="com/sun/jndi/cosnaming/**"/>
jtulach@1245
    69
            <filename name="com/sun/jndi/toolkit/corba/**"/>
jtulach@1245
    70
            <filename name="com/sun/jndi/url/iiop/**"/>
jtulach@1245
    71
            <filename name="com/sun/jndi/url/iiopname/**"/>
jtulach@1245
    72
            <filename name="com/sun/jndi/url/corbaname/**"/>
jtulach@1245
    73
            <filename name="javax/management/remote/rmi/RMIConnector.java"/>
jtulach@1245
    74
            <filename name="javax/management/remote/rmi/RMIConnectorServer.java"/>
jtulach@1245
    75
            <filename name="javax/management/remote/rmi/RMIServerImpl.java"/>
jtulach@1245
    76
            <filename name="javax/management/remote/rmi/RMIIIOPServerImpl.java"/>
jtulach@1245
    77
            <filename name="javax/management/remote/rmi/RMIConnectionImpl.java"/>
jtulach@1245
    78
            <filename name="javax/management/remote/rmi/RMIJRMPServerImpl.java"/>
jtulach@1245
    79
            <filename name="javax/rmi/PortableRemoteObject.java"/>
jtulach@1245
    80
            <filename name="com/sun/jmx/remote/security/FileLoginModule.java"/>
jtulach@1245
    81
            <filename name="com/sun/jmx/remote/security/JMXPluggableAuthenticator.java"/>
jtulach@1245
    82
            <filename name="com/sun/jmx/remote/protocol/rmi/ClientProvider.java"/>
jtulach@1245
    83
            <filename name="com/sun/jmx/remote/protocol/rmi/ClientProvider.java"/>
jtulach@1245
    84
            <filename name="com/sun/jmx/remote/protocol/iiop/ClientProvider.java"/>
jtulach@1245
    85
            <filename name="com/sun/jmx/remote/protocol/iiop/ServerProvider.java"/>
jtulach@1245
    86
            <filename name="com/sun/jmx/remote/protocol/rmi/ServerProvider.java"/>
jtulach@1245
    87
            <filename name="com/sun/jndi/url/iiop/iiopURLContextFactory.java"/>
jtulach@1245
    88
            <filename name="sun/rmi/rmic/RMIGenerator.java"/>
jtulach@1245
    89
            <filename name="sun/management/jmxremote/ConnectorBootstrap.java"/>
jtulach@1245
    90
            <filename name="sun/management/Agent.java"/>
jtulach@1245
    91
            <filename name="sun/management/snmp/AdaptorBootstrap.java"/>
jtulach@1245
    92
            <filename name="javax/rmi/CORBA/**"/>
jtulach@1245
    93
            <filename name="com/sun/org/omg/**"/>
jtulach@1245
    94
            <filename name="javax/management/remote/rmi/RMIConnectorServer.java"/>
jtulach@1245
    95
            <filename name="com/sun/jndi/url/iiop/iiopURLContext.java"/>
jtulach@1245
    96
            <filename name="sun/rmi/rmic/iiop/**"/>
jtulach@1245
    97
jtulach@1245
    98
            <!-- this actually does not depend on corba, but probably
jtulach@1245
    99
              does not belong to base either -->
jtulach@1245
   100
            <filename name="com/sun/tools/corba/**"/>
jtulach@1245
   101
            <!-- now there are just two references in jconsole -->
jtulach@1245
   102
            <filename name="sun/tools/jconsole/**"/>
jtulach@1245
   103
        </or>
jtulach@1245
   104
    </selector>
jtulach@1237
   105
    <selector id="beans">
jtulach@1238
   106
        <and>
jtulach@1238
   107
            <or>
jtulach@1238
   108
                <filename name="java/beans/**"/>
jtulach@1238
   109
                <filename name="sun/beans/**"/>
jtulach@1238
   110
                <filename name="com/sun/beans/**"/>
jtulach@1238
   111
            </or>
jtulach@1238
   112
            <none>
jtulach@1238
   113
                <selector refid="applet"/>
jtulach@1240
   114
                <selector refid="deprecated7"/>
jtulach@1238
   115
            </none>
jtulach@1238
   116
        </and>
jtulach@1237
   117
    </selector>
jtulach@1237
   118
jtulach@1240
   119
    <selector id="deprecated7">
jtulach@1240
   120
        <or>
jtulach@1240
   121
            <filename name="java/beans/Beans*"/>
jtulach@1240
   122
        </or>
jtulach@1240
   123
    </selector>
jtulach@1240
   124
jtulach@1237
   125
    <selector id="base">
jtulach@1245
   126
        <none>
jtulach@1245
   127
            <!-- exclude classes from other modules -->
jtulach@1245
   128
            <selector refid="corba"/>
jtulach@1241
   129
        <!--
jtulach@1237
   130
            <selector refid="beans"/>
jtulach@1241
   131
            <selector refid="client"/>
jtulach@1241
   132
            <selector refid="enterprise"/>
jtulach@1240
   133
            <selector refid="deprecated7"/>
jtulach@1241
   134
            -->
jtulach@1245
   135
jtulach@1245
   136
jtulach@1245
   137
            <!-- non-important non-API things
jtulach@1245
   138
                which cannot be compiled easily
jtulach@1241
   139
            -->
jtulach@1241
   140
            <filename name="**/*-*"/>
jtulach@1241
   141
            <filename name="java/dyn/**"/>
jtulach@1241
   142
            <filename name="sun/dyn/**"/>
jtulach@1244
   143
            
jtulach@1242
   144
            <filename name="com/sun/script/javascript/**"/>
jtulach@1243
   145
            <filename name="sun/dc/**"/>
jtulach@1243
   146
            <filename name="sun/nio/fs/Solaris**"/>
jtulach@1241
   147
            <filename name="sun/tracing/**"/>
jtulach@1243
   148
            <filename name="com/sun/tracing/ProviderFactory*"/>
jtulach@1237
   149
        </none>
jtulach@1237
   150
    </selector>
jtulach@1237
   151
jtulach@1237
   152
    <!-- individual compilation tasks -->
jtulach@1237
   153
jtulach@1240
   154
    <target name="deprecated7">
jtulach@1240
   155
        <antcall target="-compile-one-module">
jtulach@1240
   156
            <param name="module" value="deprecated7"/>
jtulach@1240
   157
            <param name="depends" value="beans:applet"/>
jtulach@1240
   158
        </antcall>
jtulach@1240
   159
    </target>
jtulach@1237
   160
    <target name="applet">
jtulach@1237
   161
        <antcall target="-compile-one-module">
jtulach@1237
   162
            <param name="module" value="applet"/>
jtulach@1238
   163
            <param name="depends" value="beans"/>
jtulach@1237
   164
        </antcall>
jtulach@1237
   165
    </target>
jtulach@1237
   166
    <target name="beans">
jtulach@1237
   167
        <antcall target="-compile-one-module">
jtulach@1237
   168
            <param name="module" value="beans"/>
jtulach@1237
   169
        </antcall>
jtulach@1237
   170
    </target>
jtulach@1245
   171
    <target name="corba">
jtulach@1245
   172
        <antcall target="-compile-one-module">
jtulach@1245
   173
            <param name="module" value="corba"/>
jtulach@1245
   174
            <param name="depends" value="base"/>
jtulach@1245
   175
        </antcall>
jtulach@1245
   176
    </target>
jtulach@1237
   177
jtulach@1241
   178
jtulach@1238
   179
    <target name="base">
jtulach@1241
   180
        <antcall target="-compile-one-module">
jtulach@1241
   181
            <param name="module" value="base"/>
jtulach@1241
   182
        </antcall>
jtulach@1237
   183
    </target>
jtulach@1237
   184
jtulach@1237
   185
    <!-- shared routine to compile one of the modules -->
jtulach@1237
   186
    <target name="-compile-one-module">
jtulach@1237
   187
        <mkdir dir="${build.dir}/classes/${module}"/>
jtulach@1240
   188
        <pathconvert pathsep=":"  property="module.cp">
jtulach@1238
   189
            <path path="${depends}"/>
jtulach@1238
   190
            <mapper type="regexp" from=".*[/\\]([^/\\]*)" to="${build.dir}/\1.jar"/>
jtulach@1238
   191
        </pathconvert>
jtulach@1242
   192
        <jar
jtulach@1242
   193
            basedir="${build.dir}/classes/${module}"
jtulach@1242
   194
            destfile="${build.dir}/empty.jar"
jtulach@1242
   195
            compress="false"
jtulach@1242
   196
        >
jtulach@1242
   197
            <exclude name="**"/>
jtulach@1242
   198
        </jar>
jtulach@1238
   199
        <javac
jtulach@1242
   200
            bootclasspath="${build.dir}/empty.jar"
jtulach@1238
   201
            sourcepath=""
jtulach@1238
   202
            destdir="${build.dir}/classes/${module}"
jtulach@1238
   203
            includejavaruntime="false"
jtulach@1238
   204
            includeantruntime="false"
jtulach@1242
   205
            classpath="${module.cp}:${plugs}/jre/lib/rt-closed.jar"
jtulach@1238
   206
        >
jtulach@1237
   207
            <src refid="src.path"/>
jtulach@1245
   208
            <and>
jtulach@1245
   209
                <selector refid="${module}"/>
jtulach@1245
   210
                <not><filename name="**/*-template.java"/></not>
jtulach@1245
   211
            </and>
jtulach@1237
   212
        </javac>
jtulach@1238
   213
        <copy todir="${build.dir}/classes/${module}">
jtulach@1238
   214
            <fileset dir="src/share/classes">
jtulach@1238
   215
                <and>
jtulach@1238
   216
                    <selector refid="${module}"/>
jtulach@1238
   217
                    <not>
jtulach@1238
   218
                        <filename name="**/*.java"/>
jtulach@1238
   219
                    </not>
jtulach@1238
   220
                </and>
jtulach@1238
   221
            </fileset>
jtulach@1238
   222
        </copy>
jtulach@1238
   223
jtulach@1238
   224
        <jar 
jtulach@1238
   225
            basedir="${build.dir}/classes/${module}"
jtulach@1238
   226
            destfile="${build.dir}/${module}.jar"
jtulach@1238
   227
            compress="false"
jtulach@1238
   228
        />
jtulach@1237
   229
    </target>
jtulach@1237
   230
jtulach@1237
   231
    <!-- clean everything -->
jtulach@1237
   232
    <target name="clean">
jtulach@1237
   233
        <delete dir="${build.dir}"/>
jtulach@1237
   234
    </target>
jtulach@1237
   235
</project>