make/langtools/build.xml
author mcimadamore
Tue, 31 Jul 2018 16:49:51 +0100
changeset 51266 f8696e0ab9b7
parent 50072 54eda3aad6dd
child 51565 7e5f08c619e3
permissions -rw-r--r--
8208524: IntelliJ support broken since 2018.2 Summary: Move build.xml out of .idea folder Reviewed-by: stuefe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
<!--
48406
26b47ea4c77d 8193512: Remove remnants of javah from jdk/jdk repo
jjg
parents: 47217
diff changeset
     3
  ~ Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     4
  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     5
  ~
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     6
  ~ This code is free software; you can redistribute it and/or modify it
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     7
  ~ under the terms of the GNU General Public License version 2 only, as
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     8
  ~ published by the Free Software Foundation.  Oracle designates this
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
     9
  ~ particular file as subject to the "Classpath" exception as provided
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    10
  ~ by Oracle in the LICENSE file that accompanied this code.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    11
  ~
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    12
  ~ This code is distributed in the hope that it will be useful, but WITHOUT
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    13
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    14
  ~ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    15
  ~ version 2 for more details (a copy is included in the LICENSE file that
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    16
  ~ accompanied this code).
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    17
  ~
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    18
  ~ You should have received a copy of the GNU General Public License version
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    19
  ~ 2 along with this work; if not, write to the Free Software Foundation,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    20
  ~ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    21
  ~
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    22
  ~ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    23
  ~ or visit www.oracle.com if you need additional information or have any
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    24
  ~ questions.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    25
  -->
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
<!--
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
    28
 This is a convenience build file supporting development in the langtools
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
    29
 repository. It can be run either standalone, or from IDEs. This build script
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
    30
 is for a developer use only, it is not used to build the production version
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
    31
 of javac or other langtools tools.
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    32
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    33
 External dependencies are specified via properties. These can be given
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    34
 on the command line, or by providing a local build.properties file.
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    35
 (They can also be edited into make/build.properties, although that is not
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    36
 recommended.)  At a minimum, langtools.jdk.home must be set to the installed
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    37
 location of the version of JDK used to build this repository. Additional
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    38
 properties may be required, depending on the targets that are built.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    39
 For example, to run any of the jtreg tests you must set jtreg.home.
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    40
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    41
 The output of the build is as follows:
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    42
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    43
 build
48406
26b47ea4c77d 8193512: Remove remnants of javah from jdk/jdk repo
jjg
parents: 47217
diff changeset
    44
   |-bin (scripts to invoke various tools, javac etc.)
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    45
   |-genrsc (generated sources - i.e. properties)
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    46
   |-modules (compiled classes in a modular layout)
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    47
   |-jtreg (test work/results)
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    48
   |-toolclasses (tools used for building - like the property compiler)
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    49
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    50
 This file is organized into sections as follows:
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    51
 - global property definitions
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    52
 - primary top level targets (cleaning, building)
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    53
 - utility definitions
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 -->
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    56
<project name="langtools" default="build" basedir="../..">
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    57
    <!--
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    58
    **** Global property definitions.
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
    59
    -->
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
    60
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    <!-- The following locations can be used to override default property values. -->
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    <!-- Use this location for customizations specific to this instance of this workspace -->
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    64
    <property file="make/langtools/build.properties"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    <!-- Use this location for customizations common to all OpenJDK langtools workspaces -->
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    <property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    <!-- Use this location for customizations common to all OpenJDK workspaces -->
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    <property file="${user.home}/.openjdk/build.properties"/>
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
    71
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
    72
    <!-- Convenient shorthands for standard locations within the workspace. -->
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    73
    <property name="src.dir" location="src"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    74
    <property name="test.dir" location="test"/>
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    75
    <property name="make.dir" location="make/langtools"/>
11054
c4224d65eb3e 7110974: (javac) add coding conventions and style checkers for langtools
ksrini
parents: 10183
diff changeset
    76
    <property name="make.conf.dir" location="${make.dir}/conf"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    <property name="make.tools.dir" location="${make.dir}/tools"/>
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    78
    <property name="build.dir" location="build/langtools"/>
