make/langtools/diags-examples.xml
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 40599 langtools/make/diags-examples.xml@be40838eb215
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39176
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     2
<!--
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     3
  ~ Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     4
  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     5
  ~
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     6
  ~ This code is free software; you can redistribute it and/or modify it
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     7
  ~ under the terms of the GNU General Public License version 2 only, as
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     8
  ~ published by the Free Software Foundation.  Oracle designates this
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
     9
  ~ particular file as subject to the "Classpath" exception as provided
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    10
  ~ by Oracle in the LICENSE file that accompanied this code.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    11
  ~
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    12
  ~ This code is distributed in the hope that it will be useful, but WITHOUT
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    13
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    14
  ~ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    15
  ~ version 2 for more details (a copy is included in the LICENSE file that
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    16
  ~ accompanied this code).
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    17
  ~
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    18
  ~ You should have received a copy of the GNU General Public License version
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    19
  ~ 2 along with this work; if not, write to the Free Software Foundation,
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    20
  ~ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    21
  ~
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    22
  ~ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    23
  ~ or visit www.oracle.com if you need additional information or have any
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    24
  ~ questions.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    25
  -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    26
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    27
<!--
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    28
This is an extension to the langtools make/build.xml file,
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    29
that provides targets to run the examples that generate
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    30
example diagnostics in different locales.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    31
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    32
Usage:
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    33
    ant -f langtools/make/run-examples.xml -Dlangtools.jdk.home=<JDK>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    34
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    35
By default, the reports will be generated in langtools/build/diags-examples/report/.
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    36
-->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    37
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    38
<project name="diags-examples" default="diags-examples" basedir="..">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    39
    <import file="build.xml"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    40
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    41
    <!-- specify working directory for the tool -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    42
    <property name="diags.examples.dir" location="${build.dir}/diag-examples"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    43
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    44
    <!-- compiled classes for the tool -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    45
    <property name="diags.examples.classes" location="${diags.examples.dir}/classes}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    46
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    47
    <!-- directory for generated reports -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    48
    <property name="diags.examples.report" location="${diags.examples.dir}/report"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    49
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    50
    <!-- default target, generates reports for all available locales -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    51
    <target name="diags-examples" depends="run-en_US,run-ja,run-zh_CN"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    52
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    53
    <!-- generate report for US English locale -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    54
    <target name="run-en_US" depends="-build-runner,-def-runner">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    55
        <mkdir dir="${diags.examples.report}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    56
        <runner lang="en" country="US" outfile="${diags.examples.report}/en_US.html"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    57
    </target>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    58
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    59
    <!-- generate report for Japanese locale -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    60
    <target name="run-ja" depends="-build-runner,-def-runner">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    61
        <mkdir dir="${diags.examples.report}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    62
        <runner lang="ja" outfile="${diags.examples.report}/ja.html"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    63
    </target>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    64
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    65
    <!-- generate report for Mandarin Chinese locale -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    66
    <target name="run-zh_CN" depends="-build-runner,-def-runner">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    67
        <mkdir dir="${diags.examples.report}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    68
        <runner lang="zh" country="CN" outfile="${diags.examples.report}/zh_CN.html"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    69
    </target>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    70
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    71
    <!-- compile the tool that runs the examples -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    72
    <target name="-build-runner" depends="build">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    73
        <mkdir dir="${diags.examples.classes}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    74
        <javac fork="true"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    75
            executable="${build.bin}/javac"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    76
            srcdir="test/tools/javac/diags"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    77
            destdir="${diags.examples.classes}"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    78
            includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    79
            sourcepath=""
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    80
            includeAntRuntime="no"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    81
            debug="${javac.debug}"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    82
            debuglevel="${javac.debuglevel}">
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    83
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    84
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    85
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    86
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    87
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
    88
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
39176
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    89
        </javac>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    90
    </target>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    91
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    92
    <!-- define a task to run the tool that runs the examples -->
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    93
    <target name="-def-runner">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    94
        <macrodef name="runner">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    95
            <attribute name="lang"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    96
            <attribute name="country" default=""/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    97
            <attribute name="outfile"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    98
            <sequential>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
    99
            <java fork="true"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   100
                  jvm="${langtools.jdk.home}/bin/java"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   101
                  dir="test/tools/javac/diags"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   102
                  classpath="${diags.examples.classes};${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   103
                  classname="RunExamples">
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   104
                <jvmarg value="-Duser.language=@{lang}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   105
                <jvmarg value="-Duser.country=@{country}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   106
                <jvmarg value="-Dtest.classes=${diags.examples.classes}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   107
                <arg value="-examples"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   108
                <arg value="examples"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   109
                <arg value="-o"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   110
                <arg file="@{outfile}"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   111
                <arg value="-showFiles"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   112
                <arg value="-title"/>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   113
                <arg value="Examples of javac diagnostics"/>
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   114
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   115
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   116
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   117
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   118
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 39176
diff changeset
   119
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
39176
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   120
            </java>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   121
            </sequential>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   122
        </macrodef>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   123
    </target>
eef1aa371e87 8159537: create build file to generate diags reports for all locales
jjg
parents:
diff changeset
   124
</project>