make/scripts/generate-symbol-data.sh
author darcy
Tue, 12 Nov 2019 10:45:23 -0800
changeset 59037 3d2575331a41
parent 53695 55d2d437c708
permissions -rw-r--r--
8233940: Preview API tests for String methods should use ${jdk.version} as -source arg Reviewed-by: jlaskey, jlahoda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53695
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     1
#!/bin/sh
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     2
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     3
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     5
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     8
# published by the Free Software Foundation.  Oracle designates this
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
     9
# particular file as subject to the "Classpath" exception as provided
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    10
# by Oracle in the LICENSE file that accompanied this code.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    11
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    12
# This code is distributed in the hope that it will be useful, but WITHOUT
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    14
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    15
# version 2 for more details (a copy is included in the LICENSE file that
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    16
# accompanied this code).
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    17
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    18
# You should have received a copy of the GNU General Public License version
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    19
# 2 along with this work; if not, write to the Free Software Foundation,
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    20
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    21
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    22
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    23
# or visit www.oracle.com if you need additional information or have any
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    24
# questions.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    25
#
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    26
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    27
# This script allows to easily generate (add or update) "--release N" data for JDK N + 1.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    28
# N must be 11 or greater. This script works on Linux. To create new data, or update existing
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    29
# data, it is necessary to:
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    30
# - download a binary build of OpenJDK N for Linux, API of which will be recorded. It is strongly recommended
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    31
#   to use an official build, not a custom build, to avoid any chance of including unofficial changes.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    32
#   The binary build should never be a build newer than the GA for JDK N. Install the build. The installation
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    33
#   directory will be denoted as "${JDK_N_INSTALL}" in the further text.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    34
# - have a checkout the JDK to which the data should be added (or in which the data should be updated).
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    35
#   The checkout directory will be denoted as "${JDK_CHECKOUT}" in the further text.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    36
#   The checkout must not have any local changes that could interfere with the new data. In particular,
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    37
#   there must be absolutely no changed, new or removed files under the ${JDK_CHECKOUT}/make/data/symbols
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    38
#   directory.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    39
# - open a terminal program and run these commands:
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    40
#     cd "${JDK_CHECKOUT}"/make/data/symbols
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    41
#     bash ../../scripts/generate-symbol-data.sh "${JDK_N_INSTALL}"
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    42
# - this command will generate or update data for "--release N" into the ${JDK_CHECKOUT}/make/data/symbols
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    43
#   directory, updating all registration necessary. If the goal was to update the data, and there are no
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    44
#   new or changed files in the ${JDK_CHECKOUT}/make/data/symbols directory after running this script,
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    45
#   there were no relevant changes and no further action is necessary. Note that version for N > 9 are encoded
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    46
#   using capital letters, i.e. A represents version 10, B represents 11, and so on. The version numbers are in
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    47
#   the names of the files in the ${JDK_CHECKOUT}/make/data/symbols directory, as well as in
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    48
#   the ${JDK_CHECKOUT}/make/data/symbols/symbols file.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    49
# - if there are any changed/new files in the ${JDK_CHECKOUT}/make/data/symbols directory after running this script,
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    50
#   then all the changes in this directory, including any new files, need to be sent for review and eventually pushed.
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    51
#   The commit message should specify which binary build was installed in the ${JDK_N_INSTALL} directory and also
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    52
#   include the SCM state that was used to build it, which can be found in ${JDK_N_INSTALL}/release,
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    53
#   in property "SOURCE".
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    54
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    55
if [ "$1x" = "x" ] ; then
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    56
    echo "Must provide the target JDK as a parameter:" >&2
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    57
    echo "$0 <target-jdk>" >&2
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    58
    exit 1
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    59
fi;
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    60
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    61
if [ ! -f symbols ] ; then
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    62
    echo "Must run inside the make/data/symbols directory" >&2
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    63
    exit 1
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    64
fi;
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    65
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    66
if [ "`hg status .`x" != "x" ] ; then
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    67
    echo "The make/data/symbols directory contains local changes!" >&2
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    68
    exit 1
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    69
fi;
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    70
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    71
$1/bin/java --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    72
            --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    73
            --add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    74
            --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    75
            --add-modules jdk.jdeps \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    76
            ../../../make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java \
55d2d437c708 8217335: Add a script to generate --release data
jlahoda
parents:
diff changeset
    77
            build-description-incremental symbols include.list