51266
f8696e0ab9b7 8208524: IntelliJ support broken since 2018.2
mcimadamore
parents: 50072
diff changeset
    79
    <property name="idea.support.dir" location="build/.idea-support"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    80
    <property name="build.modules" location="${build.dir}/modules"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    81
    <property name="build.gensrc" location="${build.dir}/gensrc"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    82
    <property name="build.tools" location="${build.dir}/toolclasses"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    83
    <property name="build.bin" location="${build.dir}/bin"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    84
    <property name="build.jtreg" location="${build.dir}/jtreg"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
    85
    <property name="build.prevsrc" location="${build.dir}/prevsrc"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    87
    <dirset id="src.module.dirset" dir="${src.dir}" includes="${module.names}"/>
37851
f2820cadfa38 8155959: Langtools ant build should support new Xpatch option format
mcimadamore
parents: 36526
diff changeset
    88
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    89
    <pathconvert pathsep="," property="src.module.dirs" refid="src.module.dirset"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    90
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    91
    <pathconvert property="xpatch.rest" pathsep=" --patch-module=" refid="src.module.dirset">
44461
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    92
        <scriptmapper language="javascript">
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    93
            fs = project.getProperty("file.separator");
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    94
            path = project.getProperty("build.modules");
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    95
            mod = source.substr(source.lastIndexOf(fs)+1);
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    96
            self.addMappedName(mod + "=\"" + path + fs + mod + "\"");
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
    97
        </scriptmapper>
38609
a1c0c73078b3 8157895: langtools launcher.sh-template script is broken
mcimadamore
parents: 38522
diff changeset
    98
    </pathconvert>
a1c0c73078b3 8157895: langtools launcher.sh-template script is broken
mcimadamore
parents: 38522
diff changeset
    99
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   100
    <pathconvert property="xpatch.noquotes.rest" pathsep=" --patch-module=" refid="src.module.dirset">
44461
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   101
        <scriptmapper language="javascript">
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   102
            fs = project.getProperty("file.separator");
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   103
            path = project.getProperty("build.modules");
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   104
            mod = source.substr(source.lastIndexOf(fs)+1);
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   105
            self.addMappedName(mod + "=" + path + fs + mod);
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   106
        </scriptmapper>
37851
f2820cadfa38 8155959: Langtools ant build should support new Xpatch option format
mcimadamore
parents: 36526
diff changeset
   107
    </pathconvert>
f2820cadfa38 8155959: Langtools ant build should support new Xpatch option format
mcimadamore
parents: 36526
diff changeset
   108
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40510
diff changeset
   109
    <property name="xpatch.cmd" value="--patch-module=${xpatch.rest}"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40510
diff changeset
   110
    <property name="xpatch.noquotes.cmd" value="--patch-module=${xpatch.noquotes.rest}"/>
25874
83c19f00452c 8054834: Modular Source Code
chegar
parents: 25848
diff changeset
   111
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    <!-- java.marker is set to a marker file to check for within a Java install dir.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
         The best file to check for across Solaris/Linux/Windows/MacOS is one of the
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
         executables; regrettably, that is OS-specific. -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    <condition property="java.marker" value="bin/java">
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
   116
        <os family="unix"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    <condition property="java.marker" value="bin/java.exe">
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
   119
        <os family="windows"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    </condition>
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
   121
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    <!-- Standard property values, if not overriden by earlier settings. -->
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
   123
    <property file="${make.dir}/build.properties"/>
3654
bb3c0eeec3cb 6870706: langtools launcher issues
jjg
parents: 3564
diff changeset
   124
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   125
    <condition property="langtools.jdk.home" value="${jdk.home}">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   126
        <isset property="jdk.home" />
3654
bb3c0eeec3cb 6870706: langtools launcher issues
jjg
parents: 3564
diff changeset
   127
    </condition>
