jdk

Форк
0
/
diags-examples.xml 
130 строк · 6.1 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
  ~ Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
4
  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
  ~
6
  ~ This code is free software; you can redistribute it and/or modify it
7
  ~ under the terms of the GNU General Public License version 2 only, as
8
  ~ published by the Free Software Foundation.  Oracle designates this
9
  ~ particular file as subject to the "Classpath" exception as provided
10
  ~ by Oracle in the LICENSE file that accompanied this code.
11
  ~
12
  ~ This code is distributed in the hope that it will be useful, but WITHOUT
13
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
  ~ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
  ~ version 2 for more details (a copy is included in the LICENSE file that
16
  ~ accompanied this code).
17
  ~
18
  ~ You should have received a copy of the GNU General Public License version
19
  ~ 2 along with this work; if not, write to the Free Software Foundation,
20
  ~ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
  ~
22
  ~ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23
  ~ or visit www.oracle.com if you need additional information or have any
24
  ~ questions.
25
  -->
26

27
<!--
28
This is an extension to the langtools make/build.xml file,
29
that provides targets to run the examples that generate
30
example diagnostics in different locales.
31

32
Usage:
33
    ant -f langtools/make/run-examples.xml -Dlangtools.jdk.home=<JDK>
34

35
By default, the reports will be generated in langtools/build/diags-examples/report/.
36
-->
37

38
<project name="diags-examples" default="diags-examples" basedir="../..">
39
    <import file="build.xml"/>
40

41
    <!-- specify working directory for the tool -->
42
    <property name="diags.examples.dir" location="${build.dir}/diag-examples"/>
43

44
    <!-- compiled classes for the tool -->
45
    <property name="diags.examples.classes" location="${diags.examples.dir}/classes"/>
46

47
    <!-- directory for generated reports -->
48
    <property name="diags.examples.report" location="${diags.examples.dir}/report"/>
49

50
    <!-- default target, generates reports for all available locales -->
51
    <target name="diags-examples" depends="run-en_US,run-ja,run-zh_CN,run-de"/>
52

53
    <!-- generate report for US English locale -->
54
    <target name="run-en_US" depends="-build-runner,-def-runner">
55
        <mkdir dir="${diags.examples.report}"/>
56
        <runner lang="en" country="US" outfile="${diags.examples.report}/en_US.html"/>
57
    </target>
58

59
    <!-- generate report for Japanese locale -->
60
    <target name="run-ja" depends="-build-runner,-def-runner">
61
        <mkdir dir="${diags.examples.report}"/>
62
        <runner lang="ja" outfile="${diags.examples.report}/ja.html"/>
63
    </target>
64

65
    <!-- generate report for Mandarin Chinese locale -->
66
    <target name="run-zh_CN" depends="-build-runner,-def-runner">
67
        <mkdir dir="${diags.examples.report}"/>
68
        <runner lang="zh" country="CN" outfile="${diags.examples.report}/zh_CN.html"/>
69
    </target>
70

71
    <!-- generate report for German locale -->
72
    <target name="run-de" depends="-build-runner,-def-runner">
73
        <mkdir dir="${diags.examples.report}"/>
74
        <runner lang="de" outfile="${diags.examples.report}/de.html"/>
75
    </target>
76

77
    <!-- compile the tool that runs the examples -->
78
    <target name="-build-runner" depends="build">
79
        <mkdir dir="${diags.examples.classes}"/>
80
        <javac fork="true"
81
            executable="${build.bin}/javac"
82
            srcdir="test/langtools/tools/javac/diags"
83
            destdir="${diags.examples.classes}"
84
            includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java"
85
            sourcepath=""
86
            includeAntRuntime="no"
87
            debug="${javac.debug}"
88
            debuglevel="${javac.debuglevel}">
89
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
90
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
91
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
92
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
93
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
94
            <compilerarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
95
        </javac>
96
    </target>
97

98
    <!-- define a task to run the tool that runs the examples -->
99
    <target name="-def-runner">
100
        <macrodef name="runner">
101
            <attribute name="lang"/>
102
            <attribute name="country" default=""/>
103
            <attribute name="outfile"/>
104
            <sequential>
105
            <java fork="true"
106
                  jvm="${langtools.jdk.home}/bin/java"
107
                  dir="test/langtools/tools/javac/diags"
108
                  classpath="${diags.examples.classes};${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
109
                  classname="RunExamples">
110
                <jvmarg value="-Duser.language=@{lang}"/>
111
                <jvmarg value="-Duser.country=@{country}"/>
112
                <jvmarg value="-Dtest.classes=${diags.examples.classes}"/>
113
                <arg value="-examples"/>
114
                <arg value="examples"/>
115
                <arg value="-o"/>
116
                <arg file="@{outfile}"/>
117
                <arg value="-showFiles"/>
118
                <arg value="-title"/>
119
                <arg value="Examples of javac diagnostics"/>
120
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
121
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
122
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
123
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
124
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
125
                <jvmarg line="--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
126
            </java>
127
            </sequential>
128
        </macrodef>
129
    </target>
130
</project>
131

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.