bb3c0eeec3cb 6870706: langtools launcher issues
jjg
parents: 3564
diff changeset
   128
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   129
    <!-- launcher.java is used in the launcher scripts provided to run
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   130
        the tools' jar files.  If it has not already been set, then
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   131
        default it to use ${langtools.jdk.home}, if available, otherwise
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   132
        quietly default to simply use "java". -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   133
    <condition property="launcher.java"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   134
        value="${langtools.jdk.home}/bin/java" else="java">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   135
        <isset property="langtools.jdk.home"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   136
    </condition>
27546
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   137
79b6b60ff60a 8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents: 26268
diff changeset
   138
    <!--
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   139
        **** Check targets
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   140
    -->
3655
f9ee66e780f4 6758471: should be able to set jtreg options in langtools build
jjg
parents: 3654
diff changeset
   141
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    <target name="-def-check">
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   143
      <macrodef name="check">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   144
          <attribute name="name"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   145
          <attribute name="property"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   146
          <attribute name="marker" default=""/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
                <fail message="Cannot locate @{name}: please set @{property} to its location">
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
                    <condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
                        <not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
                            <isset property="@{property}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                        </not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
                    </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
                </fail>
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
                <fail message="@{name} is not installed in ${@{property}}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
                    <condition>
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   157
                        <and>
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   158
                            <not>
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   159
                                <equals arg1="@{marker}" arg2=""/>
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   160
                            </not>
5844
76650bf67a5c 6958391: add vizant support to langtools build
jjg
parents: 5520
diff changeset
   161
                            <not>
76650bf67a5c 6958391: add vizant support to langtools build
jjg
parents: 5520
diff changeset
   162
                                <available file="${@{property}}/@{marker}"/>
76650bf67a5c 6958391: add vizant support to langtools build
jjg
parents: 5520
diff changeset
   163
                            </not>
5845
6b8e5689445a 6958802: cleanup and doc langtools build.xml file
jjg
parents: 5844
diff changeset
   164
                        </and>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
                    </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
                </fail>
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   171
    <target name="-check-langtools.jdk.home" depends="-def-check">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   172
        <check name="target java" property="langtools.jdk.home" marker="${java.marker}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   173
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   174
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   175
    <target name="-check-jtreg.home" depends="-def-check">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   176
        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   177
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   178
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   179
    <!--
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   180
        **** Primary targets
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   181
    -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   182
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   183
    <target name="clean" description="Delete all generated files">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   184
        <delete dir="${build.dir}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   185
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   186
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   187
    <target name="build" depends="build-all-tools"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   188
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   189
    <target name="-prepare-build" depends="-check-langtools.jdk.home">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   190
        <mkdir dir="${build.modules}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   191
        <mkdir dir="${build.tools}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   192
        <mkdir dir="${build.gensrc}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   193
        <mkdir dir="${build.bin}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   194
        <mkdir dir="${build.prevsrc}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   195
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   196
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   197
    <target name="generate-sources-internal">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   198
        <basename property="module.name" file="${basedir}"/>
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   199
        <mkdir dir="${build.gensrc}/${module.name}"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   200
        <pparse destdir="${build.gensrc}/${module.name}" includes="${langtools.resource.includes}">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   201
            <src path="./share/classes"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   202
        </pparse>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   203
        <pcompile destdir="${build.gensrc}/${module.name}" includes="**/*.properties">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   204
            <src path="./share/classes"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   205
        </pcompile>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   206
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   207
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   208
    <target name="generate-sources"  depends="-prepare-build,-def-pparse,-def-pcompile">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   209
        <subant inheritall="true" target="generate-sources-internal" genericantfile="${make.dir}/build.xml">
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   210
              <dirset refid="src.module.dirset"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   211
        </subant>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   212
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   213
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   214
    <target name="build-all-classes" depends="generate-sources">
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   215
        <pathconvert property="xpatch.src.rest" pathsep=" --patch-module=" refid="src.module.dirset">
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   216
            <scriptmapper language="javascript">
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   217
                fs = project.getProperty("file.separator");
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   218
                path_src = project.getProperty("src.dir");
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   219
                path_sep = project.getProperty("path.separator");
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   220
                path_gensrc = project.getProperty("build.gensrc");
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   221
                mod = source.substr(source.lastIndexOf(fs)+1);
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   222
                self.addMappedName(mod + "=" + path_src + fs + mod + path_sep + path_gensrc + fs + mod);
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   223
            </scriptmapper>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   224
        </pathconvert>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   225
        <property name="xpatch.src.cmd" value="--patch-module=${xpatch.src.rest}"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   226
        <pathconvert pathsep="," property="gensrc.module.dirs">
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   227
            <dirset dir="${build.gensrc}" includes="${module.names}"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   228
        </pathconvert>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   229
        <multirootfileset id="source.fileset" basedirs="${src.module.dirs},${gensrc.module.dirs}">
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   230
            <include name="**/*.java"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   231
            <different targetdir="${build.prevsrc}" ignoreFileTimes="true"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   232
        </multirootfileset>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   233
        <pathconvert pathsep=" " property="source.files" refid="source.fileset"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   234
        <echo file="${build.dir}/sources.txt">${source.files}</echo>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   235
        <exec executable="${langtools.jdk.home}/bin/javac" failonerror="true">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   236
            <arg value="-d" />
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   237
            <arg value="${build.modules}" />
41936
94139f291be4 8166857: langtools build.xml broken on windows
ksrini
parents: 41519
diff changeset
   238
            <arg line="${javac.opts}" />
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   239
            <arg line="${xpatch.src.cmd}" />
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   240
            <arg line="--module-source-path ." />
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   241
            <arg line="@${build.dir}/sources.txt" />
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   242
        </exec>
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   243
        <delete file="${build.dir}/sources.txt"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   244
        <delete>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   245
            <fileset dir="${build.modules}" includes="**/module-info.class"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   246
        </delete>
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   247
        <!-- workaround for incremental compilation -->
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   248
        <copy todir="${build.prevsrc}" >
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   249
            <multirootfileset refid="source.fileset"/>
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   250
        </copy>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   251
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   252
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   253
    <target name="build-all-tools" depends="build-all-classes, -def-build-tool">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   254
        <build-tool name="javac"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   255
        <build-tool name="javadoc"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   256
        <build-tool name="javap"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   257
        <build-tool name="jdeps"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   258
        <build-tool name="sjavac"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   259
        <build-tool name="jshell"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   260
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   261
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   262
    <target name="jtreg" depends="build-all-tools,-def-jtreg">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   263
        <jtreg-tool name="all" tests="${jtreg.tests}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   264
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   265
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   266
    <!--
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   267
    **** IDE support
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   268
    -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   269
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   270
    <target name="idea" depends="-check-langtools.jdk.home">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   271
        <mkdir dir=".idea"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   272
        <copy todir=".idea" >
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   273
            <fileset dir="${make.dir}/intellij">
39177
9d13e7c2d65e 8159834: Add some support for jtreg test headers in IntelliJ langtools project
mcimadamore
parents: 38609
diff changeset
   274
               <exclude name="**/src/**"/>
9d13e7c2d65e 8159834: Add some support for jtreg test headers in IntelliJ langtools project
mcimadamore
parents: 38609
diff changeset
   275
               <exclude name="**/utils/**"/>
9d13e7c2d65e 8159834: Add some support for jtreg test headers in IntelliJ langtools project
mcimadamore
parents: 38609
diff changeset
   276
            </fileset>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   277
        </copy>
51266
f8696e0ab9b7 8208524: IntelliJ support broken since 2018.2
mcimadamore
parents: 50072
diff changeset
   278
        <!-- move build.xml out of .idea, see IDEA-189915 -->
f8696e0ab9b7 8208524: IntelliJ support broken since 2018.2
mcimadamore
parents: 50072
diff changeset
   279
        <mkdir dir="${idea.support.dir}"/>
f8696e0ab9b7 8208524: IntelliJ support broken since 2018.2
mcimadamore
parents: 50072
diff changeset
   280
        <move todir="${idea.support.dir}" file=".idea/build.xml"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   281
        <condition property="idea.jtreg.home" value="${jtreg.home}" else = "[jtreg.home]">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   282
            <isset property="jtreg.home"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   283
        </condition>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   284
        <condition property="idea.target.jdk" value="${langtools.jdk.home}" else = "$JDKPath$">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   285
            <isset property="langtools.jdk.home"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   286
        </condition>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   287
        <replace file=".idea/ant.xml" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
38522
c4fdb181cd64 8157326: Intellij langtools project should use shared run configurations
mcimadamore
parents: 38507
diff changeset
   288
        <replace dir=".idea/runConfigurations" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
c4fdb181cd64 8157326: Intellij langtools project should use shared run configurations
mcimadamore
parents: 38507
diff changeset
   289
        <replace dir=".idea/runConfigurations" token="@XPATCH@" value="${xpatch.cmd}"/>
40510
722c82994682 8164481: Remove jtreg run configurations from langtools idea project
mcimadamore
parents: 39177
diff changeset
   290
        <replace file=".idea/misc.xml" token="@IDEA_JTREG_HOME@" value="${idea.jtreg.home}"/>
722c82994682 8164481: Remove jtreg run configurations from langtools idea project
mcimadamore
parents: 39177
diff changeset
   291
        <replace file=".idea/misc.xml" token="@IDEA_TARGET_JDK@" value="${idea.target.jdk}"/>
722c82994682 8164481: Remove jtreg run configurations from langtools idea project
mcimadamore
parents: 39177
diff changeset
   292
        <replace file=".idea/misc.xml" token="@XPATCH@" value="${xpatch.cmd}"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   293
        <mkdir dir=".idea/classes"/>
38507
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   294
        <javac source="${javac.build.source}"
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   295
               target="${javac.build.target}"
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   296
               srcdir="${make.dir}/intellij/src"
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   297
               destdir=".idea/classes"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   298
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   299
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   300
    <!--
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   301
        **** Utility definitions
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   302
    -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   303
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   304
    <target name="-def-pparse">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   305
        <copy todir="${build.tools}/propertiesparser" >
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   306
            <fileset dir="${make.tools.dir}/propertiesparser" includes="**/resources/**"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   307
        </copy>
38507
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   308
        <javac source="${javac.build.source}"
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   309
               target="${javac.build.target}"
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   310
               srcdir="${make.tools.dir}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   311
               includes="propertiesparser/* anttasks/PropertiesParser* anttasks/PathFileSet*"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   312
               destdir="${build.tools}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   313
               classpath="${ant.core.lib}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   314
               bootclasspath="${langtools.jdk.home}/jre/lib/rt.jar"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   315
               includeantruntime="false">
41519
612f31a9b42b 8167442: Langtools ant build not working after addition of -Xlint:exports
jlahoda
parents: 40599
diff changeset
   316
            <compilerarg line="${javac.build.opts} -XDstringConcat=inline"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   317
        </javac>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   318
        <taskdef name="pparse"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   319
                 classname="anttasks.PropertiesParserTask"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   320
                 classpath="${build.tools}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   321
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   322
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   323
     <target name="-def-pcompile">
38507
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   324
        <javac
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   325
               source="${javac.build.source}"
d48ba9db4b7d 8157030: langtools dev build broken after classfile version bump
mcimadamore
parents: 37851
diff changeset
   326
               target="${javac.build.target}"
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   327
               srcdir="${make.tools.dir}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   328
               includes="compileproperties/* anttasks/CompileProperties* anttasks/PathFileSet*"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   329
               destdir="${build.dir}/toolclasses/"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   330
               classpath="${ant.core.lib}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   331
               includeantruntime="false">
41519
612f31a9b42b 8167442: Langtools ant build not working after addition of -Xlint:exports
jlahoda
parents: 40599
diff changeset
   332
            <compilerarg line="${javac.build.opts} -XDstringConcat=inline"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   333
        </javac>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   334
        <taskdef name="pcompile"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   335
                 classname="anttasks.CompilePropertiesTask"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   336
                 classpath="${build.tools}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   337
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   338
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   339
    <target name="-def-build-tool">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   340
        <macrodef name="build-tool">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   341
            <attribute name="name"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   342
            <attribute name="compilation.kind" default=""/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   343
            <attribute name="bin.dir" default="${build.bin}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   344
            <attribute name="java" default="${launcher.java}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   345
            <attribute name="main.class" default="${tool.@{name}.main.class}"/>
37851
f2820cadfa38 8155959: Langtools ant build should support new Xpatch option format
mcimadamore
parents: 36526
diff changeset
   346
            <attribute name="xpatch" default="${xpatch.cmd}"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   347
            <sequential>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   348
                <mkdir dir="@{bin.dir}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   349
                <copy file="${make.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   350
                    <filterset begintoken="#" endtoken="#">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   351
                        <filter token="PROGRAM" value="@{main.class}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   352
                        <filter token="TARGET_JAVA" value="@{java}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   353
                        <filter token="PS" value="${path.separator}"/>
37851
f2820cadfa38 8155959: Langtools ant build should support new Xpatch option format
mcimadamore
parents: 36526
diff changeset
   354
                        <filter token="XPATCH" value="${xpatch.cmd}"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   355
                    </filterset>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   356
                </copy>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   357
                <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   358
            </sequential>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   359
        </macrodef>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   360
    </target>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   361
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   362
    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-langtools.jdk.home">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   363
        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   364
            <classpath>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   365
                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   366
                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   367
            </classpath>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   368
        </taskdef>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   369
        <macrodef name="jtreg-tool">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   370
            <attribute name="name"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   371
            <attribute name="tests"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   372
            <attribute name="jdk" default="${langtools.jdk.home}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   373
            <attribute name="agentvm" default="true"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   374
            <attribute name="verbose" default="${default.jtreg.verbose}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   375
            <attribute name="options" default="${other.jtreg.options}"/>
44461
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   376
            <attribute name="ignore" default="-keywords:!ignore -exclude:${test.dir}/ProblemList.txt"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   377
            <attribute name="jpda.jvmargs" default=""/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   378
            <attribute name="extra.jvmargs" default=""/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   379
            <attribute name="build.modules" default="${build.modules}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   380
            <sequential>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   381
                <property name="coverage.options" value=""/>              <!-- default -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   382
                <property name="coverage.classpath" value=""/>            <!-- default -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   383
                <property name="default.jtreg.verbose" value="summary"/>  <!-- default -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   384
                <property name="other.jtreg.options" value=""/>           <!-- default -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   385
                <property name="jtreg.classfiles.to.modules" value="@{agentvm}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   386
                <jtreg
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   387
                    dir="${test.dir}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   388
                    workDir="${build.jtreg}/@{name}/work"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   389
                    reportDir="${build.jtreg}/@{name}/report"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   390
                    jdk="@{jdk}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   391
                    agentvm="@{agentvm}" verbose="@{verbose}"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   392
                    failonerror="false" resultproperty="jtreg.@{name}.result"
38609
a1c0c73078b3 8157895: langtools launcher.sh-template script is broken
mcimadamore
parents: 38522
diff changeset
   393
                    vmoptions="${coverage.options} @{extra.jvmargs} ${xpatch.noquotes.cmd}">
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   394
                    <arg value="-debug:@{jpda.jvmargs}"/>
44461
8e5061e5b34b 8177667: Langtools ant build has issues with Windows file separators
mcimadamore
parents: 41936
diff changeset
   395
                    <arg line="@{ignore}"/>
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   396
                    <arg line="@{options}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   397
                    <arg line="@{tests}"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   398
                </jtreg>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   399
                <!-- the next two properties are for convenience, when only
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   400
                     a single instance of jtreg will be invoked. -->
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   401
                <condition property="jtreg.passed">
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   402
                    <equals arg1="${jtreg.@{name}.result}" arg2="0"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   403
                </condition>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   404
                <property name="jtreg.report" value="${build.jtreg}/@{name}/report"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   405
            </sequential>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   406
        </macrodef>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   407
        <property name="jtreg.defined" value="true"/>
3b41f1c69604 8142968: Module System implementation
alanb
parents: 33368
diff changeset
   408
    </target>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
</project>