Initial load
This commit is contained in:
parent
686d76f772
commit
f57b87e8f6
3
langtools/.hgignore
Normal file
3
langtools/.hgignore
Normal file
@ -0,0 +1,3 @@
|
||||
^build/
|
||||
^dist/
|
||||
^nbproject/private/
|
27
langtools/ASSEMBLY_EXCEPTION
Normal file
27
langtools/ASSEMBLY_EXCEPTION
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
OPENJDK ASSEMBLY EXCEPTION
|
||||
|
||||
The OpenJDK source code made available by Sun at openjdk.java.net and
|
||||
openjdk.dev.java.net ("OpenJDK Code") is distributed under the terms of the
|
||||
GNU General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
|
||||
only ("GPL2"), with the following clarification and special exception.
|
||||
|
||||
Linking this OpenJDK Code statically or dynamically with other code
|
||||
is making a combined work based on this library. Thus, the terms
|
||||
and conditions of GPL2 cover the whole combination.
|
||||
|
||||
As a special exception, Sun gives you permission to link this
|
||||
OpenJDK Code with certain code licensed by Sun as indicated at
|
||||
http://openjdk.java.net/legal/exception-modules-2007-05-08.html
|
||||
("Designated Exception Modules") to produce an executable,
|
||||
regardless of the license terms of the Designated Exception Modules,
|
||||
and to copy and distribute the resulting executable under GPL2,
|
||||
provided that the Designated Exception Modules continue to be
|
||||
governed by the licenses under which they were offered by Sun.
|
||||
|
||||
As such, it allows licensees and sublicensees of Sun's GPL2 OpenJDK Code to
|
||||
build an executable that includes those portions of necessary code that Sun
|
||||
could not provide under GPL2 (or that Sun has provided under GPL2 with the
|
||||
Classpath exception). If you modify or add to the OpenJDK code, that new
|
||||
GPL2 code may still be combined with Designated Exception Modules if the
|
||||
new code is made subject to this exception by its copyright holder.
|
347
langtools/LICENSE
Normal file
347
langtools/LICENSE
Normal file
@ -0,0 +1,347 @@
|
||||
The GNU General Public License (GPL)
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share
|
||||
and change it. By contrast, the GNU General Public License is intended to
|
||||
guarantee your freedom to share and change free software--to make sure the
|
||||
software is free for all its users. This General Public License applies to
|
||||
most of the Free Software Foundation's software and to any other program whose
|
||||
authors commit to using it. (Some other Free Software Foundation software is
|
||||
covered by the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom to
|
||||
distribute copies of free software (and charge for this service if you wish),
|
||||
that you receive source code or can get it if you want it, that you can change
|
||||
the software or use pieces of it in new free programs; and that you know you
|
||||
can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny
|
||||
you these rights or to ask you to surrender the rights. These restrictions
|
||||
translate to certain responsibilities for you if you distribute copies of the
|
||||
software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for
|
||||
a fee, you must give the recipients all the rights that you have. You must
|
||||
make sure that they, too, receive or can get the source code. And you must
|
||||
show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If the
|
||||
software is modified by someone else and passed on, we want its recipients to
|
||||
know that what they have is not the original, so that any problems introduced
|
||||
by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will
|
||||
individually obtain patent licenses, in effect making the program proprietary.
|
||||
To prevent this, we have made it clear that any patent must be licensed for
|
||||
everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice
|
||||
placed by the copyright holder saying it may be distributed under the terms of
|
||||
this General Public License. The "Program", below, refers to any such program
|
||||
or work, and a "work based on the Program" means either the Program or any
|
||||
derivative work under copyright law: that is to say, a work containing the
|
||||
Program or a portion of it, either verbatim or with modifications and/or
|
||||
translated into another language. (Hereinafter, translation is included
|
||||
without limitation in the term "modification".) Each licensee is addressed as
|
||||
"you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by
|
||||
this License; they are outside its scope. The act of running the Program is
|
||||
not restricted, and the output from the Program is covered only if its contents
|
||||
constitute a work based on the Program (independent of having been made by
|
||||
running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as
|
||||
you receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this License
|
||||
and to the absence of any warranty; and give any other recipients of the
|
||||
Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may
|
||||
at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus
|
||||
forming a work based on the Program, and copy and distribute such modifications
|
||||
or work under the terms of Section 1 above, provided that you also meet all of
|
||||
these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating
|
||||
that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or
|
||||
in part contains or is derived from the Program or any part thereof, to be
|
||||
licensed as a whole at no charge to all third parties under the terms of
|
||||
this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run,
|
||||
you must cause it, when started running for such interactive use in the
|
||||
most ordinary way, to print or display an announcement including an
|
||||
appropriate copyright notice and a notice that there is no warranty (or
|
||||
else, saying that you provide a warranty) and that users may redistribute
|
||||
the program under these conditions, and telling the user how to view a copy
|
||||
of this License. (Exception: if the Program itself is interactive but does
|
||||
not normally print such an announcement, your work based on the Program is
|
||||
not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License, and
|
||||
its terms, do not apply to those sections when you distribute them as separate
|
||||
works. But when you distribute the same sections as part of a whole which is a
|
||||
work based on the Program, the distribution of the whole must be on the terms
|
||||
of this License, whose permissions for other licensees extend to the entire
|
||||
whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise the
|
||||
right to control the distribution of derivative or collective works based on
|
||||
the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the
|
||||
Program (or with a work based on the Program) on a volume of a storage or
|
||||
distribution medium does not bring the other work under the scope of this
|
||||
License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under
|
||||
Section 2) in object code or executable form under the terms of Sections 1 and
|
||||
2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source
|
||||
code, which must be distributed under the terms of Sections 1 and 2 above
|
||||
on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to
|
||||
give any third party, for a charge no more than your cost of physically
|
||||
performing source distribution, a complete machine-readable copy of the
|
||||
corresponding source code, to be distributed under the terms of Sections 1
|
||||
and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to
|
||||
distribute corresponding source code. (This alternative is allowed only
|
||||
for noncommercial distribution and only if you received the program in
|
||||
object code or executable form with such an offer, in accord with
|
||||
Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and installation
|
||||
of the executable. However, as a special exception, the source code
|
||||
distributed need not include anything that is normally distributed (in either
|
||||
source or binary form) with the major components (compiler, kernel, and so on)
|
||||
of the operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the source
|
||||
code from the same place counts as distribution of the source code, even though
|
||||
third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as
|
||||
expressly provided under this License. Any attempt otherwise to copy, modify,
|
||||
sublicense or distribute the Program is void, and will automatically terminate
|
||||
your rights under this License. However, parties who have received copies, or
|
||||
rights, from you under this License will not have their licenses terminated so
|
||||
long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it.
|
||||
However, nothing else grants you permission to modify or distribute the Program
|
||||
or its derivative works. These actions are prohibited by law if you do not
|
||||
accept this License. Therefore, by modifying or distributing the Program (or
|
||||
any work based on the Program), you indicate your acceptance of this License to
|
||||
do so, and all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program),
|
||||
the recipient automatically receives a license from the original licensor to
|
||||
copy, distribute or modify the Program subject to these terms and conditions.
|
||||
You may not impose any further restrictions on the recipients' exercise of the
|
||||
rights granted herein. You are not responsible for enforcing compliance by
|
||||
third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues), conditions
|
||||
are imposed on you (whether by court order, agreement or otherwise) that
|
||||
contradict the conditions of this License, they do not excuse you from the
|
||||
conditions of this License. If you cannot distribute so as to satisfy
|
||||
simultaneously your obligations under this License and any other pertinent
|
||||
obligations, then as a consequence you may not distribute the Program at all.
|
||||
For example, if a patent license would not permit royalty-free redistribution
|
||||
of the Program by all those who receive copies directly or indirectly through
|
||||
you, then the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or
|
||||
other property right claims or to contest validity of any such claims; this
|
||||
section has the sole purpose of protecting the integrity of the free software
|
||||
distribution system, which is implemented by public license practices. Many
|
||||
people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose that
|
||||
choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Program under this License may add an explicit
|
||||
geographical distribution limitation excluding those countries, so that
|
||||
distribution is permitted only in or among countries not thus excluded. In
|
||||
such case, this License incorporates the limitation as if written in the body
|
||||
of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the
|
||||
General Public License from time to time. Such new versions will be similar in
|
||||
spirit to the present version, but may differ in detail to address new problems
|
||||
or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any later
|
||||
version", you have the option of following the terms and conditions either of
|
||||
that version or of any later version published by the Free Software Foundation.
|
||||
If the Program does not specify a version number of this License, you may
|
||||
choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs
|
||||
whose distribution conditions are different, write to the author to ask for
|
||||
permission. For software which is copyrighted by the Free Software Foundation,
|
||||
write to the Free Software Foundation; we sometimes make exceptions for this.
|
||||
Our decision will be guided by the two goals of preserving the free status of
|
||||
all derivatives of our free software and of promoting the sharing and reuse of
|
||||
software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
|
||||
PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
|
||||
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
|
||||
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
|
||||
BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
|
||||
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible
|
||||
use to the public, the best way to achieve this is to make it free software
|
||||
which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach
|
||||
them to the start of each source file to most effectively convey the exclusion
|
||||
of warranty; and each file should have at least the "copyright" line and a
|
||||
pointer to where the full notice is found.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it
|
||||
starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
|
||||
with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
|
||||
software, and you are welcome to redistribute it under certain conditions;
|
||||
type 'show c' for details.
|
||||
|
||||
The hypothetical commands 'show w' and 'show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may be
|
||||
called something other than 'show w' and 'show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
|
||||
is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
'Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989
|
||||
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General Public
|
||||
License instead of this License.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL
|
||||
|
||||
Certain source files distributed by Sun Microsystems, Inc. are subject to
|
||||
the following clarification and special exception to the GPL, but only where
|
||||
Sun has expressly included in the particular source file's header the words
|
||||
"Sun designates this particular file as subject to the "Classpath" exception
|
||||
as provided by Sun in the LICENSE file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making
|
||||
a combined work based on this library. Thus, the terms and conditions of
|
||||
the GNU General Public License cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,
|
||||
and to copy and distribute the resulting executable under terms of your
|
||||
choice, provided that you also meet, for each linked independent module,
|
||||
the terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library. If
|
||||
you modify this library, you may extend this exception to your version of
|
||||
the library, but you are not obligated to do so. If you do not wish to do
|
||||
so, delete this exception statement from your version.
|
43
langtools/README
Normal file
43
langtools/README
Normal file
@ -0,0 +1,43 @@
|
||||
Building the "langtools" workspace.
|
||||
|
||||
The "langtools" workspace can be built from the command line with Ant.
|
||||
The build file is make/build.xml, in conjunction with make/build.properties.
|
||||
Some additional user-specific properties files are also read, to allow
|
||||
you to customize selected properties as needed.
|
||||
|
||||
Individual tools within the workspace can also be built and worked on
|
||||
with NetBeans, using the projects in the make/netbeans directory.
|
||||
|
||||
The "langtools" workspace can also be built from the command line with
|
||||
GNU Make, although the Makefile is simply a wrapper around the Ant
|
||||
build file. This is provided for systems (such as the full OpenJDK build)
|
||||
that expect to be able to build this workspace with GNU Make.
|
||||
|
||||
System Requirements:
|
||||
Ant: version 1.6.5 or later
|
||||
NetBeans: version 5.0 or later (optional)
|
||||
JDK: currently version 1.5.0, although 1.6.0 is recommended
|
||||
OS: any system supporting the above tools
|
||||
|
||||
For more information:
|
||||
Ant: http://ant.apache.org/
|
||||
GNU Make: http://www.gnu.org/software/make/
|
||||
NetBeans: http://www.netbeans.org/
|
||||
|
||||
|
||||
Testing the "langtools" workspace.
|
||||
|
||||
The primary set of tests for the compiler is the compiler TCK. This
|
||||
tests that the compiler performs according to the specifications in
|
||||
JLS and JVMS.
|
||||
|
||||
In addition, there is a substantial collection of regression and unit
|
||||
tests for all the tools in the maain langtools test/ directory.
|
||||
|
||||
Finally, there is a small set of tests to do basic validation of a build
|
||||
of the langtools workspace for use by JDK. These tests check the contents
|
||||
of the dist/ directory generated by the build, and verify that the various
|
||||
tools can do basic "Hello World"-style processing. These tests should be
|
||||
run by jtreg, with the -jdk option set a version of JDK capable of running
|
||||
the default output of the javac compiler in this workspace. Currently,
|
||||
this means JDK 6 or better.
|
1616
langtools/THIRD_PARTY_README
Normal file
1616
langtools/THIRD_PARTY_README
Normal file
File diff suppressed because it is too large
Load Diff
180
langtools/make/Makefile
Normal file
180
langtools/make/Makefile
Normal file
@ -0,0 +1,180 @@
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# Makefile for langtools: wrapper around Ant build.xml file
|
||||
|
||||
#
|
||||
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
|
||||
# This little rule is only understood by Sun's make, and is harmless
|
||||
# when seen by the GNU make tool. If using Sun's make, this causes the
|
||||
# make command to fail.
|
||||
#
|
||||
SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
|
||||
|
||||
#
|
||||
# Minimal platform defs
|
||||
# Need FullPath because we can't rely on gnumake abspath, until we use v3.81
|
||||
#
|
||||
|
||||
SYSTEM_UNAME := $(shell uname)
|
||||
|
||||
ifeq ($(SYSTEM_UNAME), Windows_NT)
|
||||
DEV_NULL = NUL
|
||||
else
|
||||
ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
|
||||
DEV_NULL = NUL
|
||||
USING_CYGWIN = true
|
||||
else
|
||||
DEV_NULL = /dev/null
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USING_CYGWIN
|
||||
define FullPath
|
||||
$(shell cygpath -a -s -m $1 2> $(DEV_NULL))
|
||||
endef
|
||||
else
|
||||
define FullPath
|
||||
$(shell cd $1 2> $(DEV_NULL) && pwd)
|
||||
endef
|
||||
endif
|
||||
|
||||
#
|
||||
# Makefile args
|
||||
#
|
||||
|
||||
ifdef QUIET
|
||||
ANT_OPTIONS += -quiet
|
||||
endif
|
||||
|
||||
ifdef VERBOSE
|
||||
ANT_OPTIONS += -verbose -diagnostics
|
||||
endif
|
||||
|
||||
ifdef JDK_VERSION
|
||||
ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
|
||||
endif
|
||||
|
||||
ifdef FULL_VERSION
|
||||
ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
|
||||
endif
|
||||
|
||||
ifdef MILESTONE
|
||||
ANT_OPTIONS += -Dmilestone=$(MILESTONE)
|
||||
endif
|
||||
|
||||
ifdef BUILD_NUMBER
|
||||
ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
|
||||
else
|
||||
ifdef JDK_BUILD_NUMBER
|
||||
ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(VARIANT), DBG)
|
||||
ANT_OPTIONS += -Djavac.debug=true
|
||||
else
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ANT_OPTIONS += -Djavac.debug=false
|
||||
endif
|
||||
endif
|
||||
|
||||
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
|
||||
# and the somewhat misnamed CLASS_VERSION (-target NN)
|
||||
ifdef TARGET_CLASS_VERSION
|
||||
ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
|
||||
else
|
||||
ifdef JAVAC_TARGET_ARG
|
||||
ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ALT_BOOTDIR
|
||||
ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
|
||||
ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
|
||||
endif
|
||||
|
||||
ifdef ALT_OUTPUTDIR
|
||||
OUTPUTDIR = $(ALT_OUTPUTDIR)
|
||||
ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
|
||||
ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
|
||||
else
|
||||
OUTPUTDIR = ..
|
||||
endif
|
||||
#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
|
||||
ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
|
||||
|
||||
ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
|
||||
ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
|
||||
|
||||
ifdef FINDBUGS_HOME
|
||||
ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
|
||||
endif
|
||||
|
||||
ifdef ANT_HOME
|
||||
ANT = $(ANT_HOME)/bin/ant
|
||||
ifneq ($(shell test -x $(ANT) && echo OK), OK)
|
||||
$(error $(ANT) not found -- please update ANT_HOME)
|
||||
endif
|
||||
else
|
||||
ANT = ant
|
||||
ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
|
||||
$(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Default target and expected 'do everything' target
|
||||
all: build
|
||||
|
||||
# Standard make clobber target
|
||||
clobber: clean
|
||||
|
||||
# All ant targets of interest
|
||||
ANT_TARGETS = build clean sanity post-sanity diagnostics # for now
|
||||
|
||||
# Create a make target for each
|
||||
$(ANT_TARGETS):
|
||||
@ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
|
||||
$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log
|
||||
$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
#
|
||||
# Targets for Sun's internal JPRT build system
|
||||
|
||||
CD = cd
|
||||
ZIP = zip
|
||||
|
||||
JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
|
||||
|
||||
jprt_build_product jprt_build_debug jprt_build_fastdebug: all
|
||||
( $(CD) $(OUTPUTDIR) && \
|
||||
$(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# Declare these phony (not filenames)
|
||||
.PHONY: $(ANT_TARGETS) all clobber \
|
||||
jprt_build_product jprt_build_debug jprt_build_fastdebug
|
419
langtools/make/Makefile-classic
Normal file
419
langtools/make/Makefile-classic
Normal file
@ -0,0 +1,419 @@
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for building the langtools workspace.
|
||||
#
|
||||
|
||||
#
|
||||
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
|
||||
# This little rule is only understood by Sun's make, and is harmless
|
||||
# when seen by the GNU make tool. If using Sun's make, this causes the
|
||||
# make command to fail.
|
||||
#
|
||||
SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
|
||||
|
||||
#----- cancel implicit rules
|
||||
|
||||
%: %.o
|
||||
%: %.obj
|
||||
%: %.dll
|
||||
%: %.c
|
||||
%: %.cc
|
||||
%: %.C
|
||||
%: %.p
|
||||
%: %.f
|
||||
%: %.s
|
||||
%: %.F
|
||||
%: %.r
|
||||
%: %.S
|
||||
%: %.mod
|
||||
%: %.sh
|
||||
%: %,v
|
||||
%: RCS/%,v
|
||||
|
||||
#----- imports
|
||||
|
||||
ifdef ALT_BOOT_JAVA_HOME
|
||||
BOOT_JAVA_HOME = $(ALT_BOOT_JAVA_HOME)
|
||||
else
|
||||
ifdef ALT_BOOTDIR
|
||||
BOOT_JAVA_HOME = $(ALT_BOOTDIR)
|
||||
else
|
||||
BOOT_JAVA_HOME=/java/re/jdk/1.5.0/archive/fcs/binaries/solaris-sparc
|
||||
endif
|
||||
endif
|
||||
|
||||
BOOT_JAVA=$(BOOT_JAVA_HOME)/bin/java
|
||||
BOOT_JAVAC=$(BOOT_JAVA_HOME)/bin/javac
|
||||
BOOTJAR=$(BOOT_JAVA_HOME)/bin/jar
|
||||
|
||||
ifdef ALT_TESTJAVA_HOME
|
||||
TESTJAVA_HOME = $(ALT_TESTJAVA_HOME)
|
||||
else
|
||||
TESTJAVA_HOME=/java/re/jdk/1.6.0/archive/fcs/binaries/solaris-sparc
|
||||
endif
|
||||
|
||||
TESTJAVA=$(TESTJAVA_HOME)/bin/java
|
||||
|
||||
ifdef ALT_FINDBUGS_HOME
|
||||
FINDBUGS_HOME = $(ALT_FINDBUGS_HOME)
|
||||
else
|
||||
FINDBUGS_HOME = /java/devtools/share/findbugs/1.1.2-rc4
|
||||
endif
|
||||
|
||||
FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
|
||||
|
||||
#----- commands
|
||||
|
||||
CHMOD = chmod
|
||||
CP = cp
|
||||
ECHO = echo # FIXME
|
||||
FIND = find
|
||||
MKDIR = mkdir
|
||||
SED = sed
|
||||
ZIP = zip
|
||||
|
||||
#----- locations and deliverables
|
||||
|
||||
TOPDIR = ..
|
||||
SRC_BIN_DIR = $(TOPDIR)/src/share/bin
|
||||
SRC_CLASSES_DIR = $(TOPDIR)/src/share/classes
|
||||
|
||||
BUILD_DIR = $(TOPDIR)/build
|
||||
|
||||
CLASSES_DIR = $(BUILD_DIR)/classes
|
||||
GENSRC_DIR = $(BUILD_DIR)/gensrc
|
||||
|
||||
DIST_DIR = $(TOPDIR)/dist
|
||||
BIN_DIR = $(DIST_DIR)/bin
|
||||
LIB_DIR = $(DIST_DIR)/lib
|
||||
|
||||
JAVAC_JAR = $(LIB_DIR)/javac.jar
|
||||
JAVADOC_JAR = $(LIB_DIR)/javadoc.jar
|
||||
JAVAH_JAR = $(LIB_DIR)/javah.jar
|
||||
JAVAP_JAR = $(LIB_DIR)/javap.jar
|
||||
APT_JAR = $(LIB_DIR)/apt.jar
|
||||
|
||||
CLASSES_JAR = $(DIST_DIR)/classes.jar
|
||||
SRC_ZIP = $(DIST_DIR)/src.zip
|
||||
|
||||
BUILDTOOLSRC_DIR = tools
|
||||
BUILDTOOLCLASSES_DIR = $(BUILD_DIR)/toolclasses
|
||||
|
||||
#-----
|
||||
|
||||
ifndef JDK_MAJOR_VERSION
|
||||
JDK_MAJOR_VERSION = 1
|
||||
endif
|
||||
|
||||
ifndef JDK_MINOR_VERSION
|
||||
JDK_MINOR_VERSION = 7
|
||||
endif
|
||||
|
||||
ifndef JDK_MICRO_VERSION
|
||||
JDK_MICRO_VERSION = 0
|
||||
endif
|
||||
|
||||
ifndef JDK_VERSION
|
||||
JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
|
||||
endif
|
||||
|
||||
ifndef MILESTONE
|
||||
MILESTONE = internal
|
||||
endif
|
||||
|
||||
# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
|
||||
ifneq ($(MILESTONE),fcs)
|
||||
RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
|
||||
else
|
||||
RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
|
||||
endif
|
||||
|
||||
# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
|
||||
ifdef BUILD_NUMBER
|
||||
FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
|
||||
else
|
||||
BUILD_NUMBER = b00
|
||||
USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
|
||||
FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
|
||||
endif
|
||||
|
||||
#----- useful macros
|
||||
|
||||
TOOLS = javac javadoc javah javap apt
|
||||
|
||||
SOURCE_LEVEL = 5
|
||||
BOOTSTRAP_TARGET_LEVEL = 5
|
||||
TARGET_LEVEL = 6
|
||||
|
||||
ifndef TARGET_JAVA
|
||||
TARGET_JAVA = java
|
||||
endif
|
||||
|
||||
NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
|
||||
|
||||
SELF = $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
#-----
|
||||
|
||||
# the default is to generate the following:
|
||||
# dist/{bin,lib}:
|
||||
# lang tools compiled to run on the target JDK
|
||||
|
||||
default:
|
||||
$(MAKE) -f $(SELF) \
|
||||
MILESTONE=bootstrap \
|
||||
TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \
|
||||
TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \
|
||||
GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \
|
||||
CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \
|
||||
BIN_DIR=$(BUILD_DIR)/bootstrap/bin \
|
||||
LIB_DIR=$(BUILD_DIR)/bootstrap/lib \
|
||||
$(BUILD_DIR)/bootstrap/lib/javac.jar \
|
||||
$(BUILD_DIR)/bootstrap/bin/javac
|
||||
$(MAKE) -f $(SELF) \
|
||||
BOOT_JAVAC=$(BUILD_DIR)/bootstrap/bin/javac \
|
||||
tools
|
||||
|
||||
# for jdk, we generate the following:
|
||||
# dist/bootstrap/{bin,lib}:
|
||||
# lang tools compiled to run on the boot JDK
|
||||
# dist/lib/classes.jar:
|
||||
# lang tools recompiled to run on the target JDK,
|
||||
# ready for inclusion in rt.jar and tools.jar
|
||||
# dist/lib/src.zip
|
||||
# .properties and .java files for classes in classes.jar,
|
||||
# ready for jdk src.zip
|
||||
|
||||
jdk:
|
||||
$(MAKE) -f $(SELF) \
|
||||
MILESTONE=bootstrap \
|
||||
TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \
|
||||
TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \
|
||||
GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \
|
||||
CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \
|
||||
BIN_DIR=$(DIST_DIR)/bootstrap/bin \
|
||||
LIB_DIR=$(DIST_DIR)/bootstrap/lib \
|
||||
tools
|
||||
$(MAKE) -f $(SELF) \
|
||||
BOOT_JAVAC=$(DIST_DIR)/bootstrap/bin/javac \
|
||||
LIB_DIR=$(BUILD_DIR)/jdk/lib \
|
||||
$(DIST_DIR)/lib/classes.jar \
|
||||
$(DIST_DIR)/lib/src.zip
|
||||
|
||||
tools: $(TOOLS:%=$(LIB_DIR)/%.jar) $(TOOLS:%=$(BIN_DIR)/%)
|
||||
|
||||
clean:
|
||||
$(RM) -r $(BUILD_DIR)
|
||||
|
||||
really-clean: clean
|
||||
$(RM) -r $(DIST_DIR)
|
||||
|
||||
jprt_product_build \
|
||||
jprt_debug_build \
|
||||
jprt_fastdebug_build: lib
|
||||
|
||||
#----- javac
|
||||
|
||||
JAVAC_DIRS = \
|
||||
javax/annotation/processing \
|
||||
javax/lang/model \
|
||||
javax/tools \
|
||||
com/sun/source \
|
||||
com/sun/tools/javac
|
||||
|
||||
JAVAC_RESOURCE_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.properties -print )
|
||||
|
||||
JAVAC_JAVA_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAC_RESOURCE_FILES)) \
|
||||
$(GENSRC_DIR)/com/sun/tools/javac/resources/version.java
|
||||
|
||||
$(JAVAC_JAR): $(JAVAC_JAVA_FILES)
|
||||
$(MKDIR) -p $(CLASSES_DIR) $(@D)
|
||||
$(BOOT_JAVAC) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(NO_PROPRIETARY_API_WARNINGS) $(JAVAC_JAVA_FILES)
|
||||
( $(ECHO) Main-Class: com.sun.tools.javac.Main ) > $(BUILD_DIR)/javac.mf
|
||||
$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javac.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAC_DIRS))
|
||||
|
||||
#----- javadoc
|
||||
|
||||
### FIXME -- javadoc has a couple of extra non-property resource files
|
||||
### that need to be included
|
||||
|
||||
JAVADOC_DIRS = \
|
||||
com/sun/javadoc \
|
||||
com/sun/tools/doclets \
|
||||
com/sun/tools/javadoc
|
||||
|
||||
JAVADOC_RESOURCE_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.properties -print )
|
||||
|
||||
JAVADOC_JAVA_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVADOC_RESOURCE_FILES))
|
||||
|
||||
$(JAVADOC_JAR): $(JAVADOC_JAVA_FILES) $(JAVAC_JAR)
|
||||
$(MKDIR) -p $(CLASSES_DIR) $(@D)
|
||||
$(BOOT_JAVAC) -sourcepath "" -classpath $(JAVAC_JAR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVADOC_JAVA_FILES)
|
||||
( $(ECHO) Main-Class: com.sun.tools.javadoc.Main ; $(ECHO) Class-Path: javac.jar ) > $(BUILD_DIR)/javadoc.mf
|
||||
$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javadoc.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVADOC_DIRS))
|
||||
|
||||
#----- javah
|
||||
|
||||
JAVAH_DIRS = \
|
||||
com/sun/tools/javah
|
||||
|
||||
JAVAH_RESOURCE_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.properties -print )
|
||||
|
||||
JAVAH_JAVA_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAH_RESOURCE_FILES))
|
||||
|
||||
$(JAVAH_JAR): $(JAVAH_JAVA_FILES) $(JAVADOC_JAR)
|
||||
$(MKDIR) -p $(CLASSES_DIR) $(@D)
|
||||
$(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAH_JAVA_FILES)
|
||||
( $(ECHO) Main-Class: com.sun.tools.javah.Main ; $(ECHO) Class-Path: javadoc.jar ) > $(BUILD_DIR)/javah.mf
|
||||
$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javah.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAH_DIRS))
|
||||
|
||||
#----- javap
|
||||
|
||||
JAVAP_DIRS = \
|
||||
sun/tools/javap
|
||||
|
||||
JAVAP_RESOURCE_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.properties -print )
|
||||
|
||||
JAVAP_JAVA_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES))
|
||||
|
||||
$(JAVAP_JAR): $(JAVAP_JAVA_FILES) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES))
|
||||
$(MKDIR) -p $(CLASSES_DIR)
|
||||
$(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAP_JAVA_FILES)
|
||||
( $(ECHO) Main-Class: sun.tools.javap.Main ) > $(BUILD_DIR)/javap.mf
|
||||
$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javap.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAP_DIRS))
|
||||
|
||||
#----- apt
|
||||
|
||||
APT_DIRS = \
|
||||
com/sun/mirror \
|
||||
com/sun/tools/apt
|
||||
|
||||
APT_RESOURCE_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(APT_DIRS)) -name SCCS -prune -o -name \*.properties -print )
|
||||
|
||||
APT_JAVA_FILES = \
|
||||
$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(APT_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES))
|
||||
|
||||
$(APT_JAR): $(APT_JAVA_FILES) $(JAVAC_JAR) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES))
|
||||
$(MKDIR) -p $(CLASSES_DIR) $(@D)
|
||||
$(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(NO_PROPRIETARY_API_WARNINGS) \
|
||||
$(APT_JAVA_FILES) \
|
||||
$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES))
|
||||
( $(ECHO) Main-Class: com.sun.tools.apt.Main ; $(ECHO) Class-Path: javac.jar ) > $(BUILD_DIR)/apt.mf
|
||||
$(BOOTJAR) -cfm $@ $(BUILD_DIR)/apt.mf $(patsubst %,-C $(CLASSES_DIR) %, $(APT_DIRS))
|
||||
|
||||
#-----
|
||||
|
||||
build-tools: $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
|
||||
|
||||
$(GENSRC_DIR)/%.java: $(SRC_CLASSES_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
|
||||
$(MKDIR) -p $(@D)
|
||||
$(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@)
|
||||
|
||||
$(GENSRC_DIR)/%.java: $(GENSRC_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
|
||||
$(MKDIR) -p $(@D)
|
||||
$(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@)
|
||||
|
||||
$(GENSRC_DIR)/%.properties: $(SRC_CLASSES_DIR)/%.properties-template
|
||||
$(MKDIR) -p $(@D)
|
||||
$(SED) -e 's/$$(JDK_VERSION)/$(JDK_VERSION)/' \
|
||||
-e 's/$$(FULL_VERSION)/$(FULL_VERSION)/' \
|
||||
-e 's/$$(RELEASE)/$(RELEASE)/' \
|
||||
< $< > $@
|
||||
|
||||
$(BUILDTOOLCLASSES_DIR)/%.class : $(BUILDTOOLSRC_DIR)/%.java
|
||||
$(MKDIR) -p $(@D)
|
||||
$(BOOT_JAVAC) -d $(@D) $<
|
||||
|
||||
#----- all classes
|
||||
|
||||
$(DIST_DIR)/%/classes.jar: $(JAVAC_JAR) $(JAVADOC_JAR) $(JAVAH_JAR) $(JAVAP_JAR) $(APT_JAR)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(BOOTJAR) -cf $@ -C $(CLASSES_DIR) .
|
||||
|
||||
#----- src.zip
|
||||
|
||||
SRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name SCCS -o -name \*-template \) -prune -o -type f -print )
|
||||
|
||||
$(DIST_DIR)/%/src.zip: $(SRC_ZIP_FILES)
|
||||
abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \
|
||||
( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name SCCS -o -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \
|
||||
( cd $(SRC_CLASSES_DIR) ; $(FIND) . -name SCCS -prune -o -name \*-template -print | $(SED) -e 's/-template//' ) | ( cd $(GENSRC_DIR) ; $(ZIP) -q $$abs_src_zip -@ )
|
||||
|
||||
#----- bin files
|
||||
|
||||
$(BIN_DIR)/%: $(SRC_BIN_DIR)/launcher.sh-template
|
||||
$(MKDIR) -p $(@D)
|
||||
$(SED) -e 's|#PROGRAM#|$(@F)|' -e 's|#TARGET_JAVA#|$(TARGET_JAVA)|' $< > $@
|
||||
$(CHMOD) +x $@
|
||||
|
||||
#-----
|
||||
|
||||
findbugs: $(BUILD_DIR)/findbugs.txt
|
||||
|
||||
$(BUILD_DIR)/findbugs.txt: $(CLASSES_JAR)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(FINDBUGS) -textui -javahome $(BOOT_JAVA_HOME) -high -emacs -outputFile $@ $<
|
||||
|
||||
#-----
|
||||
|
||||
quick-check: $(patsubst %, $(DIST_LIB_DIR)/%.jar, $(TOOLS))
|
||||
$(TESTJAVA) -jar $(JAVAC_JAR) -version
|
||||
- $(TESTJAVA) -jar $(JAVADOC_JAR) -version
|
||||
$(TESTJAVA) -jar $(JAVAH_JAR) -version
|
||||
- $(TESTJAVA) -jar $(JAVAP_JAR) -version
|
||||
$(TESTJAVA) -jar $(APT_JAR) -version
|
||||
|
||||
#-----
|
||||
|
||||
.PHONY: \
|
||||
all \
|
||||
build \
|
||||
build-tools \
|
||||
clean \
|
||||
default \
|
||||
findbugs \
|
||||
jprt_product_build \
|
||||
jprt_debug_build \
|
||||
jprt_fastdebug_build \
|
||||
tools
|
||||
|
43
langtools/make/README
Normal file
43
langtools/make/README
Normal file
@ -0,0 +1,43 @@
|
||||
Building the "langtools" workspace.
|
||||
|
||||
The "langtools" workspace can be built from the command line with Ant.
|
||||
The build file is make/build.xml, in conjunction with make/build.properties.
|
||||
Some additional user-specific properties files are also read, to allow
|
||||
you to customize selected properties as needed.
|
||||
|
||||
Individual tools within the workspace can also be built and worked on
|
||||
with NetBeans, using the projects in the make/netbeans directory.
|
||||
|
||||
The "langtools" workspace can also be built from the command line with
|
||||
GNU Make, although the Makefile is simply a wrapper around the Ant
|
||||
build file. This is provided for systems (such as the full OpenJDK build)
|
||||
that expect to be able to build this workspace with GNU Make.
|
||||
|
||||
System Requirements:
|
||||
Ant: version 1.6.5 or later
|
||||
NetBeans: version 5.0 or later (optional)
|
||||
JDK: currently version 1.5.0, although 1.6.0 is recommended
|
||||
OS: any system supporting the above tools
|
||||
|
||||
For more information:
|
||||
Ant: http://ant.apache.org/
|
||||
GNU Make: http://www.gnu.org/software/make/
|
||||
NetBeans: http://www.netbeans.org/
|
||||
|
||||
|
||||
Testing the "langtools" workspace.
|
||||
|
||||
The primary set of tests for the compiler is the compiler TCK. This
|
||||
tests that the compiler performs according to the specifications in
|
||||
JLS and JVMS.
|
||||
|
||||
In addition, there is a substantial collection of regression and unit
|
||||
tests for all the tools in the maain langtools test/ directory.
|
||||
|
||||
Finally, there is a small set of tests to do basic validation of a build
|
||||
of the langtools workspace for use by JDK. These tests check the contents
|
||||
of the dist/ directory generated by the build, and verify that the various
|
||||
tools can do basic "Hello World"-style processing. These tests should be
|
||||
run by jtreg, with the -jdk option set a version of JDK capable of running
|
||||
the default output of the javac compiler in this workspace. Currently,
|
||||
this means JDK 6 or better.
|
135
langtools/make/build.properties
Normal file
135
langtools/make/build.properties
Normal file
@ -0,0 +1,135 @@
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# This is the JDK used to build and run the bootstrap version of javac.
|
||||
# The bootstrap javac is used to compile both boostrap versions of the
|
||||
# other tools, and product versions of all the tools.
|
||||
# Override this path as needed, either on the command line or in
|
||||
# one of the standard user build.properties files (see build.xml)
|
||||
|
||||
# boot.java.home = /opt/jdk/1.5.0
|
||||
boot.java = ${boot.java.home}/bin/java
|
||||
boot.javac = ${boot.java.home}/bin/javac
|
||||
boot.javac.target = 5
|
||||
|
||||
# This is the JDK used to run the product version of the tools,
|
||||
# for example, for testing. If you're building a complete JDK, specify that.
|
||||
# Override this path as needed, either on the command line or in
|
||||
# one of the standard user build.properties files (see build.xml)
|
||||
|
||||
# target.java.home = /opt/jdk/1.6.0
|
||||
target.java = ${target.java.home}/bin/java
|
||||
|
||||
# Version info -- override as needed
|
||||
jdk.version = 1.7.0
|
||||
build.number = b00
|
||||
milestone = internal
|
||||
|
||||
# FIXME -- these need to match the standard values
|
||||
# If we include date in full.version (ie for developer build)
|
||||
# we will need to make sure the build is idempotent (i.e.
|
||||
# repeated builds don't rebuild the tools, because of new
|
||||
# timestamps
|
||||
# FIXME -- need to include openjdk as needed
|
||||
release = ${jdk.version}-${milestone}
|
||||
bootstrap.release = ${release}_bootstrap
|
||||
full.version = ${release}-${build.number}
|
||||
bootstrap.full.version = ${bootstrap.release}-${build.number}
|
||||
|
||||
# options for the <javac> tasks used to compile the tools
|
||||
javac.target = 6
|
||||
javac.debug = true
|
||||
javac.debuglevel = source,lines
|
||||
javac.no.jdk.warnings = -XDignore.symbol.file=true
|
||||
# set the following to -version to verify the versions of javac being used
|
||||
javac.version.opt =
|
||||
# in time, there should be no exceptions to -Xlint:all
|
||||
javac.lint.opts = -Xlint:all,-unchecked,-deprecation,-fallthrough,-cast,-serial -Werror
|
||||
|
||||
# options for the <javadoc> task for javac
|
||||
javadoc.jls3.url=http://java.sun.com/docs/books/jls/
|
||||
javadoc.jls3.cite=<a href="${javadoc.jls3.url}">The Java Language Specification, Third Edition</a>
|
||||
javadoc.jls3.option=-tag "jls3:a:See <cite>${javadoc.jls3.cite}</cite>:"
|
||||
|
||||
# jtreg, used to run the JDK regression tests
|
||||
# Override this path as needed, either on the command line or in
|
||||
# one of the standard user build.properties files (see build.xml)
|
||||
|
||||
# jtreg.home = /opt/jtreg/3.2.2_02
|
||||
|
||||
# findbugs
|
||||
# Override this path as needed, either on the command line or in
|
||||
# one of the standard user build.properties files (see build.xml)
|
||||
|
||||
# findbugs.home = /opt/findbugs/1.2.1
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
||||
# The following properties define the packages for each of the tools.
|
||||
# Syntactically, they should be suitable as arguments for the "includes"
|
||||
# parameter of Ant filesets. In particular, note the trailing '/'.
|
||||
|
||||
javac.includes = \
|
||||
javax/annotation/processing/ \
|
||||
javax/lang/model/ \
|
||||
javax/tools/ \
|
||||
com/sun/source/ com/sun/tools/javac/
|
||||
|
||||
javac.tests = \
|
||||
tools/javac
|
||||
|
||||
javadoc.includes = \
|
||||
com/sun/javadoc/ \
|
||||
com/sun/tools/javadoc/
|
||||
|
||||
javadoc.tests = \
|
||||
tools/javadoc/
|
||||
|
||||
doclets.includes = \
|
||||
com/sun/tools/doclets/
|
||||
|
||||
doclets.tests = \
|
||||
com/sun/javadoc/
|
||||
|
||||
javah.includes = \
|
||||
com/sun/tools/javah/
|
||||
|
||||
javah.tests = \
|
||||
tools/javah/
|
||||
|
||||
javap.includes = \
|
||||
sun/tools/javap/
|
||||
|
||||
javap.tests = \
|
||||
tools/javap/
|
||||
|
||||
apt.includes = \
|
||||
com/sun/mirror/ \
|
||||
com/sun/tools/apt/
|
||||
|
||||
apt.tests = \
|
||||
tools/apt/
|
||||
|
||||
|
759
langtools/make/build.xml
Normal file
759
langtools/make/build.xml
Normal file
@ -0,0 +1,759 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Sun designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Sun in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
have any questions.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This is the main build file for the complete langtools workspace.
|
||||
It is used both when working on the tools in NetBeans, and when building
|
||||
JDK itself, in which case it is invoked from the wrapper Makefile.
|
||||
-->
|
||||
|
||||
<project name="langtools" default="build" basedir="..">
|
||||
|
||||
<!-- The following locations can be used to override default property values. -->
|
||||
|
||||
<!-- Use this location for customizations specific to this instance of this workspace -->
|
||||
<property file="build.properties"/>
|
||||
|
||||
<!-- Use this location for customizations common to all OpenJDK langtools workspaces -->
|
||||
<property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
|
||||
|
||||
<!-- Use this location for customizations common to all OpenJDK workspaces -->
|
||||
<property file="${user.home}/.openjdk/build.properties"/>
|
||||
|
||||
<!-- Convenient shorthands for standard locations within the workspace. -->
|
||||
<property name="build.dir" location="build"/>
|
||||
<property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/>
|
||||
<property name="build.coverage.dir" location="${build.dir}/coverage"/>
|
||||
<property name="build.classes.dir" location="${build.dir}/classes"/>
|
||||
<property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
|
||||
<property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
|
||||
<property name="build.jtreg.dir" location="${build.dir}/jtreg"/>
|
||||
<property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
|
||||
<property name="dist.dir" location="dist"/>
|
||||
<property name="dist.bin.dir" location="${dist.dir}/bin"/>
|
||||
<property name="dist.coverage.dir" location="${dist.dir}/coverage"/>
|
||||
<property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/>
|
||||
<property name="dist.lib.dir" location="${dist.dir}/lib"/>
|
||||
<property name="make.dir" location="make"/>
|
||||
<property name="make.tools.dir" location="${make.dir}/tools"/>
|
||||
<property name="src.dir" location="src"/>
|
||||
<property name="src.bin.dir" location="${src.dir}/share/bin"/>
|
||||
<property name="src.classes.dir" location="${src.dir}/share/classes"/>
|
||||
<property name="test.dir" location="test"/>
|
||||
|
||||
<!-- java.marker is set to a marker file to check for within a Java install dir.
|
||||
The best file to check for across Solaris/Linux/Windows/MacOS is one of the
|
||||
executables; regrettably, that is OS-specific. -->
|
||||
<condition property="java.marker" value="bin/java">
|
||||
<os family="unix"/>
|
||||
</condition>
|
||||
<condition property="java.marker" value="bin/java.exe">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<!-- Standard property values, if not overriden by earlier settings. -->
|
||||
<property file="${make.dir}/build.properties"/>
|
||||
|
||||
<!-- Standard target to build deliverables for JDK build. -->
|
||||
|
||||
<target name="build" depends="build-bootstrap-tools,build-all-classes">
|
||||
<copy todir="${dist.dir}/bootstrap">
|
||||
<fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/>
|
||||
</copy>
|
||||
<chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx">
|
||||
<include name="*"/>
|
||||
</chmod>
|
||||
<mkdir dir="${dist.lib.dir}"/>
|
||||
<jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
|
||||
<zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-bootstrap-tools" depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah"/>
|
||||
|
||||
<target name="build-all-tools" depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-apt"/>
|
||||
|
||||
<target name="build-all-classes" depends="build-classes-javac,build-classes-javadoc,build-classes-doclets,build-classes-javah,build-classes-javap,build-classes-apt"/>
|
||||
|
||||
<!-- clean -->
|
||||
|
||||
<target name="clean" description="Delete all generated files">
|
||||
<delete dir="${build.dir}"/>
|
||||
<delete dir="${dist.dir}"/>
|
||||
</target>
|
||||
|
||||
<!-- Additional targets for running tools on the build -->
|
||||
|
||||
<!-- An alternative for the following would be to do a single jtreg run for all tests.
|
||||
However, that would currently be slower, since we would have to run all the tests
|
||||
with samevm="false", since not all test directories currently support samevm="true". -->
|
||||
|
||||
<target name="jtreg" depends="jtreg-javac,jtreg-javadoc,jtreg-doclets,jtreg-javah,jtreg-javap,jtreg-apt"/>
|
||||
|
||||
<target name="findbugs" depends="-def-findbugs,build-all-tools">
|
||||
<property name="findbugs.reportLevel" value="medium"/>
|
||||
<mkdir dir="${dist.findbugs.dir}"/>
|
||||
<findbugs
|
||||
home="${findbugs.home}"
|
||||
projectName="JDK langtools ${full.version}"
|
||||
output="xml"
|
||||
outputFile="${dist.findbugs.dir}/findbugs.xml"
|
||||
reportLevel="${findbugs.reportLevel}"
|
||||
failOnError="false"
|
||||
errorProperty="findbugs.all.errors"
|
||||
warningsProperty="findbugs.all.warnings"
|
||||
jvmargs="-Xmx512M">
|
||||
<class location="${build.classes.dir}"/>
|
||||
<sourcePath>
|
||||
<pathelement location="${src.classes.dir}"/>
|
||||
</sourcePath>
|
||||
</findbugs>
|
||||
<exec executable="sh">
|
||||
<arg value="${findbugs.home}/bin/convertXmlToText"/>
|
||||
<arg value="-longBugCodes"/>
|
||||
<arg value="-html:${findbugs.home}/src/xsl/fancy.xsl"/>
|
||||
<arg value="${dist.findbugs.dir}/findbugs.xml"/>
|
||||
<redirector output="${dist.findbugs.dir}/findbugs.html"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/>
|
||||
|
||||
<target name="instrument-classes" depends="-def-cobertura">
|
||||
<!-- only define the following property when we want coverage info -->
|
||||
<path id="coverage.classpath">
|
||||
<pathelement location="${build.coverage.dir}/classes"/>
|
||||
<path refid="cobertura.classpath"/>
|
||||
</path>
|
||||
<property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/>
|
||||
<property name="coverage.classpath" refid="coverage.classpath"/>
|
||||
<mkdir dir="${build.coverage.dir}/classes"/>
|
||||
<delete file="${build.coverage.dir}/cobertura.ser"/>
|
||||
<cobertura-instrument todir="${build.coverage.dir}/classes"
|
||||
datafile="${build.coverage.dir}/cobertura.ser">
|
||||
<fileset dir="${build.classes.dir}"
|
||||
includes="**/*.class" excludes="**/resources/*.class"/>
|
||||
</cobertura-instrument>
|
||||
</target>
|
||||
|
||||
<target name="coverage-report" depends="-def-cobertura">
|
||||
<mkdir dir="${dist.coverage.dir}"/>
|
||||
<cobertura-report
|
||||
srcdir="${src.classes.dir}"
|
||||
destdir="${dist.coverage.dir}"
|
||||
datafile="${build.coverage.dir}/cobertura.ser"/>
|
||||
<cobertura-report
|
||||
format="xml"
|
||||
srcdir="${src.classes.dir}"
|
||||
destdir="${dist.coverage.dir}"
|
||||
datafile="${build.coverage.dir}/cobertura.ser"/>
|
||||
</target>
|
||||
|
||||
<!-- javac targets -->
|
||||
|
||||
<target name="build-bootstrap-javac" depends="-def-build-bootstrap-tool">
|
||||
<build-bootstrap-tool name="javac" includes="${javac.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-javac" depends="build-bootstrap-javac">
|
||||
<build-classes name="javac" includes="${javac.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-javac" depends="build-bootstrap-javac">
|
||||
<build-tool name="javac" includes="${javac.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
|
||||
<javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls3.option}"/>
|
||||
</target>
|
||||
|
||||
<target name="jtreg-javac" depends="build-javac,-def-jtreg">
|
||||
<jtreg-tool name="javac" samevm="true" tests="${javac.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-javac" depends="build-javac,-def-findbugs">
|
||||
<findbugs-tool name="javac"/>
|
||||
</target>
|
||||
|
||||
<target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
|
||||
|
||||
<!-- javadoc targets -->
|
||||
|
||||
<target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
|
||||
<build-bootstrap-tool name="javadoc"
|
||||
includes="${javadoc.includes}"
|
||||
jarclasspath="javac.jar doclets.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-javadoc" depends="build-classes-javac">
|
||||
<build-classes name="javadoc" includes="${javadoc.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-javadoc" depends="build-javac">
|
||||
<build-tool name="javadoc"
|
||||
includes="${javadoc.includes}"
|
||||
jarclasspath="javac.jar doclets.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
|
||||
<javadoc-tool name="javadoc" includes="${javadoc.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
|
||||
<jtreg-tool name="javadoc" samevm="false" tests="${javadoc.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
|
||||
<findbugs-tool name="javadoc"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
|
||||
|
||||
<!-- doclets targets -->
|
||||
|
||||
<target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar">
|
||||
<build-bootstrap-jar name="doclets"
|
||||
includes="${doclets.includes}"
|
||||
jarmainclass="com.sun.tools.javadoc.Main"
|
||||
jarclasspath="javadoc.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-doclets" depends="build-classes-javadoc">
|
||||
<build-classes name="doclets" includes="${doclets.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-doclets" depends="build-javadoc">
|
||||
<!-- just jar, no bin for doclets -->
|
||||
<build-jar name="doclets"
|
||||
includes="${doclets.includes}"
|
||||
jarclasspath="javadoc.jar"/>
|
||||
</target>
|
||||
|
||||
<!-- (no javadoc for doclets) -->
|
||||
|
||||
<target name="jtreg-doclets" depends="build-doclets,-def-jtreg">
|
||||
<jtreg-tool name="doclets" samevm="false" tests="${doclets.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-doclets" depends="build-doclets,-def-findbugs">
|
||||
<findbugs-tool name="doclets"/>
|
||||
</target>
|
||||
|
||||
<target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/>
|
||||
|
||||
<!-- javah targets -->
|
||||
|
||||
<target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
|
||||
<build-bootstrap-tool name="javah"
|
||||
includes="${javah.includes}"
|
||||
jarclasspath="javadoc.jar doclets.jar javac.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-javah" depends="build-javadoc">
|
||||
<build-tool name="javah"
|
||||
includes="${javah.includes}"
|
||||
jarclasspath="javadoc.jar doclets.jar javac.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-javah" depends="build-classes-javadoc">
|
||||
<build-classes name="javah" includes="${javah.includes}"/>
|
||||
</target>
|
||||
|
||||
<!-- (no javadoc for javah) -->
|
||||
|
||||
<target name="jtreg-javah" depends="build-javah,-def-jtreg">
|
||||
<jtreg-tool name="javah" samevm="true" tests="${javah.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-javah" depends="build-javah,-def-findbugs">
|
||||
<findbugs-tool name="javah"/>
|
||||
</target>
|
||||
|
||||
<target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
|
||||
|
||||
<!-- javap targets -->
|
||||
|
||||
<target name="build-bootstrap-javap" depends="-def-build-bootstrap-tool">
|
||||
<build-bootstrap-tool name="javap"
|
||||
includes="${javap.includes}"
|
||||
jarmainclass="sun.tools.javap.Main"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-javap" depends="build-bootstrap-javac">
|
||||
<build-classes name="javap" includes="${javap.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="build-javap" depends="build-bootstrap-javac">
|
||||
<build-tool name="javap"
|
||||
includes="${javap.includes}"
|
||||
jarmainclass="sun.tools.javap.Main"/>
|
||||
</target>
|
||||
|
||||
<!-- (no javadoc for javap) -->
|
||||
|
||||
<target name="jtreg-javap" depends="build-javap,-def-jtreg">
|
||||
<jtreg-tool name="javap" samevm="true" tests="${javap.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-javap" depends="build-javap,-def-findbugs">
|
||||
<findbugs-tool name="javap"/>
|
||||
</target>
|
||||
|
||||
<target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
|
||||
|
||||
<!-- apt targets -->
|
||||
|
||||
<target name="build-bootstrap-apt" depends="build-bootstrap-javac">
|
||||
<build-bootstrap-tool name="apt"
|
||||
includes="${apt.includes}"
|
||||
jarclasspath="javac.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-apt" depends="build-javac">
|
||||
<build-tool name="apt"
|
||||
includes="${apt.includes}"
|
||||
jarclasspath="javac.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-classes-apt" depends="build-classes-javac">
|
||||
<build-classes name="apt" includes="${apt.includes}"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-apt" depends="build-apt,-def-javadoc-tool">
|
||||
<javadoc-tool name="apt" includes="${apt.includes}"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="jtreg-apt" depends="build-apt,-def-jtreg">
|
||||
<jtreg-tool name="apt" samevm="true" tests="${apt.tests}"/>
|
||||
</target>
|
||||
|
||||
<target name="findbugs-apt" depends="build-apt,-def-findbugs">
|
||||
<findbugs-tool name="apt"/>
|
||||
</target>
|
||||
|
||||
<target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/>
|
||||
|
||||
<!-- Check targets -->
|
||||
|
||||
<target name="-check-boot.java.home" depends="-def-check">
|
||||
<check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
|
||||
</target>
|
||||
|
||||
<target name="-check-target.java.home" depends="-def-check">
|
||||
<check name="target java" property="target.java.home" marker="${java.marker}"/>
|
||||
</target>
|
||||
|
||||
<target name="-check-cobertura.home" depends="-def-check">
|
||||
<check name="cobertura" property="cobertura.home" marker="cobertura.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="-check-findbugs.home" depends="-def-check">
|
||||
<check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="-check-jtreg.home" depends="-def-check">
|
||||
<check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
|
||||
</target>
|
||||
|
||||
<!-- Ant macro and preset defs -->
|
||||
|
||||
<target name="-def-build-tool" depends="-def-build-jar">
|
||||
<macrodef name="build-tool">
|
||||
<attribute name="name"/>
|
||||
<attribute name="includes"/>
|
||||
<attribute name="excludes" default="**/package-info.java"/>
|
||||
<attribute name="bin.dir" default="${dist.bin.dir}"/>
|
||||
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
||||
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
||||
<attribute name="lib.dir" default="${dist.lib.dir}"/>
|
||||
<attribute name="java" default="java"/>
|
||||
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
|
||||
<attribute name="javac.target" default="${javac.target}"/>
|
||||
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
|
||||
<attribute name="jarclasspath" default=""/>
|
||||
<attribute name="release" default="${release}"/>
|
||||
<attribute name="full.version" default="${full.version}"/>
|
||||
<sequential>
|
||||
<build-jar
|
||||
name="@{name}"
|
||||
gensrc.dir="@{gensrc.dir}"
|
||||
classes.dir="@{classes.dir}"
|
||||
lib.dir="@{lib.dir}"
|
||||
includes="@{includes}"
|
||||
excludes="@{excludes}"
|
||||
jarmainclass="@{jarmainclass}"
|
||||
jarclasspath="@{jarclasspath}"
|
||||
release="@{release}"
|
||||
full.version="@{full.version}"
|
||||
javac.bootclasspath="@{javac.bootclasspath}"
|
||||
javac.target="@{javac.target}"
|
||||
/>
|
||||
<mkdir dir="@{bin.dir}"/>
|
||||
<copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
|
||||
<filterset begintoken="#" endtoken="#">
|
||||
<filter token="PROGRAM" value="@{name}"/>
|
||||
<filter token="TARGET_JAVA" value="@{java}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<target name="-def-build-jar" depends="-def-build-classes">
|
||||
<macrodef name="build-jar">
|
||||
<attribute name="name"/>
|
||||
<attribute name="includes"/>
|
||||
<attribute name="excludes" default="**/package-info.java"/>
|
||||
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
||||
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
||||
<attribute name="lib.dir" default="${dist.lib.dir}"/>
|
||||
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
|
||||
<attribute name="javac.target" default="${javac.target}"/>
|
||||
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
|
||||
<attribute name="jarclasspath" default=""/>
|
||||
<attribute name="release" default="${release}"/>
|
||||
<attribute name="full.version" default="${full.version}"/>
|
||||
<sequential>
|
||||
<build-classes
|
||||
name="@{name}"
|
||||
gensrc.dir="@{gensrc.dir}"
|
||||
classes.dir="@{classes.dir}"
|
||||
includes="@{includes}"
|
||||
excludes="@{excludes}"
|
||||
release="@{release}"
|
||||
full.version="@{full.version}"
|
||||
javac.bootclasspath="@{javac.bootclasspath}"
|
||||
javac.target="@{javac.target}"
|
||||
/>
|
||||
<mkdir dir="@{lib.dir}"/>
|
||||
<jar destfile="@{lib.dir}/@{name}.jar"
|
||||
basedir="@{classes.dir}"
|
||||
includes="@{includes}">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="@{jarmainclass}"/>
|
||||
<attribute name="Class-Path" value="@{jarclasspath}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<target name="-def-build-classes" depends="-def-pcompile">
|
||||
<macrodef name="build-classes">
|
||||
<attribute name="name"/>
|
||||
<attribute name="includes"/>
|
||||
<attribute name="excludes" default="**/package-info.java"/>
|
||||
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
||||
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
||||
<attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
|
||||
<attribute name="javac.target" default="${javac.target}"/>
|
||||
<attribute name="release" default="${release}"/>
|
||||
<attribute name="full.version" default="${full.version}"/>
|
||||
<sequential>
|
||||
<mkdir dir="@{gensrc.dir}"/>
|
||||
<mkdir dir="@{classes.dir}"/>
|
||||
<pcompile srcdir="${src.classes.dir}"
|
||||
destdir="@{gensrc.dir}"
|
||||
includes="@{includes}"/>
|
||||
<copy todir="@{gensrc.dir}">
|
||||
<fileset dir="${src.classes.dir}" includes="${javac.includes}"/>
|
||||
<globmapper from="*.properties-template" to="*.properties"/>
|
||||
<filterset begintoken="$(" endtoken=")">
|
||||
<filter token="JDK_VERSION" value="${jdk.version}"/>
|
||||
<filter token="RELEASE" value="@{release}"/>
|
||||
<filter token="FULL_VERSION" value="@{full.version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<pcompile srcdir="@{gensrc.dir}"
|
||||
destdir="@{gensrc.dir}"
|
||||
includes="**/*.properties"/>
|
||||
<javac fork="true"
|
||||
srcdir="@{gensrc.dir}"
|
||||
destdir="@{classes.dir}"
|
||||
includes="@{includes}"
|
||||
sourcepath=""
|
||||
includeAntRuntime="no"
|
||||
target="@{javac.target}">
|
||||
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
|
||||
<compilerarg line="${javac.version.opt}"/>
|
||||
<compilerarg line="-Xlint"/>
|
||||
</javac>
|
||||
<javac fork="true"
|
||||
srcdir="${src.classes.dir}"
|
||||
destdir="@{classes.dir}"
|
||||
includes="@{includes}"
|
||||
excludes="@{excludes}"
|
||||
sourcepath=""
|
||||
includeAntRuntime="no"
|
||||
target="@{javac.target}"
|
||||
debug="${javac.debug}"
|
||||
debuglevel="${javac.debuglevel}">
|
||||
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
|
||||
<compilerarg value="-Xbootclasspath/p:@{classes.dir}"/>
|
||||
<compilerarg line="${javac.no.jdk.warnings}"/>
|
||||
<compilerarg line="${javac.version.opt}"/>
|
||||
<compilerarg line="${javac.lint.opts}"/>
|
||||
</javac>
|
||||
<copy todir="@{classes.dir}">
|
||||
<fileset dir="${src.classes.dir}">
|
||||
<include name="@{includes}"/>
|
||||
<exclude name="**/*.java"/>
|
||||
<exclude name="**/*.properties"/>
|
||||
<exclude name="**/*-template"/>
|
||||
<exclude name="**/package.html"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
|
||||
<presetdef name="build-bootstrap-tool">
|
||||
<build-tool
|
||||
javac.target="${boot.javac.target}"
|
||||
gensrc.dir="${build.bootstrap.dir}/gensrc"
|
||||
classes.dir="${build.bootstrap.dir}/classes"
|
||||
bin.dir="${build.bootstrap.dir}/bin"
|
||||
lib.dir="${build.bootstrap.dir}/lib"
|
||||
java="${boot.java}"
|
||||
javac.bootclasspath=""
|
||||
release="${bootstrap.release}"
|
||||
full.version="${bootstrap.full.version}"/>
|
||||
</presetdef>
|
||||
</target>
|
||||
|
||||
<target name="-def-build-bootstrap-jar" depends="-def-build-jar">
|
||||
<presetdef name="build-bootstrap-jar">
|
||||
<build-jar
|
||||
javac.target="${boot.javac.target}"
|
||||
gensrc.dir="${build.bootstrap.dir}/gensrc"
|
||||
classes.dir="${build.bootstrap.dir}/classes"
|
||||
lib.dir="${build.bootstrap.dir}/lib"
|
||||
javac.bootclasspath=""
|
||||
release="${bootstrap.release}"
|
||||
full.version="${bootstrap.full.version}"/>
|
||||
</presetdef>
|
||||
</target>
|
||||
|
||||
<target name="-def-pcompile">
|
||||
<mkdir dir="${build.toolclasses.dir}"/>
|
||||
<javac srcdir="${make.tools.dir}/CompileProperties"
|
||||
destdir="${build.toolclasses.dir}/"
|
||||
classpath="${ant.home}/lib/ant.jar"/>
|
||||
<taskdef name="pcompile"
|
||||
classname="CompilePropertiesTask"
|
||||
classpath="${build.toolclasses.dir}/"/>
|
||||
</target>
|
||||
|
||||
<target name="-def-javadoc-tool" depends="-check-target.java.home">
|
||||
<macrodef name="javadoc-tool">
|
||||
<attribute name="name"/>
|
||||
<attribute name="includes"/>
|
||||
<attribute name="options" default=""/>
|
||||
<attribute name="source" default="1.5"/> <!-- FIXME -->
|
||||
<sequential>
|
||||
<property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
|
||||
<!-- Note: even with this default value, includes
|
||||
from src.classes.dir get javadoc'd; see packageset below -->
|
||||
<property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
|
||||
<javadoc
|
||||
executable="${target.java.home}/bin/javadoc"
|
||||
destdir="${build.javadoc.dir}/@{name}"
|
||||
source="@{source}"
|
||||
windowtitle="UNOFFICIAL"
|
||||
failonerror="true"
|
||||
use="true"
|
||||
author="false"
|
||||
version="false"
|
||||
packagenames="${javadoc.packagenames}" >
|
||||
<header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
|
||||
<arg line="@{options}"/>
|
||||
<bootclasspath>
|
||||
<path location="${build.classes.dir}"/>
|
||||
<path location="${target.java.home}/jre/lib/rt.jar"/>
|
||||
</bootclasspath>
|
||||
<sourcepath>
|
||||
<pathelement location="${src.classes.dir}"/>
|
||||
</sourcepath>
|
||||
<!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
|
||||
<!-- means that {@link some.package} will not work, which is no good. -->
|
||||
<!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
|
||||
<!-- which also causes duplicates in the class index for included files.) -->
|
||||
<packageset dir="${src.classes.dir}" includes="@{includes}">
|
||||
<or>
|
||||
<filename name="java/"/>
|
||||
<filename name="javax/"/>
|
||||
<filename name="com/sun/javadoc/"/>
|
||||
<filename name="com/sun/mirror/"/>
|
||||
<filename name="com/sun/source/"/>
|
||||
</or>
|
||||
</packageset>
|
||||
</javadoc>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
|
||||
<taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
|
||||
<classpath>
|
||||
<pathelement location="${jtreg.home}/lib/jtreg.jar"/>
|
||||
<pathelement location="${jtreg.home}/lib/javatest.jar"/>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<macrodef name="jtreg-tool">
|
||||
<attribute name="name"/>
|
||||
<attribute name="tests"/>
|
||||
<attribute name="jdk" default="${target.java.home}"/>
|
||||
<attribute name="samevm" default="false"/>
|
||||
<attribute name="verbose" default="summary"/>
|
||||
<attribute name="options" default=""/>
|
||||
<attribute name="keywords" default="-keywords:!ignore"/>
|
||||
<attribute name="jpda.jvmargs" default=""/>
|
||||
<sequential>
|
||||
<property name="coverage.options" value=""/> <!-- default -->
|
||||
<property name="coverage.classpath" value=""/> <!-- default -->
|
||||
<jtreg
|
||||
dir="${test.dir}"
|
||||
workDir="${build.jtreg.dir}/@{name}/work"
|
||||
reportDir="${build.jtreg.dir}/@{name}/report"
|
||||
jdk="@{jdk}"
|
||||
samevm="@{samevm}" verbose="@{verbose}"
|
||||
failonerror="false" resultproperty="jtreg.@{name}.result"
|
||||
javacoptions="-g"
|
||||
vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}:${build.classes.dir} @{jpda.jvmargs}">
|
||||
<arg line="@{keywords}"/>
|
||||
<arg line="@{options}"/>
|
||||
<arg line="@{tests}"/>
|
||||
</jtreg>
|
||||
<!-- the next two properties are for convenience, when only
|
||||
a single instance of jtreg will be invoked. -->
|
||||
<condition property="jtreg.passed">
|
||||
<equals arg1="${jtreg.javac.result}" arg2="0"/>
|
||||
</condition>
|
||||
<property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property name="jtreg.defined" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="-def-cobertura" depends="-check-cobertura.home">
|
||||
<path id="cobertura.classpath">
|
||||
<fileset dir="${cobertura.home}">
|
||||
<include name="cobertura.jar"/>
|
||||
<include name="lib/**/*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
|
||||
</target>
|
||||
|
||||
<target name="-def-findbugs" unless="findbugs.defined" depends="-check-findbugs.home">
|
||||
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
|
||||
<classpath>
|
||||
<pathelement location="${findbugs.home}/lib/findbugs.jar"/>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<macrodef name="findbugs-tool">
|
||||
<attribute name="name"/>
|
||||
<attribute name="output" default="emacs"/>
|
||||
<attribute name="outputFile" default=""/>
|
||||
<attribute name="reportLevel" default="high"/>
|
||||
<sequential>
|
||||
<findbugs
|
||||
home="${findbugs.home}"
|
||||
output="@{output}"
|
||||
outputFile="@{outputFile}"
|
||||
reportLevel="@{reportLevel}"
|
||||
failOnError="false"
|
||||
errorProperty="findbugs.@{name}.errors"
|
||||
warningsProperty="findbugs.@{name}.warnings"
|
||||
jvmargs="-Xmx512M" >
|
||||
<class location="${dist.dir}/lib/@{name}.jar"/>
|
||||
<auxClasspath>
|
||||
<pathelement location="${build.classes.dir}"/>
|
||||
</auxClasspath>
|
||||
<sourcePath>
|
||||
<pathelement location="${src.classes.dir}"/>
|
||||
</sourcePath>
|
||||
</findbugs>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property name="findbugs.defined" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="-def-check">
|
||||
<macrodef name="check">
|
||||
<attribute name="name"/>
|
||||
<attribute name="property"/>
|
||||
<attribute name="marker"/>
|
||||
<sequential>
|
||||
<fail message="Cannot locate @{name}: please set @{property} to its location">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="@{property}"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<fail message="@{name} is not installed in ${@{property}}">
|
||||
<condition>
|
||||
<not>
|
||||
<available file="${@{property}}/@{marker}"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<!-- standard JDK target -->
|
||||
<target name="sanity"
|
||||
description="display settings of congiguration values">
|
||||
<echo level="info">ant.home = ${ant.home}</echo>
|
||||
<echo level="info">boot.java.home = ${boot.java.home}</echo>
|
||||
<echo level="info">target.java.home = ${target.java.home}</echo>
|
||||
<echo level="info">jtreg.home = ${jtreg.home}</echo>
|
||||
<echo level="info">findbugs.home = ${findbugs.home}</echo>
|
||||
</target>
|
||||
|
||||
<!-- useful debugging targets -->
|
||||
<target name="diagnostics">
|
||||
<diagnostics/>
|
||||
</target>
|
||||
|
||||
<target name="post-sanity" depends="-def-jtreg,sanity,build"
|
||||
description="perform basic validation after a standard build">
|
||||
<jtreg
|
||||
dir="make/test"
|
||||
workDir="${build.jtreg.dir}/post-sanity/work"
|
||||
reportDir="${build.jtreg.dir}/post-sanity/report"
|
||||
jdk="${target.java.home}"
|
||||
verbose="summary"
|
||||
failonerror="false" resultproperty="jtreg.post-sanity.result">
|
||||
</jtreg>
|
||||
|
||||
</target>
|
||||
</project>
|
||||
|
241
langtools/make/jprt.config
Normal file
241
langtools/make/jprt.config
Normal file
@ -0,0 +1,241 @@
|
||||
#!echo "This is not a shell script"
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# JPRT shell configuration for building.
|
||||
#
|
||||
# Input environment variables:
|
||||
# ALT_BOOTDIR
|
||||
# ALT_SLASH_JAVA
|
||||
# ALT_JDK_IMPORT_PATH
|
||||
# Windows Only:
|
||||
# PATH
|
||||
# PROCESSOR_IDENTIFIER
|
||||
# ROOTDIR
|
||||
#
|
||||
# Output variable settings:
|
||||
# make Full path to GNU make
|
||||
#
|
||||
# Output environment variables:
|
||||
# PATH
|
||||
# Windows Only:
|
||||
# ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
|
||||
#
|
||||
# After JDK6, most settings will be found via ALT_SLASH_JAVA or
|
||||
# by way of other system environment variables. If this was JDK5
|
||||
# or an older JDK, you might need to export more ALT_* variables.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
#############################################################################
|
||||
# Error
|
||||
error() # message
|
||||
{
|
||||
echo "ERROR: $1"
|
||||
exit 6
|
||||
}
|
||||
# Directory must exist
|
||||
dirMustExist() # dir name
|
||||
{
|
||||
if [ ! -d "$1" ] ; then
|
||||
error "Directory for $2 does not exist: $1"
|
||||
fi
|
||||
}
|
||||
# File must exist
|
||||
fileMustExist() # dir name
|
||||
{
|
||||
if [ ! -f "$1" ] ; then
|
||||
error "File for $2 does not exist: $1"
|
||||
fi
|
||||
}
|
||||
#############################################################################
|
||||
|
||||
# Should be set by JPRT as the 3 basic inputs
|
||||
bootdir="${ALT_BOOTDIR}"
|
||||
slashjava="${ALT_SLASH_JAVA}"
|
||||
jdk_import="${ALT_JDK_IMPORT_PATH}"
|
||||
|
||||
# Check input
|
||||
dirMustExist "${bootdir}" ALT_BOOTDIR
|
||||
dirMustExist "${slashjava}" ALT_SLASH_JAVA
|
||||
dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
|
||||
|
||||
# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
|
||||
osname=`uname -s`
|
||||
if [ "${osname}" = SunOS ] ; then
|
||||
|
||||
# SOLARIS: Sparc or X86
|
||||
osarch=`uname -p`
|
||||
if [ "${osarch}" = sparc ] ; then
|
||||
solaris_arch=sparc
|
||||
else
|
||||
solaris_arch=i386
|
||||
fi
|
||||
|
||||
# Add basic solaris system paths
|
||||
path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
|
||||
|
||||
# Get the previous JDK to be used to bootstrap the build
|
||||
path4sdk=${bootdir}/bin:${path4sdk}
|
||||
|
||||
# Ant
|
||||
ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
|
||||
export ANT_HOME
|
||||
antbindir=${ANT_HOME}/bin
|
||||
fileMustExist "${antbindir}/ant" ant
|
||||
path4sdk=${antbindir}:${path4sdk}
|
||||
|
||||
# Find GNU make
|
||||
make=/usr/sfw/bin/gmake
|
||||
if [ ! -f ${make} ] ; then
|
||||
make=/opt/sfw/bin/gmake
|
||||
if [ ! -f ${make} ] ; then
|
||||
make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
|
||||
fi
|
||||
fi
|
||||
fileMustExist "${make}" make
|
||||
|
||||
# File creation mask
|
||||
umask 002
|
||||
|
||||
elif [ "${osname}" = Linux ] ; then
|
||||
|
||||
# LINUX: X86, AMD64
|
||||
osarch=`uname -m`
|
||||
if [ "${osarch}" = i686 ] ; then
|
||||
linux_arch=i586
|
||||
elif [ "${osarch}" = x86_64 ] ; then
|
||||
linux_arch=amd64
|
||||
fi
|
||||
|
||||
# Add basic paths
|
||||
path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
|
||||
# Get the previous JDK to be used to bootstrap the build
|
||||
path4sdk=${bootdir}/bin:${path4sdk}
|
||||
|
||||
# Ant
|
||||
ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
|
||||
export ANT_HOME
|
||||
antbindir=${ANT_HOME}/bin
|
||||
fileMustExist "${antbindir}/ant" ant
|
||||
path4sdk=${antbindir}:${path4sdk}
|
||||
|
||||
# Find GNU make
|
||||
make=/usr/bin/make
|
||||
fileMustExist "${make}" make
|
||||
|
||||
umask 002
|
||||
|
||||
else
|
||||
|
||||
# Windows: Differs on CYGWIN vs. MKS
|
||||
# Also, blanks in pathnames gives GNU make headaches, so anything placed
|
||||
# in any ALT_* variable should be the short windows dosname.
|
||||
|
||||
# WINDOWS: Install and use MKS or CYGWIN (should have already been done)
|
||||
# Assumption here is that you are in a shell window via MKS or cygwin.
|
||||
# MKS install should have defined the environment variable ROOTDIR.
|
||||
# We also need to figure out which one we have: X86, AMD64
|
||||
if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
|
||||
windows_arch=amd64
|
||||
else
|
||||
windows_arch=i586
|
||||
fi
|
||||
|
||||
# We need to determine if we are running a CYGWIN shell or an MKS shell
|
||||
# (if uname isn't available, then it will be unix_toolset=unknown)
|
||||
unix_toolset=unknown
|
||||
if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
|
||||
# We kind of assume ROOTDIR is where MKS is and it's ok
|
||||
unix_toolset=MKS
|
||||
mkshome=`dosname -s "${ROOTDIR}"`
|
||||
# Utility to convert to short pathnames without spaces
|
||||
dosname="${mkshome}/mksnt/dosname -s"
|
||||
# Most unix utilities are in the mksnt directory of ROOTDIR
|
||||
unixcommand_path="${mkshome}/mksnt"
|
||||
path4sdk="${unixcommand_path}"
|
||||
dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
|
||||
devtools_path="${slashjava}/devtools/win32/bin"
|
||||
path4sdk="${devtools_path};${path4sdk}"
|
||||
# Normally this need not be set, but on Windows it's default is C:/UTILS
|
||||
ALT_DEVTOOLS_PATH="${devtools_path}"
|
||||
export ALT_DEVTOOLS_PATH
|
||||
dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
|
||||
# Find GNU make
|
||||
make="${devtools_path}/gnumake.exe"
|
||||
fileMustExist "${make}" make
|
||||
elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
|
||||
# For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
|
||||
unix_toolset=CYGWIN
|
||||
# Utility to convert to short pathnames without spaces
|
||||
dosname="/usr/bin/cygpath -a -m -s"
|
||||
# Most unix utilities are in the /usr/bin
|
||||
unixcommand_path="/usr/bin"
|
||||
path4sdk="${unixcommand_path}"
|
||||
dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
|
||||
# Find GNU make
|
||||
make="${unixcommand_path}/make.exe"
|
||||
fileMustExist "${make}" make
|
||||
else
|
||||
echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
|
||||
fi
|
||||
|
||||
# WINDOWS: Get the previous JDK to be used to bootstrap the build
|
||||
path4sdk="${bootdir}/bin;${path4sdk}"
|
||||
|
||||
# Ant
|
||||
ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
|
||||
export ANT_HOME
|
||||
antbindir=${ANT_HOME}/bin
|
||||
fileMustExist "${antbindir}/ant" ant
|
||||
path4sdk="${antbindir};${path4sdk}"
|
||||
|
||||
# Turn all \\ into /, remove duplicates and trailing /
|
||||
slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
|
||||
|
||||
# For windows, it's hard to know where the system is, so we just add this
|
||||
# to PATH.
|
||||
path4sdk="${slash_path};${PATH}"
|
||||
|
||||
# Convert path4sdk to cygwin style
|
||||
if [ "${unix_toolset}" = CYGWIN ] ; then
|
||||
path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Export PATH setting
|
||||
PATH="${path4sdk}"
|
||||
export PATH
|
||||
|
||||
# Things we need to unset
|
||||
unset LD_LIBRARY_PATH
|
||||
unset LD_LIBRARY_PATH_32
|
||||
unset LD_LIBRARY_PATH_64
|
||||
unset JAVA_HOME
|
||||
|
55
langtools/make/jprt.properties
Normal file
55
langtools/make/jprt.properties
Normal file
@ -0,0 +1,55 @@
|
||||
#
|
||||
# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# Properties for jprt
|
||||
jprt.tools.default.release=jdk1.7.0
|
||||
|
||||
# Specific platform list
|
||||
jprt.build.platforms=\
|
||||
solaris_sparc_5.10,\
|
||||
solaris_sparcv9_5.10,\
|
||||
solaris_i586_5.10,\
|
||||
solaris_x64_5.10,\
|
||||
linux_i586,\
|
||||
linux_x64,\
|
||||
windows_i586,\
|
||||
windows_x64
|
||||
|
||||
# The different build flavors we want
|
||||
jprt.build.flavors=product
|
||||
|
||||
# Explicitly designate what the 32bit match is for the 64bit build
|
||||
jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
|
||||
jprt.solaris_sparcv9_5.10.build.platform.match32=solaris_sparc_5.10
|
||||
jprt.solaris_x64.build.platform.match32=solaris_i586_5.10
|
||||
jprt.solaris_x64_5.10.build.platform.match32=solaris_i586_5.10
|
||||
|
||||
# Standard list of jprt test targets for this workspace
|
||||
jprt.test.targets=
|
||||
|
||||
# Directories needed to build
|
||||
jprt.bundle.src.dirs=make src
|
||||
jprt.bundle.exclude.src.dirs=build dist
|
||||
|
28
langtools/make/netbeans/README
Normal file
28
langtools/make/netbeans/README
Normal file
@ -0,0 +1,28 @@
|
||||
Working on the "langtools" workspace using NetBeans.
|
||||
|
||||
This directory (make/netbeans) contains NetBeans projects that
|
||||
allow you to work on the various tools using the NetBeans IDE.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use these
|
||||
projects. This is different from other projects in OpenJDK,
|
||||
which requires version 6.0 or later.
|
||||
|
||||
The following projects are provided:
|
||||
|
||||
compiler: for working on the compiler, javac
|
||||
javadoc: for working on the documentation tool, javadoc
|
||||
doclets: for working on the standard doclets used by the
|
||||
documentation tool, javadoc
|
||||
javah: for working on the C header tool, javah
|
||||
javap: for working on the disassembler, javap
|
||||
apt: for working on the annotation processing tool, apt.
|
||||
Note that this is just provided for completeness;
|
||||
the tool has been superceded by new features in javac,
|
||||
and work on apt itself is discouraged.
|
||||
|
||||
However, any tool can be worked on from any project; the only difference
|
||||
between these projects is the behavior of the standard NetBeans actions,
|
||||
so that "Build" in the compiler project will build the compiler, etc.
|
||||
|
||||
|
||||
|
15
langtools/make/netbeans/apt/README
Normal file
15
langtools/make/netbeans/apt/README
Normal file
@ -0,0 +1,15 @@
|
||||
"apt" project README.
|
||||
|
||||
This project is for working on the annotation processing tool (apt)
|
||||
in the OpenJDK langtools component.
|
||||
|
||||
The tool was provided in Java 1.5, but has been superceded by new
|
||||
features in the compiler (javac) in Java 6. apt itself is now
|
||||
deprecated, and any further devlopment on it is strongly discouraged.
|
||||
|
||||
The main class for the tool is com.sun.tools.apt.Main.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
62
langtools/make/netbeans/apt/build.xml
Normal file
62
langtools/make/netbeans/apt/build.xml
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the annotation processing tool, apt.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
This tool is now deprecated, and any further development is strongly
|
||||
discouraged.
|
||||
-->
|
||||
|
||||
<project name="apt" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="apt"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-apt" description="Build the annotation processing tool, apt."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the annotation processing tool, apt."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-apt"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the annotation processing tool, apt."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/apt/nbproject/project.xml
Normal file
108
langtools/make/netbeans/apt/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions-no-javadoc SYSTEM "../../common/standard-ide-actions-no-javadoc.ent">
|
||||
<!ENTITY standard-context-menu-items-no-javadoc SYSTEM "../../common/standard-context-menu-items-no-javadoc.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>apt</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions-no-javadoc;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items-no-javadoc;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
186
langtools/make/netbeans/common/shared.xml
Normal file
186
langtools/make/netbeans/common/shared.xml
Normal file
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
The file contains targets for NetBeans action that are shared across
|
||||
all langtools projects.
|
||||
-->
|
||||
|
||||
<project name="shared" default="build" basedir="../../..">
|
||||
<!--
|
||||
Instead of importing the main build file, we could call it when needed.
|
||||
That would reduce the list of Ant targets that get displayed for this
|
||||
file, but it also complicates the interface between the project build
|
||||
file and the main build file. For example, some imported targets
|
||||
would have to be reclared, properties would have to be restructured,
|
||||
and it would be harder to run results (e.g. in properties) from nested
|
||||
targets.
|
||||
-->
|
||||
<import file="../../build.xml"/>
|
||||
|
||||
<property name="tool.mainclass" value="com.sun.tools.${tool.name}.Main"/>
|
||||
<property name="tool.default.args" value="-version"/>
|
||||
|
||||
<!-- compile a single file -->
|
||||
|
||||
<!-- for compile-single, etc, we might want different targets for
|
||||
javac and not javac, because of bootstrap issues -->
|
||||
<target name="compile-single" depends="build-bootstrap-javac">
|
||||
<fail unless="includes">Must set property 'includes'</fail>
|
||||
<javac fork="true" executable="${build.bootstrap.dir}/bin/javac"
|
||||
srcdir="${src.classes.dir}"
|
||||
destdir="${build.classes.dir}"
|
||||
includes="${includes}"
|
||||
sourcepath=""
|
||||
includeAntRuntime="no"
|
||||
target="${target}"
|
||||
debug="${javac.debug}"
|
||||
debuglevel="${javac.debuglevel}"/>
|
||||
</target>
|
||||
|
||||
<!-- run tool -->
|
||||
|
||||
<target name="run" depends="build,-def-run" description="run ${tool.description}">
|
||||
<run/>
|
||||
</target>
|
||||
|
||||
<!-- run a selected class -->
|
||||
|
||||
<target name="run-single" depends="-def-run">
|
||||
<fail unless="run.classname">Must set property 'run.classname'</fail>
|
||||
<run name="${run.classname}" mainclass="${run.classname}" default.args=""/>
|
||||
</target>
|
||||
|
||||
<!-- run jtreg tests, and display results in NetBeans -->
|
||||
|
||||
<target name="-jtreg-nb" depends="-jtreg" if="netbeans.home" unless="jtreg.passed">
|
||||
<nbbrowse file="${jtreg.report}/report.html"/>
|
||||
<fail>Some tests failed; see report for details.</fail>
|
||||
</target>
|
||||
|
||||
<!-- debug tool in NetBeans -->
|
||||
|
||||
<target name="-debug-nb" depends="build,-def-run,-def-start-debugger" if="netbeans.home">
|
||||
<start-debugger/>
|
||||
<run jpda.jvmargs="${jpda.jvmargs}"/>
|
||||
</target>
|
||||
|
||||
<!-- debug a selected class -->
|
||||
|
||||
<target name="debug-single-nb" depends="-def-start-debugger,-def-run">
|
||||
<fail unless="debug.classname">Must set property 'debug.classname'</fail>
|
||||
<start-debugger/>
|
||||
<run name="${debug.classname}" mainclass="${debug.classname}" default.args=""
|
||||
jpda.jvmargs="${jpda.jvmargs}"/>
|
||||
</target>
|
||||
|
||||
<!-- debug a jtreg test -->
|
||||
|
||||
<target name="debug-jtreg-nb" depends="-def-start-debugger,-def-jtreg">
|
||||
<fail unless="jtreg.tests">Must set property 'jtreg.tests'</fail>
|
||||
<start-debugger/>
|
||||
<jtreg-tool name="${tool.name}" samevm="false" tests="${jtreg.tests}"
|
||||
jpda.jvmargs="${jpda.jvmargs}"/>
|
||||
</target>
|
||||
|
||||
<!-- update a class being debugged -->
|
||||
|
||||
<target name="debug-fix">
|
||||
<fail unless="class">Must set property 'class'</fail>
|
||||
<antcall target="compile-single">
|
||||
<param name="includes" value="${class}.java"/>
|
||||
</antcall>
|
||||
<nbjpdareload>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="${class}.class"/>
|
||||
</fileset>
|
||||
</nbjpdareload>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- create javadoc documentation -->
|
||||
|
||||
<target name="-javadoc-nb" depends="-javadoc" if="netbeans.home">
|
||||
<nbbrowse file="${build.javadoc.dir}/${tool.name}/index.html"/>
|
||||
</target>
|
||||
|
||||
<!-- default target for those projects that don't have public API docs;
|
||||
override as needed for projects with public API docs.-->
|
||||
<target name="-javadoc"/>
|
||||
|
||||
<!-- macro to run a tool or selected class - used by run* and debug* tasks -->
|
||||
|
||||
<target name="-def-run">
|
||||
<macrodef name="run">
|
||||
<attribute name="name" default="${tool.name}"/>
|
||||
<attribute name="mainclass" default="${tool.mainclass}"/>
|
||||
<attribute name="default.args" default="${tool.default.args}"/>
|
||||
<attribute name="jpda.jvmargs" default=""/>
|
||||
<sequential>
|
||||
<input addproperty="run.args" message="Run @{name} with options" defaultvalue="@{default.args}"/>
|
||||
<java fork="true" jvm="${target.java}" classname="@{mainclass}">
|
||||
<bootclasspath>
|
||||
<pathelement location="${build.classes.dir}"/>
|
||||
<pathelement location="${target.java.home}/jre/lib/rt.jar"/>
|
||||
</bootclasspath>
|
||||
<jvmarg line="@{jpda.jvmargs}"/>
|
||||
<arg line="${run.args}"/>
|
||||
</java>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
<!-- macro to start the debugger and set a property containg the args needed by the run task -->
|
||||
|
||||
<target name="-def-start-debugger" if="netbeans.home">
|
||||
<macrodef name="start-debugger">
|
||||
<attribute name="jpda.jvmargs.property" default="jpda.jvmargs"/>
|
||||
<sequential>
|
||||
<nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
|
||||
<bootclasspath>
|
||||
<pathelement location="${build.classes.dir}"/>
|
||||
<pathelement location="${target.java.home}/jre/lib/rt.jar"/>
|
||||
</bootclasspath>
|
||||
<sourcepath>
|
||||
<pathelement location="${src.classes.dir}"/>
|
||||
</sourcepath>
|
||||
</nbjpdastart>
|
||||
<property
|
||||
name="@{jpda.jvmargs.property}"
|
||||
value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"
|
||||
/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</target>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This file defines the actions that will appear on the project's context
|
||||
menu, in the Projects viewer.
|
||||
It is normally included as an entity into a project's project.xml file.
|
||||
|
||||
For information on these actions, see
|
||||
- NetBeans: Setting Up Projects
|
||||
at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
|
||||
- NetBeans: Advanced Freeform Project Configuration
|
||||
at http://www.netbeans.org/kb/41/freeform-config.html
|
||||
-->
|
||||
|
||||
<ide-action name="build"/>
|
||||
<ide-action name="rebuild"/>
|
||||
<ide-action name="clean"/>
|
||||
|
||||
<separator/>
|
||||
|
||||
<ide-action name="run"/>
|
||||
<ide-action name="debug"/>
|
||||
|
||||
<separator/>
|
||||
|
||||
<ide-action name="test"/>
|
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This file defines the actions that will appear on the project's context
|
||||
menu, in the Projects viewer.
|
||||
It is normally included as an entity into a project's project.xml file.
|
||||
|
||||
For information on these actions, see
|
||||
- NetBeans: Setting Up Projects
|
||||
at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
|
||||
- NetBeans: Advanced Freeform Project Configuration
|
||||
at http://www.netbeans.org/kb/41/freeform-config.html
|
||||
-->
|
||||
|
||||
<ide-action name="build"/>
|
||||
<ide-action name="rebuild"/>
|
||||
<ide-action name="clean"/>
|
||||
<ide-action name="javadoc"/>
|
||||
|
||||
<separator/>
|
||||
|
||||
<ide-action name="run"/>
|
||||
<ide-action name="debug"/>
|
||||
|
||||
<separator/>
|
||||
|
||||
<ide-action name="test"/>
|
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This file defines the standard actions accepted by langtools projects.
|
||||
It is normally included as an entity into a project's project.xml file.
|
||||
|
||||
For information on these actions, see
|
||||
- NetBeans: Setting Up Projects
|
||||
at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
|
||||
- NetBeans: Advanced Freeform Project Configuration
|
||||
at http://www.netbeans.org/kb/41/freeform-config.html
|
||||
-->
|
||||
|
||||
<action name="build">
|
||||
<target>build</target>
|
||||
</action>
|
||||
|
||||
<action name="clean">
|
||||
<target>clean</target>
|
||||
</action>
|
||||
|
||||
<action name="rebuild">
|
||||
<target>clean</target>
|
||||
<target>build</target>
|
||||
</action>
|
||||
|
||||
<action name="compile.single">
|
||||
<target>compile-single</target>
|
||||
<property name="srcdir">${root}/src/share/classes</property>
|
||||
<context>
|
||||
<property>includes</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<separated-files>,</separated-files>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="run">
|
||||
<target>run</target>
|
||||
</action>
|
||||
|
||||
<action name="run.single">
|
||||
<target>run-single</target>
|
||||
<context>
|
||||
<property>run.classname</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>java-name</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<!--
|
||||
Note: NetBeans does not appear to support context menu items
|
||||
on shell scripts :-(
|
||||
-->
|
||||
|
||||
<action name="run.single">
|
||||
<target>jtreg</target>
|
||||
<context>
|
||||
<property>jtreg.tests</property>
|
||||
<folder>${root}/test</folder>
|
||||
<pattern>\.(java|sh)$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<separated-files>,</separated-files>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="test">
|
||||
<target>jtreg</target>
|
||||
</action>
|
||||
|
||||
<action name="debug">
|
||||
<target>debug-nb</target>
|
||||
</action>
|
||||
|
||||
<action name="debug.single">
|
||||
<target>debug-single-nb</target>
|
||||
<context>
|
||||
<property>debug.classname</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>java-name</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<!--
|
||||
Note: NetBeans does not appear to support context menu items
|
||||
on shell scripts :-(
|
||||
-->
|
||||
|
||||
<action name="debug.single">
|
||||
<target>debug-jtreg-nb</target>
|
||||
<context>
|
||||
<property>jtreg.tests</property>
|
||||
<folder>${root}/test</folder>
|
||||
<pattern>\.(java|sh)$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="debug.fix">
|
||||
<target>debug-fix</target>
|
||||
<property name="srcdir">${root}/src/share/classes</property>
|
||||
<context>
|
||||
<property>class</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>relative-path-noext</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="javadoc">
|
||||
<target>javadoc-nb</target>
|
||||
</action>
|
161
langtools/make/netbeans/common/standard-ide-actions.ent
Normal file
161
langtools/make/netbeans/common/standard-ide-actions.ent
Normal file
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
This file defines the standard actions accepted by langtools projects.
|
||||
It is normally included as an entity into a project's project.xml file.
|
||||
|
||||
For information on these actions, see
|
||||
- NetBeans: Setting Up Projects
|
||||
at http://www.netbeans.org/kb/55/using-netbeans/project_setup.html
|
||||
- NetBeans: Advanced Freeform Project Configuration
|
||||
at http://www.netbeans.org/kb/41/freeform-config.html
|
||||
-->
|
||||
|
||||
<action name="build">
|
||||
<target>build</target>
|
||||
</action>
|
||||
|
||||
<action name="clean">
|
||||
<target>clean</target>
|
||||
</action>
|
||||
|
||||
<action name="rebuild">
|
||||
<target>clean</target>
|
||||
<target>build</target>
|
||||
</action>
|
||||
|
||||
<action name="compile.single">
|
||||
<target>compile-single</target>
|
||||
<property name="srcdir">${root}/src/share/classes</property>
|
||||
<context>
|
||||
<property>includes</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<separated-files>,</separated-files>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="run">
|
||||
<target>run</target>
|
||||
</action>
|
||||
|
||||
<action name="run.single">
|
||||
<target>run-single</target>
|
||||
<context>
|
||||
<property>run.classname</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>java-name</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<!--
|
||||
Note: NetBeans does not appear to support context menu items
|
||||
on shell scripts :-(
|
||||
-->
|
||||
|
||||
<action name="run.single">
|
||||
<target>jtreg</target>
|
||||
<context>
|
||||
<property>jtreg.tests</property>
|
||||
<folder>${root}/test</folder>
|
||||
<pattern>\.(java|sh)$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<separated-files>,</separated-files>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="test">
|
||||
<target>jtreg</target>
|
||||
</action>
|
||||
|
||||
<action name="debug">
|
||||
<target>debug-nb</target>
|
||||
</action>
|
||||
|
||||
<action name="debug.single">
|
||||
<target>debug-single-nb</target>
|
||||
<context>
|
||||
<property>debug.classname</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>java-name</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<!--
|
||||
Note: NetBeans does not appear to support context menu items
|
||||
on shell scripts :-(
|
||||
-->
|
||||
|
||||
<action name="debug.single">
|
||||
<target>debug-jtreg-nb</target>
|
||||
<context>
|
||||
<property>jtreg.tests</property>
|
||||
<folder>${root}/test</folder>
|
||||
<pattern>\.(java|sh)$</pattern>
|
||||
<format>relative-path</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="debug.fix">
|
||||
<target>debug-fix</target>
|
||||
<property name="srcdir">${root}/src/share/classes</property>
|
||||
<context>
|
||||
<property>class</property>
|
||||
<folder>${root}/src/share/classes</folder>
|
||||
<pattern>\.java$</pattern>
|
||||
<format>relative-path-noext</format>
|
||||
<arity>
|
||||
<one-file-only/>
|
||||
</arity>
|
||||
</context>
|
||||
</action>
|
||||
|
||||
<action name="javadoc">
|
||||
<target>javadoc-nb</target>
|
||||
</action>
|
11
langtools/make/netbeans/compiler/README
Normal file
11
langtools/make/netbeans/compiler/README
Normal file
@ -0,0 +1,11 @@
|
||||
"compiler" project README.
|
||||
|
||||
This project is for working on the compiler tool (javac)
|
||||
in the OpenJDK langtools component.
|
||||
|
||||
The main class for the tool is com.sun.tools.javac.Main.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
63
langtools/make/netbeans/compiler/build.xml
Normal file
63
langtools/make/netbeans/compiler/build.xml
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the compiler.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
-->
|
||||
|
||||
<project name="compiler" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="javac"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-javac" description="Build the compiler."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the compiler."/>
|
||||
|
||||
<target name="-javadoc" depends="javadoc-javac"/>
|
||||
<target name="javadoc" depends="-javadoc-nb" description="Generate javadoc documentation for the compiler."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-javac"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the compiler."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/compiler/nbproject/project.xml
Normal file
108
langtools/make/netbeans/compiler/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions SYSTEM "../../common/standard-ide-actions.ent">
|
||||
<!ENTITY standard-context-menu-items SYSTEM "../../common/standard-context-menu-items.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>compiler</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
16
langtools/make/netbeans/doclets/README
Normal file
16
langtools/make/netbeans/doclets/README
Normal file
@ -0,0 +1,16 @@
|
||||
"doclets" project README.
|
||||
|
||||
This project is for working on the standard doclets used by
|
||||
the documentation tool (javadoc) in the OpenJDK langtools component.
|
||||
|
||||
The doclets are invoked as part of the documentation tool (javadoc).
|
||||
Using this project, you can also browse javadoc and any tools in langtools.
|
||||
If you build the doclets, javadoc will be built automatically as well,
|
||||
if necessary.
|
||||
|
||||
The doclets are found in com.sun.tools.doclets.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
60
langtools/make/netbeans/doclets/build.xml
Normal file
60
langtools/make/netbeans/doclets/build.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the standard doclets used by documentation tool, javadoc.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
-->
|
||||
|
||||
<project name="doclets" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="doclets"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-doclets" description="Build the standard doclets for the documentation tool, javadoc."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the standard doclets for the documentation tool, javadoc."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-doclets"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the standard doclets used by the documentation tool, javadoc."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/doclets/nbproject/project.xml
Normal file
108
langtools/make/netbeans/doclets/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions-no-javadoc SYSTEM "../../common/standard-ide-actions-no-javadoc.ent">
|
||||
<!ENTITY standard-context-menu-items-no-javadoc SYSTEM "../../common/standard-context-menu-items-no-javadoc.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>doclets</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions-no-javadoc;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items-no-javadoc;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
16
langtools/make/netbeans/javadoc/README
Normal file
16
langtools/make/netbeans/javadoc/README
Normal file
@ -0,0 +1,16 @@
|
||||
"javadoc" project README.
|
||||
|
||||
This project is for working on the documentation tool (javadoc)
|
||||
in the OpenJDK langtools component.
|
||||
|
||||
javadoc is built on top of the compiler (javac). Using this
|
||||
project, you can also browse javac and any tools in langtools.
|
||||
If you build javadoc, javac will be built automatically as well,
|
||||
if necessary.
|
||||
|
||||
The main class for the tool is com.sun.tools.javadoc.Main.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
63
langtools/make/netbeans/javadoc/build.xml
Normal file
63
langtools/make/netbeans/javadoc/build.xml
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the documentation tool, javadoc.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
-->
|
||||
|
||||
<project name="javadoc" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="javadoc"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-javadoc" description="Build the documentation tool, javadoc."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the documentation tool, javadoc."/>
|
||||
|
||||
<target name="-javadoc" depends="javadoc-javadoc"/>
|
||||
<target name="javadoc" depends="-javadoc-nb" description="Generate javadoc documentation for the Doclet API."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-javadoc"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the documentation tool, javadoc."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/javadoc/nbproject/project.xml
Normal file
108
langtools/make/netbeans/javadoc/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions SYSTEM "../../common/standard-ide-actions.ent">
|
||||
<!ENTITY standard-context-menu-items SYSTEM "../../common/standard-context-menu-items.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>javadoc</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
21
langtools/make/netbeans/javah/README
Normal file
21
langtools/make/netbeans/javah/README
Normal file
@ -0,0 +1,21 @@
|
||||
"javah" project README.
|
||||
|
||||
This project is for working on the native header tool (javah)
|
||||
in the OpenJDK langtools component.
|
||||
|
||||
javah is built on top of the documentation tool (javadoc). Using this
|
||||
project, you can also browse javadoc and any other tools in langtools.
|
||||
If you build javah, javadoc will be built automatically as well,
|
||||
if necessary.
|
||||
|
||||
javah is in the process of being converted so that it runs directly on
|
||||
top of the compiler, javac, using the annotation processing API,
|
||||
instead of on top of the documentation tool, javadoc, using the
|
||||
Doclet API.
|
||||
|
||||
The main class for the tool is com.sun.tools.javah.Main.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
60
langtools/make/netbeans/javah/build.xml
Normal file
60
langtools/make/netbeans/javah/build.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the native header tool, javah.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
-->
|
||||
|
||||
<project name="javah" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="javah"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-javah" description="Build the native header tool, javah."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the native header tool, javah."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-javah"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the native header tool, javah."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/javah/nbproject/project.xml
Normal file
108
langtools/make/netbeans/javah/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions-no-javadoc SYSTEM "../../common/standard-ide-actions-no-javadoc.ent">
|
||||
<!ENTITY standard-context-menu-items-no-javadoc SYSTEM "../../common/standard-context-menu-items-no-javadoc.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>javah</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions-no-javadoc;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items-no-javadoc;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
11
langtools/make/netbeans/javap/README
Normal file
11
langtools/make/netbeans/javap/README
Normal file
@ -0,0 +1,11 @@
|
||||
"javap" project README.
|
||||
|
||||
This project is for working on the disassembler tool (javap)
|
||||
in the OpenJDK langtools component.
|
||||
|
||||
The main class for the tool is sun.tools.javap.Main.
|
||||
|
||||
NetBeans 5.0 or later is required and sufficient to use this
|
||||
project, and others in the OpenJDK langtools component.
|
||||
This is different from other projects in OpenJDK, which
|
||||
require version 6.0 or later.
|
60
langtools/make/netbeans/javap/build.xml
Normal file
60
langtools/make/netbeans/javap/build.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Build file for the disassembler tool, javap.
|
||||
- The basic functionality of the build is imported from make/build.xml.
|
||||
- Additional support for NetBeans actions is imported from
|
||||
make/netbeans/common/shared.xml.
|
||||
- This file gives the final customizations.
|
||||
-->
|
||||
|
||||
<project name="javap" default="build" basedir="../../..">
|
||||
<property name="tool.name" value="javap"/>
|
||||
|
||||
<import file="../common/shared.xml"/>
|
||||
|
||||
<!--
|
||||
Alias the following imported targets, giving descriptions as appropriate.
|
||||
NetBeans will emphasize targets with descriptions in the Ant Targets list,
|
||||
and will display the targets in the context menu (under Run Target) for
|
||||
this file in the Projects viewer.
|
||||
-->
|
||||
|
||||
<target name="build" depends="build-javap" description="Build the disassembler tool, javap."/>
|
||||
|
||||
<target name="debug" depends="-debug-nb" description="Debug the disassembler tool, javap."/>
|
||||
|
||||
<target name="-jtreg" depends="jtreg-javap"/>
|
||||
<target name="jtreg" depends="-jtreg-nb" description="Run the jtreg tests for the disassembler tool, javap."/>
|
||||
|
||||
</project>
|
108
langtools/make/netbeans/javap/nbproject/project.xml
Normal file
108
langtools/make/netbeans/javap/nbproject/project.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Sun Microsystems nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<!DOCTYPE project [
|
||||
<!ENTITY standard-ide-actions-no-javadoc SYSTEM "../../common/standard-ide-actions-no-javadoc.ent">
|
||||
<!ENTITY standard-context-menu-items-no-javadoc SYSTEM "../../common/standard-context-menu-items-no-javadoc.ent">
|
||||
]>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.ant.freeform</type>
|
||||
<configuration>
|
||||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
||||
<!-- Do not use Project Properties customizer when editing this file manually. -->
|
||||
<name>javap</name>
|
||||
<properties>
|
||||
<property name="root">../../..</property>
|
||||
</properties>
|
||||
<folders>
|
||||
<source-folder>
|
||||
<label>langtools</label>
|
||||
<location>${root}</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Source files</label>
|
||||
<type>java</type>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Test files</label>
|
||||
<type>tests</type>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder>
|
||||
<label>Build files</label>
|
||||
<type>build</type>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
</folders>
|
||||
<ide-actions>
|
||||
&standard-ide-actions-no-javadoc;
|
||||
</ide-actions>
|
||||
<export>
|
||||
<type>folder</type>
|
||||
<location>${root}/build/classes</location>
|
||||
<build-target>build</build-target>
|
||||
</export>
|
||||
<view>
|
||||
<items>
|
||||
<source-folder style="tree">
|
||||
<label>Source files</label>
|
||||
<location>${root}/src/share/classes</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Test files</label>
|
||||
<location>${root}/test</location>
|
||||
</source-folder>
|
||||
<source-folder style="tree">
|
||||
<label>Build files</label>
|
||||
<location>${root}/make</location>
|
||||
</source-folder>
|
||||
<source-file>
|
||||
<label>README</label>
|
||||
<location>README</location>
|
||||
</source-file>
|
||||
</items>
|
||||
<context-menu>
|
||||
&standard-context-menu-items-no-javadoc;
|
||||
</context-menu>
|
||||
</view>
|
||||
<subprojects/>
|
||||
</general-data>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<built-to>${root}/build/classes</built-to>
|
||||
<source-level>1.5</source-level> <!-- FIXME -->
|
||||
</compilation-unit>
|
||||
</java-data>
|
||||
</configuration>
|
||||
</project>
|
19
langtools/make/test/HelloWorld.apt.gold.txt
Normal file
19
langtools/make/test/HelloWorld.apt.gold.txt
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
/**
|
||||
* This class is used to test the results of the langtools build.
|
||||
*/
|
||||
public class HelloWorld {
|
||||
|
||||
public HelloWorld();
|
||||
|
||||
/**
|
||||
* The old standby!
|
||||
* @param args The parameters are ignored.
|
||||
*/
|
||||
public static void main(java.lang.String... args);
|
||||
|
||||
/**
|
||||
* This declaration is for the benefit of javah tests.
|
||||
*/
|
||||
public native void test();
|
||||
}
|
21
langtools/make/test/HelloWorld.gold.h
Normal file
21
langtools/make/test/HelloWorld.gold.h
Normal file
@ -0,0 +1,21 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class HelloWorld */
|
||||
|
||||
#ifndef _Included_HelloWorld
|
||||
#define _Included_HelloWorld
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: HelloWorld
|
||||
* Method: test
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_HelloWorld_test
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
45
langtools/make/test/HelloWorld.java
Normal file
45
langtools/make/test/HelloWorld.java
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
// NOTE: The javadoc comments are used by the apt tests.
|
||||
|
||||
/**
|
||||
* This class is used to test the results of the langtools build.
|
||||
*/
|
||||
public class HelloWorld
|
||||
{
|
||||
/**
|
||||
* The old standby!
|
||||
* @param args The parameters are ignored.
|
||||
*/
|
||||
public static void main(String... args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
|
||||
/**
|
||||
* This declaration is for the benefit of javah tests.
|
||||
*/
|
||||
public native void test();
|
||||
}
|
15
langtools/make/test/HelloWorld.javadoc.gold.txt
Normal file
15
langtools/make/test/HelloWorld.javadoc.gold.txt
Normal file
@ -0,0 +1,15 @@
|
||||
./HelloWorld.html
|
||||
./allclasses-frame.html
|
||||
./allclasses-noframe.html
|
||||
./constant-values.html
|
||||
./deprecated-list.html
|
||||
./help-doc.html
|
||||
./index-all.html
|
||||
./index.html
|
||||
./overview-tree.html
|
||||
./package-frame.html
|
||||
./package-list
|
||||
./package-summary.html
|
||||
./package-tree.html
|
||||
./resources/inherit.gif
|
||||
./stylesheet.css
|
7
langtools/make/test/HelloWorld.javap.gold.txt
Normal file
7
langtools/make/test/HelloWorld.javap.gold.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Compiled from "HelloWorld.java"
|
||||
public class HelloWorld extends java.lang.Object{
|
||||
public HelloWorld();
|
||||
public static void main(java.lang.String[]);
|
||||
public native void test();
|
||||
}
|
||||
|
4
langtools/make/test/README
Normal file
4
langtools/make/test/README
Normal file
@ -0,0 +1,4 @@
|
||||
This is a small quick test suite to (provide a framework to)
|
||||
verify the output of a JDK build of the langtools component.
|
||||
|
||||
It verifies the contents exist and are minimally functional.
|
0
langtools/make/test/TEST.ROOT
Normal file
0
langtools/make/test/TEST.ROOT
Normal file
42
langtools/make/test/bootstrap/javac.sh
Normal file
42
langtools/make/test/bootstrap/javac.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify basic execution of the bootstrap javac compiler.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
${TOPDIR}/dist/bootstrap/bin/javac -d . "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
"${TESTJAVAEXE}" -classpath . HelloWorld > HelloWorld.tmp
|
||||
|
||||
if [ "`cat HelloWorld.tmp`" = "Hello World!" ]; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
43
langtools/make/test/bootstrap/javadoc.sh
Normal file
43
langtools/make/test/bootstrap/javadoc.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the bootstrap javadoc tool.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
|
||||
rm -rf doc
|
||||
mkdir doc
|
||||
${TOPDIR}/dist/bootstrap/bin/javadoc -d doc "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
( cd doc ; find . -type f -print | LANG=C sort) > javadoc.tmp
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.javadoc.gold.txt javadoc.tmp ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
40
langtools/make/test/bootstrap/javah.sh
Normal file
40
langtools/make/test/bootstrap/javah.sh
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the bootstrap javah tool.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
|
||||
${TOPDIR}/dist/bootstrap/bin/javac -d . "${TESTSRC}"/../HelloWorld.java
|
||||
${TOPDIR}/dist/bootstrap/bin/javah -classpath . -d . HelloWorld
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.gold.h HelloWorld.h ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
9
langtools/make/test/contents.gold.txt
Normal file
9
langtools/make/test/contents.gold.txt
Normal file
@ -0,0 +1,9 @@
|
||||
./bootstrap/bin/javac
|
||||
./bootstrap/bin/javadoc
|
||||
./bootstrap/bin/javah
|
||||
./bootstrap/lib/doclets.jar
|
||||
./bootstrap/lib/javac.jar
|
||||
./bootstrap/lib/javadoc.jar
|
||||
./bootstrap/lib/javah.jar
|
||||
./lib/classes.jar
|
||||
./lib/src.zip
|
42
langtools/make/test/contents.sh
Normal file
42
langtools/make/test/contents.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary
|
||||
# Verify the contents of the dist directory by name,
|
||||
# to make sure all necessary files are present.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../..
|
||||
|
||||
( cd ${TOPDIR}/dist ; find . -type f -print | LANG=C sort ) > contents.tmp
|
||||
|
||||
if diff ${TESTSRC}/contents.gold.txt contents.tmp ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
||||
|
42
langtools/make/test/lib/apt.sh
Normal file
42
langtools/make/test/lib/apt.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the apt classes in classes.jar.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.apt.Main \
|
||||
-print "${TESTSRC}"/../HelloWorld.java > apt.tmp
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.apt.gold.txt apt.tmp ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
38
langtools/make/test/lib/classes.gold.txt
Normal file
38
langtools/make/test/lib/classes.gold.txt
Normal file
@ -0,0 +1,38 @@
|
||||
META-INF/MANIFEST.MF
|
||||
com/sun/tools/apt/Main.class
|
||||
com/sun/tools/apt/main/Main.class
|
||||
com/sun/tools/apt/resources/apt.class
|
||||
com/sun/tools/apt/resources/apt_ja.class
|
||||
com/sun/tools/apt/resources/apt_zh_CN.class
|
||||
com/sun/tools/doclets/formats/html/resources/standard.class
|
||||
com/sun/tools/doclets/formats/html/resources/standard_ja.class
|
||||
com/sun/tools/doclets/formats/html/resources/standard_zh_CN.class
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclet.xml
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets.class
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.class
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.class
|
||||
com/sun/tools/doclets/internal/toolkit/resources/inherit.gif
|
||||
com/sun/tools/javac/Main.class
|
||||
com/sun/tools/javac/main/Main.class
|
||||
com/sun/tools/javac/resources/compiler.class
|
||||
com/sun/tools/javac/resources/compiler_ja.class
|
||||
com/sun/tools/javac/resources/compiler_zh_CN.class
|
||||
com/sun/tools/javac/resources/javac.class
|
||||
com/sun/tools/javac/resources/javac_ja.class
|
||||
com/sun/tools/javac/resources/javac_zh_CN.class
|
||||
com/sun/tools/javac/resources/legacy.class
|
||||
com/sun/tools/javac/resources/version.class
|
||||
com/sun/tools/javadoc/Main.class
|
||||
com/sun/tools/javadoc/resources/javadoc.class
|
||||
com/sun/tools/javadoc/resources/javadoc_ja.class
|
||||
com/sun/tools/javadoc/resources/javadoc_zh_CN.class
|
||||
com/sun/tools/javah/Main.class
|
||||
com/sun/tools/javah/resources/Linux_ppc.class
|
||||
com/sun/tools/javah/resources/Linux_sparc.class
|
||||
com/sun/tools/javah/resources/SunOS_sparc.class
|
||||
com/sun/tools/javah/resources/SunOS_sparcv9.class
|
||||
com/sun/tools/javah/resources/l10n.class
|
||||
com/sun/tools/javah/resources/l10n_ja.class
|
||||
com/sun/tools/javah/resources/l10n_zh_CN.class
|
||||
com/sun/tools/javah/resources/win32_x86.class
|
||||
sun/tools/javap/Main.class
|
50
langtools/make/test/lib/classes.sh
Normal file
50
langtools/make/test/lib/classes.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary verify that selected files exist in classes.jar
|
||||
|
||||
# It would be too brittle to check the complete contents of classes.jar,
|
||||
# so instead, we check for the following
|
||||
# - Main classes
|
||||
# - contents of resource directories
|
||||
# - any other non-.class files
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAREXE="${TESTJAVA:+${TESTJAVA}/bin/}jar"
|
||||
|
||||
${TESTJAREXE} -tf ${TOPDIR}/dist/lib/classes.jar | grep -v '/$' > files.lst
|
||||
egrep 'Main\.class$|resources' files.lst > expect1.lst
|
||||
grep -v '.class$' files.lst > expect2.lst
|
||||
|
||||
LANG=C sort -u expect1.lst expect2.lst > expect.lst
|
||||
|
||||
if diff ${TESTSRC}/classes.gold.txt expect.lst ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
44
langtools/make/test/lib/javac.sh
Normal file
44
langtools/make/test/lib/javac.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify basic execution of the javac classes in classes.jar.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.javac.Main \
|
||||
-d . "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
"${TESTJAVAEXE}" -classpath . HelloWorld > HelloWorld.tmp
|
||||
|
||||
if [ "`cat HelloWorld.tmp`" = "Hello World!" ]; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
47
langtools/make/test/lib/javadoc.sh
Normal file
47
langtools/make/test/lib/javadoc.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the javadoc classes in classes.jar.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
rm -rf doc
|
||||
mkdir doc
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.javadoc.Main \
|
||||
-d doc "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
( cd doc ; find . -type f -print | LANG=C sort ) > javadoc.tmp
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.javadoc.gold.txt javadoc.tmp ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
46
langtools/make/test/lib/javah.sh
Normal file
46
langtools/make/test/lib/javah.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the javah classes in classes.jar.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.javac.Main \
|
||||
-d . "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.javah.Main \
|
||||
-classpath . -d . HelloWorld
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.gold.h HelloWorld.h ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
46
langtools/make/test/lib/javap.sh
Normal file
46
langtools/make/test/lib/javap.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary Verify the basic execution of the javap classes in classes.jar.
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java"
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
com.sun.tools.javac.Main \
|
||||
-d . "${TESTSRC}"/../HelloWorld.java
|
||||
|
||||
"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \
|
||||
sun.tools.javap.Main \
|
||||
-classpath . HelloWorld > javap.tmp
|
||||
|
||||
if diff ${TESTSRC}/../HelloWorld.javap.gold.txt javap.tmp ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
53
langtools/make/test/lib/src.gold.txt
Normal file
53
langtools/make/test/lib/src.gold.txt
Normal file
@ -0,0 +1,53 @@
|
||||
com/sun/javadoc/package.html
|
||||
com/sun/mirror/apt/package.html
|
||||
com/sun/mirror/declaration/package.html
|
||||
com/sun/mirror/overview.html
|
||||
com/sun/mirror/type/package.html
|
||||
com/sun/mirror/util/package.html
|
||||
com/sun/tools/apt/Main.java
|
||||
com/sun/tools/apt/main/Main.java
|
||||
com/sun/tools/apt/resources/apt.properties
|
||||
com/sun/tools/apt/resources/apt_ja.properties
|
||||
com/sun/tools/apt/resources/apt_zh_CN.properties
|
||||
com/sun/tools/doclets/formats/html/markup/package.html
|
||||
com/sun/tools/doclets/formats/html/package.html
|
||||
com/sun/tools/doclets/formats/html/resources/standard.properties
|
||||
com/sun/tools/doclets/formats/html/resources/standard_ja.properties
|
||||
com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties
|
||||
com/sun/tools/doclets/internal/toolkit/builders/package.html
|
||||
com/sun/tools/doclets/internal/toolkit/package.html
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclet.xml
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets.properties
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties
|
||||
com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties
|
||||
com/sun/tools/doclets/internal/toolkit/resources/inherit.gif
|
||||
com/sun/tools/doclets/internal/toolkit/taglets/package.html
|
||||
com/sun/tools/doclets/internal/toolkit/util/links/package.html
|
||||
com/sun/tools/doclets/internal/toolkit/util/package.html
|
||||
com/sun/tools/doclets/package.html
|
||||
com/sun/tools/javac/Main.java
|
||||
com/sun/tools/javac/main/Main.java
|
||||
com/sun/tools/javac/resources/compiler.properties
|
||||
com/sun/tools/javac/resources/compiler_ja.properties
|
||||
com/sun/tools/javac/resources/compiler_zh_CN.properties
|
||||
com/sun/tools/javac/resources/javac.properties
|
||||
com/sun/tools/javac/resources/javac_ja.properties
|
||||
com/sun/tools/javac/resources/javac_zh_CN.properties
|
||||
com/sun/tools/javac/resources/legacy.properties
|
||||
com/sun/tools/javac/services/javax.tools.JavaCompilerTool
|
||||
com/sun/tools/javadoc/Main.java
|
||||
com/sun/tools/javadoc/resources/javadoc.properties
|
||||
com/sun/tools/javadoc/resources/javadoc_ja.properties
|
||||
com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
|
||||
com/sun/tools/javah/Main.java
|
||||
com/sun/tools/javah/resources/Linux_ppc.properties
|
||||
com/sun/tools/javah/resources/Linux_sparc.properties
|
||||
com/sun/tools/javah/resources/SunOS_sparc.properties
|
||||
com/sun/tools/javah/resources/SunOS_sparcv9.properties
|
||||
com/sun/tools/javah/resources/l10n.properties
|
||||
com/sun/tools/javah/resources/l10n_ja.properties
|
||||
com/sun/tools/javah/resources/l10n_zh_CN.properties
|
||||
com/sun/tools/javah/resources/win32_x86.properties
|
||||
javax/lang/model/overview.html
|
||||
javax/tools/overview.html
|
||||
sun/tools/javap/Main.java
|
50
langtools/make/test/lib/src.sh
Normal file
50
langtools/make/test/lib/src.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @summary verify that selected files exist in src.zip
|
||||
|
||||
# It would be too brittle to check the complete contents of src.zip,
|
||||
# so instead, we check for the following
|
||||
# - Main classes
|
||||
# - contents of resource directories
|
||||
# - any other non-.class files
|
||||
|
||||
TESTSRC=${TESTSRC:-.}
|
||||
TOPDIR=${TESTSRC}/../../..
|
||||
TESTJAREXE="${TESTJAVA:+${TESTJAVA}/bin/}jar"
|
||||
|
||||
unzip -l ${TOPDIR}/dist/lib/src.zip | awk '{print $4}' | egrep -v '^$|/$|^Name$|-' > files.lst
|
||||
egrep 'Main\.java$|resources' files.lst > expect1.lst
|
||||
grep -v '.java$' files.lst > expect2.lst
|
||||
|
||||
LANG=C sort -u expect1.lst expect2.lst > expect.lst
|
||||
|
||||
if diff ${TESTSRC}/src.gold.txt expect.lst ; then
|
||||
echo "Test passed."
|
||||
else
|
||||
echo "Test failed."
|
||||
exit 1
|
||||
fi
|
403
langtools/make/tools/CompileProperties/CompileProperties.java
Normal file
403
langtools/make/tools/CompileProperties/CompileProperties.java
Normal file
@ -0,0 +1,403 @@
|
||||
/*
|
||||
* Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/** Translates a .properties file into a .java file containing the
|
||||
* definition of a java.util.Properties subclass which can then be
|
||||
* compiled with javac. <P>
|
||||
*
|
||||
* Usage: java CompileProperties [path to .properties file] [path to .java file to be output] [super class]
|
||||
*
|
||||
* Infers the package by looking at the common suffix of the two
|
||||
* inputs, eliminating "classes" from it.
|
||||
*
|
||||
* @author Scott Violet
|
||||
* @author Kenneth Russell
|
||||
*/
|
||||
|
||||
public class CompileProperties {
|
||||
|
||||
public static void main(String[] args) {
|
||||
CompileProperties cp = new CompileProperties();
|
||||
boolean ok = cp.run(args);
|
||||
if ( !ok ) {
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static interface Log {
|
||||
void info(String msg);
|
||||
void verbose(String msg);
|
||||
void error(String msg, Exception e);
|
||||
}
|
||||
|
||||
private String propfiles[];
|
||||
private String outfiles[] ;
|
||||
private String supers[] ;
|
||||
private int compileCount = 0;
|
||||
private boolean quiet = false;
|
||||
private Log log;
|
||||
|
||||
public void setLog(Log log) {
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
public boolean run(String[] args) {
|
||||
if (log == null) {
|
||||
log = new Log() {
|
||||
public void error(String msg, Exception e) {
|
||||
System.err.println("ERROR: CompileProperties: " + msg);
|
||||
if ( e != null ) {
|
||||
System.err.println("EXCEPTION: " + e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void info(String msg) {
|
||||
System.out.println(msg);
|
||||
}
|
||||
public void verbose(String msg) {
|
||||
if (!quiet)
|
||||
System.out.println(msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
boolean ok = true;
|
||||
/* Original usage */
|
||||
if (args.length == 2 && args[0].charAt(0) != '-' ) {
|
||||
ok = createFile(args[0], args[1], "ListResourceBundle");
|
||||
} else if (args.length == 3) {
|
||||
ok = createFile(args[0], args[1], args[2]);
|
||||
} else if (args.length == 0) {
|
||||
usage(log);
|
||||
ok = false;
|
||||
} else {
|
||||
/* New batch usage */
|
||||
ok = parseOptions(args);
|
||||
if ( ok && compileCount == 0 ) {
|
||||
log.error("options parsed but no files to compile", null);
|
||||
ok = false;
|
||||
}
|
||||
/* Need at least one file. */
|
||||
if ( !ok ) {
|
||||
usage(log);
|
||||
} else {
|
||||
/* Process files */
|
||||
for ( int i = 0; i < compileCount && ok ; i++ ) {
|
||||
ok = createFile(propfiles[i], outfiles[i], supers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
private boolean parseOptions(String args[]) {
|
||||
boolean ok = true;
|
||||
if ( compileCount > 0 ) {
|
||||
String new_propfiles[] = new String[compileCount + args.length];
|
||||
String new_outfiles[] = new String[compileCount + args.length];
|
||||
String new_supers[] = new String[compileCount + args.length];
|
||||
System.arraycopy(propfiles, 0, new_propfiles, 0, compileCount);
|
||||
System.arraycopy(outfiles, 0, new_outfiles, 0, compileCount);
|
||||
System.arraycopy(supers, 0, new_supers, 0, compileCount);
|
||||
propfiles = new_propfiles;
|
||||
outfiles = new_outfiles;
|
||||
supers = new_supers;
|
||||
} else {
|
||||
propfiles = new String[args.length];
|
||||
outfiles = new String[args.length];
|
||||
supers = new String[args.length];
|
||||
}
|
||||
|
||||
for ( int i = 0; i < args.length ; i++ ) {
|
||||
if ( "-compile".equals(args[i]) && i+3 < args.length ) {
|
||||
propfiles[compileCount] = args[++i];
|
||||
outfiles[compileCount] = args[++i];
|
||||
supers[compileCount] = args[++i];
|
||||
compileCount++;
|
||||
} else if ( "-optionsfile".equals(args[i]) && i+1 < args.length ) {
|
||||
String filename = args[++i];
|
||||
FileInputStream finput = null;
|
||||
byte contents[] = null;
|
||||
try {
|
||||
finput = new FileInputStream(filename);
|
||||
int byteCount = finput.available();
|
||||
if ( byteCount <= 0 ) {
|
||||
log.error("The -optionsfile file is empty", null);
|
||||
ok = false;
|
||||
} else {
|
||||
contents = new byte[byteCount];
|
||||
int bytesRead = finput.read(contents);
|
||||
if ( byteCount != bytesRead ) {
|
||||
log.error("Cannot read all of -optionsfile file", null);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
} catch ( IOException e ) {
|
||||
log.error("cannot open " + filename, e);
|
||||
ok = false;
|
||||
}
|
||||
if ( finput != null ) {
|
||||
try {
|
||||
finput.close();
|
||||
} catch ( IOException e ) {
|
||||
ok = false;
|
||||
log.error("cannot close " + filename, e);
|
||||
}
|
||||
}
|
||||
if ( ok = true && contents != null ) {
|
||||
String tokens[] = (new String(contents)).split("\\s+");
|
||||
if ( tokens.length > 0 ) {
|
||||
ok = parseOptions(tokens);
|
||||
}
|
||||
}
|
||||
if ( !ok ) {
|
||||
break;
|
||||
}
|
||||
} else if ( "-quiet".equals(args[i]) ) {
|
||||
quiet = true;
|
||||
} else {
|
||||
log.error("argument error", null);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
private boolean createFile(String propertiesPath, String outputPath,
|
||||
String superClass) {
|
||||
boolean ok = true;
|
||||
log.verbose("parsing: " + propertiesPath);
|
||||
Properties p = new Properties();
|
||||
try {
|
||||
p.load(new FileInputStream(propertiesPath));
|
||||
} catch ( FileNotFoundException e ) {
|
||||
ok = false;
|
||||
log.error("Cannot find file " + propertiesPath, e);
|
||||
} catch ( IOException e ) {
|
||||
ok = false;
|
||||
log.error("IO error on file " + propertiesPath, e);
|
||||
}
|
||||
if ( ok ) {
|
||||
String packageName = inferPackageName(propertiesPath, outputPath);
|
||||
log.verbose("inferred package name: " + packageName);
|
||||
List<String> sortedKeys = new ArrayList<String>();
|
||||
for ( Object key : p.keySet() ) {
|
||||
sortedKeys.add((String)key);
|
||||
}
|
||||
Collections.sort(sortedKeys);
|
||||
Iterator keys = sortedKeys.iterator();
|
||||
|
||||
StringBuffer data = new StringBuffer();
|
||||
|
||||
while (keys.hasNext()) {
|
||||
Object key = keys.next();
|
||||
data.append(" { \"" + escape((String)key) + "\", \"" +
|
||||
escape((String)p.get(key)) + "\" },\n");
|
||||
}
|
||||
|
||||
// Get class name from java filename, not the properties filename.
|
||||
// (zh_TW properties might be used to create zh_HK files)
|
||||
File file = new File(outputPath);
|
||||
String name = file.getName();
|
||||
int dotIndex = name.lastIndexOf('.');
|
||||
String className;
|
||||
if (dotIndex == -1) {
|
||||
className = name;
|
||||
} else {
|
||||
className = name.substring(0, dotIndex);
|
||||
}
|
||||
|
||||
String packageString = "";
|
||||
if (packageName != null && !packageName.equals("")) {
|
||||
packageString = "package " + packageName + ";\n\n";
|
||||
}
|
||||
|
||||
Writer writer = null;
|
||||
try {
|
||||
writer = new BufferedWriter(
|
||||
new OutputStreamWriter(new FileOutputStream(outputPath), "8859_1"));
|
||||
MessageFormat format = new MessageFormat(FORMAT);
|
||||
writer.write(format.format(new Object[] { packageString, className, superClass, data }));
|
||||
} catch ( IOException e ) {
|
||||
ok = false;
|
||||
log.error("IO error writing to file " + outputPath, e);
|
||||
}
|
||||
if ( writer != null ) {
|
||||
try {
|
||||
writer.flush();
|
||||
} catch ( IOException e ) {
|
||||
ok = false;
|
||||
log.error("IO error flush " + outputPath, e);
|
||||
}
|
||||
try {
|
||||
writer.close();
|
||||
} catch ( IOException e ) {
|
||||
ok = false;
|
||||
log.error("IO error close " + outputPath, e);
|
||||
}
|
||||
}
|
||||
log.verbose("wrote: " + outputPath);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
private static void usage(Log log) {
|
||||
log.info("usage:");
|
||||
log.info(" java CompileProperties path_to_properties_file path_to_java_output_file [super_class]");
|
||||
log.info(" -OR-");
|
||||
log.info(" java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename");
|
||||
log.info("");
|
||||
log.info("Example:");
|
||||
log.info(" java CompileProperties -compile test.properties test.java ListResourceBundle");
|
||||
log.info(" java CompileProperties -optionsfile option_file");
|
||||
log.info("option_file contains: -compile test.properties test.java ListResourceBundle");
|
||||
}
|
||||
|
||||
private static String escape(String theString) {
|
||||
// This is taken from Properties.saveConvert with changes for Java strings
|
||||
int len = theString.length();
|
||||
StringBuffer outBuffer = new StringBuffer(len*2);
|
||||
|
||||
for(int x=0; x<len; x++) {
|
||||
char aChar = theString.charAt(x);
|
||||
switch(aChar) {
|
||||
case '\\':outBuffer.append('\\'); outBuffer.append('\\');
|
||||
break;
|
||||
case '\t':outBuffer.append('\\'); outBuffer.append('t');
|
||||
break;
|
||||
case '\n':outBuffer.append('\\'); outBuffer.append('n');
|
||||
break;
|
||||
case '\r':outBuffer.append('\\'); outBuffer.append('r');
|
||||
break;
|
||||
case '\f':outBuffer.append('\\'); outBuffer.append('f');
|
||||
break;
|
||||
default:
|
||||
if ((aChar < 0x0020) || (aChar > 0x007e)) {
|
||||
outBuffer.append('\\');
|
||||
outBuffer.append('u');
|
||||
outBuffer.append(toHex((aChar >> 12) & 0xF));
|
||||
outBuffer.append(toHex((aChar >> 8) & 0xF));
|
||||
outBuffer.append(toHex((aChar >> 4) & 0xF));
|
||||
outBuffer.append(toHex( aChar & 0xF));
|
||||
} else {
|
||||
if (specialSaveChars.indexOf(aChar) != -1) {
|
||||
outBuffer.append('\\');
|
||||
}
|
||||
outBuffer.append(aChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
return outBuffer.toString();
|
||||
}
|
||||
|
||||
private static String inferPackageName(String inputPath, String outputPath) {
|
||||
// Normalize file names
|
||||
inputPath = new File(inputPath).getPath();
|
||||
outputPath = new File(outputPath).getPath();
|
||||
// Split into components
|
||||
String sep;
|
||||
if (File.separatorChar == '\\') {
|
||||
sep = "\\\\";
|
||||
} else {
|
||||
sep = File.separator;
|
||||
}
|
||||
String[] inputs = inputPath.split(sep);
|
||||
String[] outputs = outputPath.split(sep);
|
||||
// Match common names, eliminating first "classes" entry from
|
||||
// each if present
|
||||
int inStart = 0;
|
||||
int inEnd = inputs.length - 2;
|
||||
int outEnd = outputs.length - 2;
|
||||
int i = inEnd;
|
||||
int j = outEnd;
|
||||
while (i >= 0 && j >= 0) {
|
||||
if (!inputs[i].equals(outputs[j]) ||
|
||||
(inputs[i].equals("gensrc") && inputs[j].equals("gensrc"))) {
|
||||
++i;
|
||||
++j;
|
||||
break;
|
||||
}
|
||||
--i;
|
||||
--j;
|
||||
}
|
||||
String result;
|
||||
if (i < 0 || j < 0 || i >= inEnd || j >= outEnd) {
|
||||
result = "";
|
||||
} else {
|
||||
if (inputs[i].equals("classes") && outputs[j].equals("classes")) {
|
||||
++i;
|
||||
}
|
||||
inStart = i;
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (i = inStart; i <= inEnd; i++) {
|
||||
buf.append(inputs[i]);
|
||||
if (i < inEnd) {
|
||||
buf.append('.');
|
||||
}
|
||||
}
|
||||
result = buf.toString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static final String FORMAT =
|
||||
"{0}" +
|
||||
"import java.util.ListResourceBundle;\n\n" +
|
||||
"public final class {1} extends {2} '{'\n" +
|
||||
" protected final Object[][] getContents() '{'\n" +
|
||||
" return new Object[][] '{'\n" +
|
||||
"{3}" +
|
||||
" };\n" +
|
||||
" }\n" +
|
||||
"}\n";
|
||||
|
||||
// This comes from Properties
|
||||
private static char toHex(int nibble) {
|
||||
return hexDigit[(nibble & 0xF)];
|
||||
}
|
||||
|
||||
// This comes from Properties
|
||||
private static final char[] hexDigit = {
|
||||
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
};
|
||||
|
||||
// Note: different from that in Properties
|
||||
private static final String specialSaveChars = "\"";
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.apache.tools.ant.DirectoryScanner;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.taskdefs.MatchingTask;
|
||||
|
||||
public class CompilePropertiesTask extends MatchingTask {
|
||||
public void setSrcDir(File srcDir) {
|
||||
this.srcDir = srcDir;
|
||||
}
|
||||
|
||||
public void setDestDir(File destDir) {
|
||||
this.destDir = destDir;
|
||||
}
|
||||
|
||||
public void setSuperclass(String superclass) {
|
||||
this.superclass = superclass;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
CompileProperties.Log log = new CompileProperties.Log() {
|
||||
public void error(String msg, Exception e) {
|
||||
log(msg, Project.MSG_ERR);
|
||||
}
|
||||
public void info(String msg) {
|
||||
log(msg, Project.MSG_INFO);
|
||||
}
|
||||
public void verbose(String msg) {
|
||||
log(msg, Project.MSG_VERBOSE);
|
||||
}
|
||||
};
|
||||
List<String> mainOpts = new ArrayList<String>();
|
||||
int count = 0;
|
||||
DirectoryScanner s = getDirectoryScanner(srcDir);
|
||||
for (String path: s.getIncludedFiles()) {
|
||||
if (path.endsWith(".properties")) {
|
||||
String destPath =
|
||||
path.substring(0, path.length() - ".properties".length()) +
|
||||
".java";
|
||||
File srcFile = new File(srcDir, path);
|
||||
File destFile = new File(destDir, destPath);
|
||||
// Arguably, the comparison in the next line should be ">", not ">="
|
||||
// but that assumes the resolution of the last modified time is fine
|
||||
// grained enough; in practice, it is better to use ">=".
|
||||
if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified())
|
||||
continue;
|
||||
destFile.getParentFile().mkdirs();
|
||||
mainOpts.add("-compile");
|
||||
mainOpts.add(srcFile.getPath());
|
||||
mainOpts.add(destFile.getPath());
|
||||
mainOpts.add(superclass);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (mainOpts.size() > 0) {
|
||||
log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO);
|
||||
CompileProperties cp = new CompileProperties();
|
||||
cp.setLog(log);
|
||||
boolean ok = cp.run((String[])mainOpts.toArray(new String[mainOpts.size()]));
|
||||
if (!ok)
|
||||
throw new BuildException("CompileProperties failed.");
|
||||
}
|
||||
}
|
||||
|
||||
private File srcDir;
|
||||
private File destDir;
|
||||
private String superclass = "java.util.ListResourceBundle";
|
||||
}
|
50
langtools/src/share/bin/launcher.sh-template
Normal file
50
langtools/src/share/bin/launcher.sh-template
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Sun designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Sun in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
# CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
mydir="`dirname $0`"
|
||||
mylib="`dirname $mydir`"/lib
|
||||
|
||||
# By default, put the jar file and its dependencies on the bootclasspath.
|
||||
# This is always required on a Mac, because the system langtools classes
|
||||
# are always on the main class path; in addition, it may be required on
|
||||
# standard versions of JDK (i.e. using rt.jar and tools.jar) because some
|
||||
# langtools interfaces are in rt.jar.
|
||||
# Assume that the jar file being invoked lists all the necessary langtools
|
||||
# jar files in its Class-Path manifest entry, so there is no need to search
|
||||
# dependent jar files for additional dependencies.
|
||||
|
||||
if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
|
||||
cp=`unzip -c $mylib/#PROGRAM#.jar META-INF/MANIFEST.MF |
|
||||
grep "Class-Path:" |
|
||||
sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1:|g'`
|
||||
bcp="$mylib/#PROGRAM#.jar":$cp
|
||||
fi
|
||||
|
||||
# javac currently assumes that assertions are enabled in the launcher
|
||||
ea=-ea:com.sun.tools
|
||||
|
||||
"#TARGET_JAVA#" ${bcp:+-Xbootclasspath/p:"$bcp"} ${ea} -jar "${mydir}"/../lib/#PROGRAM#.jar "$@"
|
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents an annotation.
|
||||
* An annotation associates a value with each element of an annotation type.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AnnotationDesc {
|
||||
|
||||
/**
|
||||
* Returns the annotation type of this annotation.
|
||||
*
|
||||
* @return the annotation type of this annotation.
|
||||
*/
|
||||
AnnotationTypeDoc annotationType();
|
||||
|
||||
/**
|
||||
* Returns this annotation's elements and their values.
|
||||
* Only those explicitly present in the annotation are
|
||||
* included, not those assuming their default values.
|
||||
* Returns an empty array if there are none.
|
||||
*
|
||||
* @return this annotation's elements and their values.
|
||||
*/
|
||||
ElementValuePair[] elementValues();
|
||||
|
||||
|
||||
/**
|
||||
* Represents an association between an annotation type element
|
||||
* and one of its values.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface ElementValuePair {
|
||||
|
||||
/**
|
||||
* Returns the annotation type element.
|
||||
*
|
||||
* @return the annotation type element.
|
||||
*/
|
||||
AnnotationTypeElementDoc element();
|
||||
|
||||
/**
|
||||
* Returns the value associated with the annotation type element.
|
||||
*
|
||||
* @return the value associated with the annotation type element.
|
||||
*/
|
||||
AnnotationValue value();
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents an annotation type.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AnnotationTypeDoc extends ClassDoc {
|
||||
|
||||
/**
|
||||
* Returns the elements of this annotation type.
|
||||
* Returns an empty array if there are none.
|
||||
*
|
||||
* @return the elements of this annotation type.
|
||||
*/
|
||||
AnnotationTypeElementDoc[] elements();
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents an element of an annotation type.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AnnotationTypeElementDoc extends MethodDoc {
|
||||
|
||||
/**
|
||||
* Returns the default value of this element.
|
||||
* Returns null if this element has no default.
|
||||
*
|
||||
* @return the default value of this element.
|
||||
*/
|
||||
AnnotationValue defaultValue();
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a value of an annotation type element.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AnnotationValue {
|
||||
|
||||
/**
|
||||
* Returns the value.
|
||||
* The type of the returned object is one of the following:
|
||||
* <ul><li> a wrapper class for a primitive type
|
||||
* <li> <code>String</code>
|
||||
* <li> <code>Type</code> (representing a class literal)
|
||||
* <li> <code>FieldDoc</code> (representing an enum constant)
|
||||
* <li> <code>AnnotationDesc</code>
|
||||
* <li> <code>AnnotationValue[]</code>
|
||||
* </ul>
|
||||
*
|
||||
* @return the value.
|
||||
*/
|
||||
Object value();
|
||||
|
||||
/**
|
||||
* Returns a string representation of the value.
|
||||
*
|
||||
* @return the text of a Java language annotation value expression
|
||||
* whose value is the value of this element.
|
||||
*/
|
||||
String toString();
|
||||
}
|
340
langtools/src/share/classes/com/sun/javadoc/ClassDoc.java
Normal file
340
langtools/src/share/classes/com/sun/javadoc/ClassDoc.java
Normal file
@ -0,0 +1,340 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a java class or interface and provides access to
|
||||
* information about the class, the class's comment and tags, and the
|
||||
* members of the class. A ClassDoc only exists if it was
|
||||
* processed in this run of javadoc. References to classes
|
||||
* which may or may not have been processed in this run are
|
||||
* referred to using Type (which can be converted to ClassDoc,
|
||||
* if possible).
|
||||
*
|
||||
* @see Type
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Kaiyang Liu (original)
|
||||
* @author Robert Field (rewrite)
|
||||
*/
|
||||
public interface ClassDoc extends ProgramElementDoc, Type {
|
||||
|
||||
/**
|
||||
* Return true if this class is abstract. Return true
|
||||
* for all interfaces.
|
||||
*/
|
||||
boolean isAbstract();
|
||||
|
||||
/**
|
||||
* Return true if this class implements or interface extends
|
||||
* <code>java.io.Serializable</code>.
|
||||
*
|
||||
* Since <code>java.io.Externalizable</code> extends
|
||||
* <code>java.io.Serializable</code>,
|
||||
* Externalizable objects are also Serializable.
|
||||
*/
|
||||
boolean isSerializable();
|
||||
|
||||
/**
|
||||
* Return true if this class implements or interface extends
|
||||
* <code>java.io.Externalizable</code>.
|
||||
*/
|
||||
boolean isExternalizable();
|
||||
|
||||
/**
|
||||
* Return the serialization methods for this class or
|
||||
* interface.
|
||||
*
|
||||
* @return an array of MethodDoc objects that represents
|
||||
* the serialization methods for this class or interface.
|
||||
*/
|
||||
MethodDoc[] serializationMethods();
|
||||
|
||||
/**
|
||||
* Return the Serializable fields of this class or interface.
|
||||
* <p>
|
||||
* Return either a list of default fields documented by
|
||||
* <code>serial</code> tag<br>
|
||||
* or return a single <code>FieldDoc</code> for
|
||||
* <code>serialPersistentField</code> member.
|
||||
* There should be a <code>serialField</code> tag for
|
||||
* each Serializable field defined by an <code>ObjectStreamField</code>
|
||||
* array component of <code>serialPersistentField</code>.
|
||||
*
|
||||
* @return an array of <code>FieldDoc</code> objects for the Serializable
|
||||
* fields of this class or interface.
|
||||
*
|
||||
* @see #definesSerializableFields()
|
||||
* @see SerialFieldTag
|
||||
*/
|
||||
FieldDoc[] serializableFields();
|
||||
|
||||
/**
|
||||
* Return true if Serializable fields are explicitly defined with
|
||||
* the special class member <code>serialPersistentFields</code>.
|
||||
*
|
||||
* @see #serializableFields()
|
||||
* @see SerialFieldTag
|
||||
*/
|
||||
boolean definesSerializableFields();
|
||||
|
||||
/**
|
||||
* Return the superclass of this class. Return null if this is an
|
||||
* interface.
|
||||
*
|
||||
* <p> <i>This method cannot accommodate certain generic type constructs.
|
||||
* The <code>superclassType</code> method should be used instead.</i>
|
||||
*
|
||||
* @return the ClassDoc for the superclass of this class, null if
|
||||
* there is no superclass.
|
||||
* @see #superclassType
|
||||
*/
|
||||
ClassDoc superclass();
|
||||
|
||||
/**
|
||||
* Return the superclass of this class. Return null if this is an
|
||||
* interface. A superclass is represented by either a
|
||||
* <code>ClassDoc</code> or a <code>ParametrizedType</code>.
|
||||
*
|
||||
* @return the superclass of this class, or null if there is no superclass.
|
||||
* @since 1.5
|
||||
*/
|
||||
Type superclassType();
|
||||
|
||||
/**
|
||||
* Test whether this class is a subclass of the specified class.
|
||||
* If this is an interface, return false for all classes except
|
||||
* <code>java.lang.Object</code> (we must keep this unexpected
|
||||
* behavior for compatibility reasons).
|
||||
*
|
||||
* @param cd the candidate superclass.
|
||||
* @return true if cd is a superclass of this class.
|
||||
*/
|
||||
boolean subclassOf(ClassDoc cd);
|
||||
|
||||
/**
|
||||
* Return interfaces implemented by this class or interfaces extended
|
||||
* by this interface. Includes only directly-declared interfaces, not
|
||||
* inherited interfaces.
|
||||
* Return an empty array if there are no interfaces.
|
||||
*
|
||||
* <p> <i>This method cannot accommodate certain generic type constructs.
|
||||
* The <code>interfaceTypes</code> method should be used instead.</i>
|
||||
*
|
||||
* @return an array of ClassDoc objects representing the interfaces.
|
||||
* @see #interfaceTypes
|
||||
*/
|
||||
ClassDoc[] interfaces();
|
||||
|
||||
/**
|
||||
* Return interfaces implemented by this class or interfaces extended
|
||||
* by this interface. Includes only directly-declared interfaces, not
|
||||
* inherited interfaces.
|
||||
* Return an empty array if there are no interfaces.
|
||||
*
|
||||
* @return an array of interfaces, each represented by a
|
||||
* <code>ClassDoc</code> or a <code>ParametrizedType</code>.
|
||||
* @since 1.5
|
||||
*/
|
||||
Type[] interfaceTypes();
|
||||
|
||||
/**
|
||||
* Return the formal type parameters of this class or interface.
|
||||
* Return an empty array if there are none.
|
||||
*
|
||||
* @return the formal type parameters of this class or interface.
|
||||
* @since 1.5
|
||||
*/
|
||||
TypeVariable[] typeParameters();
|
||||
|
||||
/**
|
||||
* Return the type parameter tags of this class or interface.
|
||||
* Return an empty array if there are none.
|
||||
*
|
||||
* @return the type parameter tags of this class or interface.
|
||||
* @since 1.5
|
||||
*/
|
||||
ParamTag[] typeParamTags();
|
||||
|
||||
/**
|
||||
* Return
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* fields in this class or interface.
|
||||
* Excludes enum constants if this is an enum type.
|
||||
*
|
||||
* @return an array of FieldDoc objects representing the included
|
||||
* fields in this class or interface.
|
||||
*/
|
||||
FieldDoc[] fields();
|
||||
|
||||
/**
|
||||
* Return fields in this class or interface, filtered to the specified
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
|
||||
* modifier option</a>.
|
||||
* Excludes enum constants if this is an enum type.
|
||||
*
|
||||
* @param filter Specify true to filter according to the specified access
|
||||
* modifier option.
|
||||
* Specify false to include all fields regardless of
|
||||
* access modifier option.
|
||||
* @return an array of FieldDoc objects representing the included
|
||||
* fields in this class or interface.
|
||||
*/
|
||||
FieldDoc[] fields(boolean filter);
|
||||
|
||||
/**
|
||||
* Return the enum constants if this is an enum type.
|
||||
* Return an empty array if there are no enum constants, or if
|
||||
* this is not an enum type.
|
||||
*
|
||||
* @return the enum constants if this is an enum type.
|
||||
*/
|
||||
FieldDoc[] enumConstants();
|
||||
|
||||
/**
|
||||
* Return
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* methods in this class or interface.
|
||||
* Same as <code>methods(true)</code>.
|
||||
*
|
||||
* @return an array of MethodDoc objects representing the included
|
||||
* methods in this class or interface. Does not include
|
||||
* constructors or annotation type elements.
|
||||
*/
|
||||
MethodDoc[] methods();
|
||||
|
||||
/**
|
||||
* Return methods in this class or interface, filtered to the specified
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
|
||||
* modifier option</a>. Does not include constructors or annotation
|
||||
* type elements.
|
||||
*
|
||||
* @param filter Specify true to filter according to the specified access
|
||||
* modifier option.
|
||||
* Specify false to include all methods regardless of
|
||||
* access modifier option.
|
||||
* @return an array of MethodDoc objects representing the included
|
||||
* methods in this class or interface.
|
||||
*/
|
||||
MethodDoc[] methods(boolean filter);
|
||||
|
||||
/**
|
||||
* Return
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* constructors in this class. An array containing the default
|
||||
* no-arg constructor is returned if no other constructors exist.
|
||||
* Return empty array if this is an interface.
|
||||
*
|
||||
* @return an array of ConstructorDoc objects representing the included
|
||||
* constructors in this class.
|
||||
*/
|
||||
ConstructorDoc[] constructors();
|
||||
|
||||
/**
|
||||
* Return constructors in this class, filtered to the specified
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
|
||||
* modifier option</a>. Return an array containing the default
|
||||
* no-arg constructor if no other constructors exist.
|
||||
*
|
||||
* @param filter Specify true to filter according to the specified access
|
||||
* modifier option.
|
||||
* Specify false to include all constructors regardless of
|
||||
* access modifier option.
|
||||
* @return an array of ConstructorDoc objects representing the included
|
||||
* constructors in this class.
|
||||
*/
|
||||
ConstructorDoc[] constructors(boolean filter);
|
||||
|
||||
|
||||
/**
|
||||
* Return
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* nested classes and interfaces within this class or interface.
|
||||
* This includes both static and non-static nested classes.
|
||||
* (This method should have been named <code>nestedClasses()</code>,
|
||||
* as inner classes are technically non-static.) Anonymous and local classes
|
||||
* or interfaces are not included.
|
||||
*
|
||||
* @return an array of ClassDoc objects representing the included classes
|
||||
* and interfaces defined in this class or interface.
|
||||
*/
|
||||
ClassDoc[] innerClasses();
|
||||
|
||||
/**
|
||||
* Return nested classes and interfaces within this class or interface
|
||||
* filtered to the specified
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
|
||||
* modifier option</a>.
|
||||
* This includes both static and non-static nested classes.
|
||||
* Anonymous and local classes are not included.
|
||||
*
|
||||
* @param filter Specify true to filter according to the specified access
|
||||
* modifier option.
|
||||
* Specify false to include all nested classes regardless of
|
||||
* access modifier option.
|
||||
* @return a filtered array of ClassDoc objects representing the included
|
||||
* classes and interfaces defined in this class or interface.
|
||||
*/
|
||||
ClassDoc[] innerClasses(boolean filter);
|
||||
|
||||
/**
|
||||
* Find the specified class or interface within the context of this class doc.
|
||||
* Search order: 1) qualified name, 2) nested in this class or interface,
|
||||
* 3) in this package, 4) in the class imports, 5) in the package imports.
|
||||
* Return the ClassDoc if found, null if not found.
|
||||
*/
|
||||
ClassDoc findClass(String className);
|
||||
|
||||
/**
|
||||
* Get the list of classes and interfaces declared as imported.
|
||||
* These are called "single-type-import declarations" in the
|
||||
* Java Language Specification.
|
||||
*
|
||||
* @return an array of ClassDoc representing the imported classes.
|
||||
*
|
||||
* @deprecated Import declarations are implementation details that
|
||||
* should not be exposed here. In addition, not all imported
|
||||
* classes are imported through single-type-import declarations.
|
||||
*/
|
||||
@Deprecated
|
||||
ClassDoc[] importedClasses();
|
||||
|
||||
/**
|
||||
* Get the list of packages declared as imported.
|
||||
* These are called "type-import-on-demand declarations" in the
|
||||
* Java Language Specification.
|
||||
*
|
||||
* @return an array of PackageDoc representing the imported packages.
|
||||
*
|
||||
* @deprecated Import declarations are implementation details that
|
||||
* should not be exposed here. In addition, this method's
|
||||
* return type does not allow for all type-import-on-demand
|
||||
* declarations to be returned.
|
||||
*/
|
||||
@Deprecated
|
||||
PackageDoc[] importedPackages();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a constructor of a java class.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface ConstructorDoc extends ExecutableMemberDoc {
|
||||
}
|
265
langtools/src/share/classes/com/sun/javadoc/Doc.java
Normal file
265
langtools/src/share/classes/com/sun/javadoc/Doc.java
Normal file
@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
import java.text.BreakIterator;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents Java language constructs (package, class, constructor,
|
||||
* method, field) which have comments and have been processed by this
|
||||
* run of javadoc. All Doc objects are unique, that is, they
|
||||
* are == comparable.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
* @author Scott Seligman (generics, enums, annotations)
|
||||
*/
|
||||
public interface Doc extends Comparable<Object> {
|
||||
|
||||
/**
|
||||
* Return the text of the comment for this doc item.
|
||||
* Tags have been removed.
|
||||
*/
|
||||
String commentText();
|
||||
|
||||
/**
|
||||
* Return all tags in this Doc item.
|
||||
*
|
||||
* @return an array of {@link Tag} objects containing all tags on
|
||||
* this Doc item.
|
||||
*/
|
||||
Tag[] tags();
|
||||
|
||||
/**
|
||||
* Return tags of the specified {@linkplain Tag#kind() kind} in
|
||||
* this Doc item.
|
||||
*
|
||||
* For example, if 'tagname' has value "@serial", all tags in
|
||||
* this Doc item of kind "@serial" will be returned.
|
||||
*
|
||||
* @param tagname name of the tag kind to search for.
|
||||
* @return an array of Tag containing all tags whose 'kind()'
|
||||
* matches 'tagname'.
|
||||
*/
|
||||
Tag[] tags(String tagname);
|
||||
|
||||
/**
|
||||
* Return the see also tags in this Doc item.
|
||||
*
|
||||
* @return an array of SeeTag containing all @see tags.
|
||||
*/
|
||||
SeeTag[] seeTags();
|
||||
|
||||
/**
|
||||
* Return comment as an array of tags. Includes inline tags
|
||||
* (i.e. {@link <i>reference</i>} tags) but not
|
||||
* block tags.
|
||||
* Each section of plain text is represented as a {@link Tag}
|
||||
* of {@linkplain Tag#kind() kind} "Text".
|
||||
* Inline tags are represented as a {@link SeeTag} of kind "@see"
|
||||
* and name "@link".
|
||||
*
|
||||
* @return an array of {@link Tag}s representing the comment
|
||||
*/
|
||||
Tag[] inlineTags();
|
||||
|
||||
/**
|
||||
* Return the first sentence of the comment as an array of tags.
|
||||
* Includes inline tags
|
||||
* (i.e. {@link <i>reference</i>} tags) but not
|
||||
* block tags.
|
||||
* Each section of plain text is represented as a {@link Tag}
|
||||
* of {@linkplain Tag#kind() kind} "Text".
|
||||
* Inline tags are represented as a {@link SeeTag} of kind "@see"
|
||||
* and name "@link".
|
||||
* <p>
|
||||
* If the locale is English language, the first sentence is
|
||||
* determined by the rules described in the Java Language
|
||||
* Specification (first version): "This sentence ends
|
||||
* at the first period that is followed by a blank, tab, or
|
||||
* line terminator or at the first tagline.", in
|
||||
* addition a line will be terminated by block
|
||||
* HTML tags: <p> </p> <h1>
|
||||
* <h2> <h3> <h4> <h5> <h6>
|
||||
* <hr> <pre> or </pre>.
|
||||
* If the locale is not English, the sentence end will be
|
||||
* determined by
|
||||
* {@link BreakIterator#getSentenceInstance(Locale)}.
|
||||
|
||||
* @return an array of {@link Tag}s representing the
|
||||
* first sentence of the comment
|
||||
*/
|
||||
Tag[] firstSentenceTags();
|
||||
|
||||
/**
|
||||
* Return the full unprocessed text of the comment. Tags
|
||||
* are included as text. Used mainly for store and retrieve
|
||||
* operations like internalization.
|
||||
*/
|
||||
String getRawCommentText();
|
||||
|
||||
/**
|
||||
* Set the full unprocessed text of the comment. Tags
|
||||
* are included as text. Used mainly for store and retrieve
|
||||
* operations like internalization.
|
||||
*/
|
||||
void setRawCommentText(String rawDocumentation);
|
||||
|
||||
/**
|
||||
* Returns the non-qualified name of this Doc item.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Compares this doc object with the specified object for order. Returns a
|
||||
* negative integer, zero, or a positive integer as this doc object is less
|
||||
* than, equal to, or greater than the given object.
|
||||
* <p>
|
||||
* This method satisfies the {@link java.lang.Comparable} interface.
|
||||
*
|
||||
* @param obj the <code>Object</code> to be compared.
|
||||
* @return a negative integer, zero, or a positive integer as this Object
|
||||
* is less than, equal to, or greater than the given Object.
|
||||
* @exception ClassCastException the specified Object's type prevents it
|
||||
* from being compared to this Object.
|
||||
*/
|
||||
int compareTo(Object obj);
|
||||
|
||||
/**
|
||||
* Is this Doc item a field (but not an enum constant)?
|
||||
*
|
||||
* @return true if it represents a field
|
||||
*/
|
||||
boolean isField();
|
||||
|
||||
/**
|
||||
* Is this Doc item an enum constant?
|
||||
*
|
||||
* @return true if it represents an enum constant
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isEnumConstant();
|
||||
|
||||
/**
|
||||
* Is this Doc item a constructor?
|
||||
*
|
||||
* @return true if it represents a constructor
|
||||
*/
|
||||
boolean isConstructor();
|
||||
|
||||
/**
|
||||
* Is this Doc item a method (but not a constructor or annotation
|
||||
* type element)?
|
||||
*
|
||||
* @return true if it represents a method
|
||||
*/
|
||||
boolean isMethod();
|
||||
|
||||
/**
|
||||
* Is this Doc item an annotation type element?
|
||||
*
|
||||
* @return true if it represents an annotation type element
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isAnnotationTypeElement();
|
||||
|
||||
/**
|
||||
* Is this Doc item an interface (but not an annotation type)?
|
||||
*
|
||||
* @return true if it represents an interface
|
||||
*/
|
||||
boolean isInterface();
|
||||
|
||||
/**
|
||||
* Is this Doc item an exception class?
|
||||
*
|
||||
* @return true if it represents an exception
|
||||
*/
|
||||
boolean isException();
|
||||
|
||||
/**
|
||||
* Is this Doc item an error class?
|
||||
*
|
||||
* @return true if it represents a error
|
||||
*/
|
||||
boolean isError();
|
||||
|
||||
/**
|
||||
* Is this Doc item an enum type?
|
||||
*
|
||||
* @return true if it represents an enum type
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isEnum();
|
||||
|
||||
/**
|
||||
* Is this Doc item an annotation type?
|
||||
*
|
||||
* @return true if it represents an annotation type
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isAnnotationType();
|
||||
|
||||
/**
|
||||
* Is this Doc item an
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">ordinary
|
||||
* class</a>?
|
||||
* (i.e. not an interface, annotation type, enum, exception, or error)?
|
||||
*
|
||||
* @return true if it represents an ordinary class
|
||||
*/
|
||||
boolean isOrdinaryClass();
|
||||
|
||||
/**
|
||||
* Is this Doc item a
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">class</a>
|
||||
* (and not an interface or annotation type)?
|
||||
* This includes ordinary classes, enums, errors and exceptions.
|
||||
*
|
||||
* @return true if it represents a class
|
||||
*/
|
||||
boolean isClass();
|
||||
|
||||
/**
|
||||
* Return true if this Doc item is
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* in the result set.
|
||||
*/
|
||||
boolean isIncluded();
|
||||
|
||||
/**
|
||||
* Return the source position of the first line of the
|
||||
* corresponding declaration, or null if
|
||||
* no position is available. A default constructor returns
|
||||
* null because it has no location in the source file.
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
SourcePosition position();
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* This interface provides error, warning and notice printing.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface DocErrorReporter {
|
||||
|
||||
/**
|
||||
* Print error message and increment error count.
|
||||
*
|
||||
* @param msg message to print
|
||||
*/
|
||||
void printError(String msg);
|
||||
|
||||
/**
|
||||
* Print an error message and increment error count.
|
||||
*
|
||||
* @param pos the position item where the error occurs
|
||||
* @param msg message to print
|
||||
* @since 1.4
|
||||
*/
|
||||
void printError(SourcePosition pos, String msg);
|
||||
|
||||
/**
|
||||
* Print warning message and increment warning count.
|
||||
*
|
||||
* @param msg message to print
|
||||
*/
|
||||
void printWarning(String msg);
|
||||
|
||||
/**
|
||||
* Print warning message and increment warning count.
|
||||
*
|
||||
* @param pos the position item where the warning occurs
|
||||
* @param msg message to print
|
||||
* @since 1.4
|
||||
*/
|
||||
void printWarning(SourcePosition pos, String msg);
|
||||
|
||||
/**
|
||||
* Print a message.
|
||||
*
|
||||
* @param msg message to print
|
||||
*/
|
||||
void printNotice(String msg);
|
||||
|
||||
/**
|
||||
* Print a message.
|
||||
*
|
||||
* @param pos the position item where the message occurs
|
||||
* @param msg message to print
|
||||
* @since 1.4
|
||||
*/
|
||||
void printNotice(SourcePosition pos, String msg);
|
||||
}
|
111
langtools/src/share/classes/com/sun/javadoc/Doclet.java
Normal file
111
langtools/src/share/classes/com/sun/javadoc/Doclet.java
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* This is an example of a starting class for a doclet,
|
||||
* showing the entry-point methods. A starting class must
|
||||
* import com.sun.javadoc.* and implement the
|
||||
* <code>start(RootDoc)</code> method, as described in the
|
||||
* <a href="package-summary.html#package_description">package
|
||||
* description</a>. If the doclet takes command line options,
|
||||
* it must also implement <code>optionLength</code> and
|
||||
* <code>validOptions</code>.
|
||||
*
|
||||
* <p> A doclet supporting the language features added since 1.1
|
||||
* (such as generics and annotations) should indicate this
|
||||
* by implementing <code>languageVersion</code>. In the absence of
|
||||
* this the doclet should not invoke any of the Doclet API methods
|
||||
* added since 1.5, and
|
||||
* the results of several other methods are modified so as
|
||||
* to conceal the new constructs (such as type parameters) from
|
||||
* the doclet.
|
||||
*
|
||||
* <p> To start the doclet, pass
|
||||
* <code>-doclet</code> followed by the fully-qualified
|
||||
* name of the starting class on the javadoc tool command line.
|
||||
*/
|
||||
public abstract class Doclet {
|
||||
|
||||
/**
|
||||
* Generate documentation here.
|
||||
* This method is required for all doclets.
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
public static boolean start(RootDoc root) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for doclet-added options. Returns the number of
|
||||
* arguments you must specify on the command line for the
|
||||
* given option. For example, "-d docs" would return 2.
|
||||
* <P>
|
||||
* This method is required if the doclet contains any options.
|
||||
* If this method is missing, Javadoc will print an invalid flag
|
||||
* error for every option.
|
||||
*
|
||||
* @return number of arguments on the command line for an option
|
||||
* including the option name itself. Zero return means
|
||||
* option not known. Negative value means error occurred.
|
||||
*/
|
||||
public static int optionLength(String option) {
|
||||
return 0; // default is option unknown
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that options have the correct arguments.
|
||||
* <P>
|
||||
* This method is not required, but is recommended,
|
||||
* as every option will be considered valid if this method
|
||||
* is not present. It will default gracefully (to true)
|
||||
* if absent.
|
||||
* <P>
|
||||
* Printing option related error messages (using the provided
|
||||
* DocErrorReporter) is the responsibility of this method.
|
||||
*
|
||||
* @return true if the options are valid.
|
||||
*/
|
||||
public static boolean validOptions(String options[][],
|
||||
DocErrorReporter reporter) {
|
||||
return true; // default is options are valid
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version of the Java Programming Language supported
|
||||
* by this doclet.
|
||||
* <p>
|
||||
* This method is required by any doclet supporting a language version
|
||||
* newer than 1.1.
|
||||
*
|
||||
* @return the language version supported by this doclet.
|
||||
* @since 1.5
|
||||
*/
|
||||
public static LanguageVersion languageVersion() {
|
||||
return LanguageVersion.JAVA_1_1;
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a method or constructor of a java class.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface ExecutableMemberDoc extends MemberDoc {
|
||||
|
||||
/**
|
||||
* Return exceptions this method or constructor throws.
|
||||
* If the type of the exception is a type variable, return the
|
||||
* <code>ClassDoc</code> of its erasure.
|
||||
*
|
||||
* <p> <i>The <code>thrownExceptions</code> method cannot
|
||||
* accommodate certain generic type constructs. The
|
||||
* <code>thrownExceptionTypes</code> method should be used
|
||||
* instead.</i>
|
||||
*
|
||||
* @return an array of ClassDoc[] representing the exceptions
|
||||
* thrown by this method.
|
||||
* @see #thrownExceptionTypes
|
||||
*/
|
||||
ClassDoc[] thrownExceptions();
|
||||
|
||||
/**
|
||||
* Return exceptions this method or constructor throws.
|
||||
*
|
||||
* @return an array representing the exceptions thrown by this method.
|
||||
* Each array element is either a <code>ClassDoc</code> or a
|
||||
* <code>TypeVariable</code>.
|
||||
* @since 1.5
|
||||
*/
|
||||
Type[] thrownExceptionTypes();
|
||||
|
||||
/**
|
||||
* Return true if this method is native
|
||||
*/
|
||||
boolean isNative();
|
||||
|
||||
/**
|
||||
* Return true if this method is synchronized
|
||||
*/
|
||||
boolean isSynchronized();
|
||||
|
||||
/**
|
||||
* Return true if this method was declared to take a variable number
|
||||
* of arguments.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public boolean isVarArgs();
|
||||
|
||||
/**
|
||||
* Get argument information.
|
||||
*
|
||||
* @see Parameter
|
||||
*
|
||||
* @return an array of Parameter, one element per argument
|
||||
* in the order the arguments are present.
|
||||
*/
|
||||
Parameter[] parameters();
|
||||
|
||||
/**
|
||||
* Return the throws tags in this method.
|
||||
*
|
||||
* @return an array of ThrowTag containing all <code>@exception</code>
|
||||
* and <code>@throws</code> tags.
|
||||
*/
|
||||
ThrowsTag[] throwsTags();
|
||||
|
||||
/**
|
||||
* Return the param tags in this method, excluding the type
|
||||
* parameter tags.
|
||||
*
|
||||
* @return an array of ParamTag containing all <code>@param</code> tags
|
||||
* corresponding to the parameters of this method.
|
||||
*/
|
||||
ParamTag[] paramTags();
|
||||
|
||||
/**
|
||||
* Return the type parameter tags in this method.
|
||||
*
|
||||
* @return an array of ParamTag containing all <code>@param</code> tags
|
||||
* corresponding to the type parameters of this method.
|
||||
* @since 1.5
|
||||
*/
|
||||
ParamTag[] typeParamTags();
|
||||
|
||||
/**
|
||||
* Get the signature. It is the parameter list, type is qualified.
|
||||
* For instance, for a method <code>mymethod(String x, int y)</code>,
|
||||
* it will return <code>(java.lang.String,int)</code>.
|
||||
*/
|
||||
String signature();
|
||||
|
||||
/**
|
||||
* get flat signature. all types are not qualified.
|
||||
* return a String, which is the flat signiture of this member.
|
||||
* It is the parameter list, type is not qualified.
|
||||
* For instance, for a method <code>mymethod(String x, int y)</code>,
|
||||
* it will return <code>(String, int)</code>.
|
||||
*/
|
||||
String flatSignature();
|
||||
|
||||
/**
|
||||
* Return the formal type parameters of this method or constructor.
|
||||
* Return an empty array if this method or constructor is not generic.
|
||||
*
|
||||
* @return the formal type parameters of this method or constructor.
|
||||
* @since 1.5
|
||||
*/
|
||||
TypeVariable[] typeParameters();
|
||||
}
|
79
langtools/src/share/classes/com/sun/javadoc/FieldDoc.java
Normal file
79
langtools/src/share/classes/com/sun/javadoc/FieldDoc.java
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a field in a java class.
|
||||
*
|
||||
* @see MemberDoc
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface FieldDoc extends MemberDoc {
|
||||
|
||||
/**
|
||||
* Get type of this field.
|
||||
*/
|
||||
Type type();
|
||||
|
||||
/**
|
||||
* Return true if this field is transient
|
||||
*/
|
||||
boolean isTransient();
|
||||
|
||||
/**
|
||||
* Return true if this field is volatile
|
||||
*/
|
||||
boolean isVolatile();
|
||||
|
||||
/**
|
||||
* Return the serialField tags in this FieldDoc item.
|
||||
*
|
||||
* @return an array of <tt>SerialFieldTag</tt> objects containing
|
||||
* all <code>@serialField</code> tags.
|
||||
*/
|
||||
SerialFieldTag[] serialFieldTags();
|
||||
|
||||
/**
|
||||
* Get the value of a constant field.
|
||||
*
|
||||
* @return the value of a constant field. The value is
|
||||
* automatically wrapped in an object if it has a primitive type.
|
||||
* If the field is not constant, returns null.
|
||||
*/
|
||||
Object constantValue();
|
||||
|
||||
/**
|
||||
* Get the value of a constant field.
|
||||
*
|
||||
* @return the text of a Java language expression whose value
|
||||
* is the value of the constant. The expression uses no identifiers
|
||||
* other than primitive literals. If the field is
|
||||
* not constant, returns null.
|
||||
*/
|
||||
String constantValueExpression();
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Java Programming Language version. The constants of this enum
|
||||
* identify the JDK and J2SE releases containing language changes
|
||||
* relevant to doclets.
|
||||
* <p>
|
||||
* All doclets support at least the 1.1 language version.
|
||||
* The first release subsequent to this with language changes
|
||||
* affecting doclets is 1.5.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public enum LanguageVersion {
|
||||
|
||||
/** 1.1 added nested classes and interfaces. */
|
||||
JAVA_1_1,
|
||||
|
||||
/** 1.5 added generic types, annotations, enums, and varArgs. */
|
||||
JAVA_1_5
|
||||
}
|
47
langtools/src/share/classes/com/sun/javadoc/MemberDoc.java
Normal file
47
langtools/src/share/classes/com/sun/javadoc/MemberDoc.java
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 1998 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a member of a java class: field, constructor, or method.
|
||||
* This is an abstract class dealing with information common to
|
||||
* method, constructor and field members. Class members of a class
|
||||
* (innerclasses) are represented instead by ClassDoc.
|
||||
*
|
||||
* @see MethodDoc
|
||||
* @see FieldDoc
|
||||
* @see ClassDoc
|
||||
*
|
||||
* @author Kaiyang Liu (original)
|
||||
* @author Robert Field (rewrite)
|
||||
*/
|
||||
public interface MemberDoc extends ProgramElementDoc {
|
||||
|
||||
/**
|
||||
* Returns true if this member was synthesized by the compiler.
|
||||
*/
|
||||
boolean isSynthetic();
|
||||
}
|
94
langtools/src/share/classes/com/sun/javadoc/MethodDoc.java
Normal file
94
langtools/src/share/classes/com/sun/javadoc/MethodDoc.java
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a method of a java class.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface MethodDoc extends ExecutableMemberDoc {
|
||||
|
||||
/**
|
||||
* Return true if this method is abstract
|
||||
*/
|
||||
boolean isAbstract();
|
||||
|
||||
/**
|
||||
* Get return type.
|
||||
*
|
||||
* @return the return type of this method, null if it
|
||||
* is a constructor.
|
||||
*/
|
||||
Type returnType();
|
||||
|
||||
/**
|
||||
* Return the class containing the method that this method overrides.
|
||||
*
|
||||
* <p> <i>The <code>overriddenClass</code> method cannot
|
||||
* accommodate certain generic type constructs. The
|
||||
* <code>overriddenType</code> method should be used instead.</i>
|
||||
*
|
||||
* @return a ClassDoc representing the superclass
|
||||
* defining a method that this method overrides, or null if
|
||||
* this method does not override.
|
||||
*/
|
||||
ClassDoc overriddenClass();
|
||||
|
||||
/**
|
||||
* Return the type containing the method that this method overrides.
|
||||
* It may be a <code>ClassDoc</code> or a <code>ParameterizedType</code>.
|
||||
*
|
||||
* @return the supertype whose method is overridden, or null if this
|
||||
* method does not override another in a superclass
|
||||
* @since 1.5
|
||||
*/
|
||||
Type overriddenType();
|
||||
|
||||
/**
|
||||
* Return the method that this method overrides.
|
||||
*
|
||||
* @return a MethodDoc representing a method definition
|
||||
* in a superclass this method overrides, null if
|
||||
* this method does not override.
|
||||
*/
|
||||
MethodDoc overriddenMethod();
|
||||
|
||||
/**
|
||||
* Tests whether this method overrides another.
|
||||
* The overridden method may be one declared in a superclass or
|
||||
* a superinterface (unlike {@link #overriddenMethod()}).
|
||||
*
|
||||
* <p> When a non-abstract method overrides an abstract one, it is
|
||||
* also said to <i>implement</i> the other.
|
||||
*
|
||||
* @param meth the other method to examine
|
||||
* @return <tt>true</tt> if this method overrides the other
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean overrides(MethodDoc meth);
|
||||
}
|
129
langtools/src/share/classes/com/sun/javadoc/PackageDoc.java
Normal file
129
langtools/src/share/classes/com/sun/javadoc/PackageDoc.java
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a java package. Provides access to information
|
||||
* about the package, the package's comment and tags, and the
|
||||
* classes in the package.
|
||||
* <p>
|
||||
* Each method whose return type is an array will return an empty
|
||||
* array (never null) when there are no objects in the result.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Kaiyang Liu (original)
|
||||
* @author Robert Field (rewrite)
|
||||
*/
|
||||
public interface PackageDoc extends Doc {
|
||||
|
||||
/**
|
||||
* Get all classes and interfaces in the package, filtered to the specified
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
|
||||
* modifier option</a>.
|
||||
*
|
||||
* @return filtered classes and interfaces in this package
|
||||
* @param filter Specifying true filters according to the specified access
|
||||
* modifier option.
|
||||
* Specifying false includes all classes and interfaces
|
||||
* regardless of access modifier option.
|
||||
* @since 1.4
|
||||
*/
|
||||
ClassDoc[] allClasses(boolean filter);
|
||||
|
||||
/**
|
||||
* Get all
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
|
||||
* classes and interfaces in the package. Same as allClasses(true).
|
||||
*
|
||||
* @return all included classes and interfaces in this package.
|
||||
*/
|
||||
ClassDoc[] allClasses();
|
||||
|
||||
/**
|
||||
* Get included
|
||||
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">ordinary</a>
|
||||
* classes (that is, exclude exceptions, errors, enums, interfaces, and
|
||||
* annotation types)
|
||||
* in this package.
|
||||
*
|
||||
* @return included ordinary classes in this package.
|
||||
*/
|
||||
ClassDoc[] ordinaryClasses();
|
||||
|
||||
/**
|
||||
* Get included Exception classes in this package.
|
||||
*
|
||||
* @return included Exceptions in this package.
|
||||
*/
|
||||
ClassDoc[] exceptions();
|
||||
|
||||
/**
|
||||
* Get included Error classes in this package.
|
||||
*
|
||||
* @return included Errors in this package.
|
||||
*/
|
||||
ClassDoc[] errors();
|
||||
|
||||
/**
|
||||
* Get included enum types in this package.
|
||||
*
|
||||
* @return included enum types in this package.
|
||||
* @since 1.5
|
||||
*/
|
||||
ClassDoc[] enums();
|
||||
|
||||
/**
|
||||
* Get included interfaces in this package, omitting annotation types.
|
||||
*
|
||||
* @return included interfaces in this package.
|
||||
*/
|
||||
ClassDoc[] interfaces();
|
||||
|
||||
/**
|
||||
* Get included annotation types in this package.
|
||||
*
|
||||
* @return included annotation types in this package.
|
||||
* @since 1.5
|
||||
*/
|
||||
AnnotationTypeDoc[] annotationTypes();
|
||||
|
||||
/**
|
||||
* Get the annotations of this package.
|
||||
* Return an empty array if there are none.
|
||||
*
|
||||
* @return the annotations of this package.
|
||||
* @since 1.5
|
||||
*/
|
||||
AnnotationDesc[] annotations();
|
||||
|
||||
/**
|
||||
* Lookup a class or interface within this package.
|
||||
*
|
||||
* @return ClassDoc of found class or interface,
|
||||
* or null if not found.
|
||||
*/
|
||||
ClassDoc findClass(String className);
|
||||
}
|
67
langtools/src/share/classes/com/sun/javadoc/ParamTag.java
Normal file
67
langtools/src/share/classes/com/sun/javadoc/ParamTag.java
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents an @param documentation tag.
|
||||
* Stores the name and comment parts of the parameter tag.
|
||||
* An @param tag may represent either a method or constructor parameter,
|
||||
* or a type parameter.
|
||||
*
|
||||
* @author Robert Field
|
||||
*
|
||||
*/
|
||||
public interface ParamTag extends Tag {
|
||||
|
||||
/**
|
||||
* Return the name of the parameter or type parameter
|
||||
* associated with this <code>ParamTag</code>.
|
||||
* The angle brackets delimiting a type parameter are not part of
|
||||
* its name.
|
||||
*
|
||||
* @return the parameter name.
|
||||
*/
|
||||
String parameterName();
|
||||
|
||||
/**
|
||||
* Return the parameter comment
|
||||
* associated with this <code>ParamTag</code>.
|
||||
*
|
||||
* @return the parameter comment.
|
||||
*/
|
||||
String parameterComment();
|
||||
|
||||
/**
|
||||
* Return true if this <code>ParamTag</code> corresponds to a type
|
||||
* parameter. Return false if it corresponds to an ordinary parameter
|
||||
* of a method or constructor.
|
||||
*
|
||||
* @return true if this <code>ParamTag</code> corresponds to a type
|
||||
* parameter.
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isTypeParameter();
|
||||
}
|
74
langtools/src/share/classes/com/sun/javadoc/Parameter.java
Normal file
74
langtools/src/share/classes/com/sun/javadoc/Parameter.java
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Parameter information.
|
||||
* This includes a parameter type and parameter name.
|
||||
*
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface Parameter {
|
||||
|
||||
/**
|
||||
* Get the type of this parameter.
|
||||
*/
|
||||
Type type();
|
||||
|
||||
/**
|
||||
* Get local name of this parameter.
|
||||
* For example if parameter is the short 'index', returns "index".
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Get type name of this parameter.
|
||||
* For example if parameter is the short 'index', returns "short".
|
||||
* <p>
|
||||
* This method returns a complete string
|
||||
* representation of the type, including the dimensions of arrays and
|
||||
* the type arguments of parameterized types. Names are qualified.
|
||||
*/
|
||||
String typeName();
|
||||
|
||||
/**
|
||||
* Returns a string representation of the parameter.
|
||||
* <p>
|
||||
* For example if parameter is the short 'index', returns "short index".
|
||||
*
|
||||
* @return type and parameter name of this parameter.
|
||||
*/
|
||||
String toString();
|
||||
|
||||
/**
|
||||
* Get the annotations of this parameter.
|
||||
* Return an empty array if there are none.
|
||||
*
|
||||
* @return the annotations of this parameter.
|
||||
* @since 1.5
|
||||
*/
|
||||
AnnotationDesc[] annotations();
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents an invocation of a generic class or interface. For example,
|
||||
* given the generic interface {@code List<E>}, possible invocations
|
||||
* include:
|
||||
* <pre>
|
||||
* {@code List<String>}
|
||||
* {@code List<T extends Number>}
|
||||
* {@code List<?>}
|
||||
* </pre>
|
||||
* A generic inner class {@code Outer<T>.Inner<S>} might be invoked as:
|
||||
* <pre>
|
||||
* {@code Outer<Number>.Inner<String>}
|
||||
* </pre>
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface ParameterizedType extends Type {
|
||||
|
||||
/**
|
||||
* Return the generic class or interface that declared this type.
|
||||
*
|
||||
* @return the generic class or interface that declared this type.
|
||||
*/
|
||||
ClassDoc asClassDoc();
|
||||
|
||||
/**
|
||||
* Return the actual type arguments of this type.
|
||||
* For a generic type that is nested within some other generic type
|
||||
* (such as {@code Outer<T>.Inner<S>}),
|
||||
* only the type arguments of the innermost type are included.
|
||||
*
|
||||
* @return the actual type arguments of this type.
|
||||
*/
|
||||
Type[] typeArguments();
|
||||
|
||||
/**
|
||||
* Return the class type that is a direct supertype of this one.
|
||||
* This is the superclass of this type's declaring class,
|
||||
* with type arguments substituted in.
|
||||
* Return null if this is an interface type.
|
||||
*
|
||||
* <p> For example, if this parameterized type is
|
||||
* {@code java.util.ArrayList<String>}, the result will be
|
||||
* {@code java.util.AbstractList<String>}.
|
||||
*
|
||||
* @return the class type that is a direct supertype of this one.
|
||||
*/
|
||||
Type superclassType();
|
||||
|
||||
/**
|
||||
* Return the interface types directly implemented by or extended by this
|
||||
* parameterized type.
|
||||
* These are the interfaces directly implemented or extended
|
||||
* by this type's declaring class or interface,
|
||||
* with type arguments substituted in.
|
||||
* Return an empty array if there are no interfaces.
|
||||
*
|
||||
* <p> For example, the interface extended by
|
||||
* {@code java.util.Set<String>} is {@code java.util.Collection<String>}.
|
||||
*
|
||||
* @return the interface types directly implemented by or extended by this
|
||||
* parameterized type.
|
||||
*/
|
||||
Type[] interfaceTypes();
|
||||
|
||||
/**
|
||||
* Return the type that contains this type as a member.
|
||||
* Return null is this is a top-level type.
|
||||
*
|
||||
* <p> For example, the containing type of
|
||||
* {@code AnInterface.Nested<Number>} is the <code>ClassDoc</code>
|
||||
* representing {@code AnInterface}, and the containing type of
|
||||
* {@code Outer<String>.Inner<Number>} is the
|
||||
* <code>ParameterizedType</code> representing {@code Outer<String>}.
|
||||
*
|
||||
* @return the type that contains this type as a member.
|
||||
*/
|
||||
Type containingType();
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a java program element: class, interface, field,
|
||||
* constructor, or method.
|
||||
* This is an abstract class dealing with information common to
|
||||
* these elements.
|
||||
*
|
||||
* @see MemberDoc
|
||||
* @see ClassDoc
|
||||
*
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface ProgramElementDoc extends Doc {
|
||||
|
||||
/**
|
||||
* Get the containing class or interface of this program element.
|
||||
*
|
||||
* @return a ClassDoc for this element's containing class or interface.
|
||||
* If this is a top-level class or interface, return null.
|
||||
*/
|
||||
ClassDoc containingClass();
|
||||
|
||||
/**
|
||||
* Get the package that this program element is contained in.
|
||||
*
|
||||
* @return a PackageDoc for this element containing package.
|
||||
* If in the unnamed package, this PackageDoc will have the
|
||||
* name "".
|
||||
*/
|
||||
PackageDoc containingPackage();
|
||||
|
||||
/**
|
||||
* Get the fully qualified name of this program element.
|
||||
* For example, for the class <code>java.util.Hashtable</code>,
|
||||
* return "java.util.Hashtable".
|
||||
* <p>
|
||||
* For the method <code>bar()</code> in class <code>Foo</code>
|
||||
* in the unnamed package, return "Foo.bar".
|
||||
*
|
||||
* @return the qualified name of the program element as a String.
|
||||
*/
|
||||
String qualifiedName();
|
||||
|
||||
/**
|
||||
* Get the modifier specifier integer.
|
||||
*
|
||||
* @see java.lang.reflect.Modifier
|
||||
*/
|
||||
int modifierSpecifier();
|
||||
|
||||
/**
|
||||
* Get modifiers string.
|
||||
* For example, for:
|
||||
* <pre>
|
||||
* public abstract int foo() { ... }
|
||||
* </pre>
|
||||
* return "public abstract".
|
||||
* Annotations are not included.
|
||||
*/
|
||||
String modifiers();
|
||||
|
||||
/**
|
||||
* Get the annotations of this program element.
|
||||
* Return an empty array if there are none.
|
||||
*
|
||||
* @return the annotations of this program element.
|
||||
* @since 1.5
|
||||
*/
|
||||
AnnotationDesc[] annotations();
|
||||
|
||||
/**
|
||||
* Return true if this program element is public.
|
||||
*/
|
||||
boolean isPublic();
|
||||
|
||||
/**
|
||||
* Return true if this program element is protected.
|
||||
*/
|
||||
boolean isProtected();
|
||||
|
||||
/**
|
||||
* Return true if this program element is private.
|
||||
*/
|
||||
boolean isPrivate();
|
||||
|
||||
/**
|
||||
* Return true if this program element is package private.
|
||||
*/
|
||||
boolean isPackagePrivate();
|
||||
/**
|
||||
* Return true if this program element is static.
|
||||
*/
|
||||
boolean isStatic();
|
||||
|
||||
/**
|
||||
* Return true if this program element is final.
|
||||
*/
|
||||
boolean isFinal();
|
||||
}
|
109
langtools/src/share/classes/com/sun/javadoc/RootDoc.java
Normal file
109
langtools/src/share/classes/com/sun/javadoc/RootDoc.java
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents the root of the program structure information
|
||||
* for one run of javadoc. From this root all other program
|
||||
* structure information can be extracted.
|
||||
* Also represents the command line information -- the
|
||||
* packages, classes and options specified by the user.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Robert Field
|
||||
*/
|
||||
public interface RootDoc extends Doc, DocErrorReporter {
|
||||
|
||||
/**
|
||||
* Command line options.
|
||||
* <p>
|
||||
* For example, given:
|
||||
* <pre>
|
||||
* javadoc -foo this that -bar other ...</pre>
|
||||
*
|
||||
* this method will return:
|
||||
* <pre>
|
||||
* options()[0][0] = "-foo"
|
||||
* options()[0][1] = "this"
|
||||
* options()[0][2] = "that"
|
||||
* options()[1][0] = "-bar"
|
||||
* options()[1][1] = "other"</pre>
|
||||
*
|
||||
* @return an array of arrays of String.
|
||||
*/
|
||||
String[][] options();
|
||||
|
||||
/**
|
||||
* Return the packages
|
||||
* <a href="package-summary.html#included">specified</a>
|
||||
* on the command line.
|
||||
* If <code>-subpackages</code> and <code>-exclude</code> options
|
||||
* are used, return all the non-excluded packages.
|
||||
*
|
||||
* @return packages specified on the command line.
|
||||
*/
|
||||
PackageDoc[] specifiedPackages();
|
||||
|
||||
/**
|
||||
* Return the classes and interfaces
|
||||
* <a href="package-summary.html#included">specified</a>
|
||||
* as source file names on the command line.
|
||||
*
|
||||
* @return classes and interfaces specified on the command line.
|
||||
*/
|
||||
ClassDoc[] specifiedClasses();
|
||||
|
||||
/**
|
||||
* Return the
|
||||
* <a href="package-summary.html#included">included</a>
|
||||
classes and interfaces in all packages.
|
||||
*
|
||||
* @return included classes and interfaces in all packages.
|
||||
*/
|
||||
ClassDoc[] classes();
|
||||
|
||||
/**
|
||||
* Return a PackageDoc for the specified package name.
|
||||
*
|
||||
* @param name package name
|
||||
*
|
||||
* @return a PackageDoc holding the specified package, null if
|
||||
* this package is not referenced.
|
||||
*/
|
||||
PackageDoc packageNamed(String name);
|
||||
|
||||
/**
|
||||
* Return a ClassDoc for the specified class or interface name.
|
||||
*
|
||||
* @param qualifiedName
|
||||
* <a href="package-summary.html#qualified">qualified</a>
|
||||
* class or package name
|
||||
*
|
||||
* @return a ClassDoc holding the specified class, null if
|
||||
* this class is not referenced.
|
||||
*/
|
||||
ClassDoc classNamed(String qualifiedName);
|
||||
}
|
126
langtools/src/share/classes/com/sun/javadoc/SeeTag.java
Normal file
126
langtools/src/share/classes/com/sun/javadoc/SeeTag.java
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a user-defined cross-reference to related documentation.
|
||||
* The tag can reference a package, class or member, or can hold
|
||||
* plain text. (The plain text might be a reference
|
||||
* to something not online, such as a printed book, or be a hard-coded
|
||||
* HTML link.) The reference can either be inline with the comment,
|
||||
* using <code>{@link}</code>, or a separate block comment,
|
||||
* using <code>@see</code>.
|
||||
* Method <code>name()</code> returns "@link" (no curly braces) or
|
||||
* "@see", depending on the tag.
|
||||
* Method <code>kind()</code> returns "@see" for both tags.
|
||||
*
|
||||
* @author Kaiyang Liu (original)
|
||||
* @author Robert Field (rewrite)
|
||||
* @author Atul M Dambalkar
|
||||
*
|
||||
*/
|
||||
public interface SeeTag extends Tag {
|
||||
|
||||
/**
|
||||
* Get the label of the <code>@see</code> tag.
|
||||
* Return null if no label is present.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see String#trim() the trim method</code>
|
||||
* </p>
|
||||
* return "the trim method".
|
||||
*/
|
||||
String label();
|
||||
|
||||
/**
|
||||
* Get the package doc when <code>@see</code> references only a package.
|
||||
* Return null if the package cannot be found, or if
|
||||
* <code>@see</code> references any other element (class,
|
||||
* interface, field, constructor, method) or non-element.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see java.lang</code>
|
||||
* </p>
|
||||
* return the <code>PackageDoc</code> for <code>java.lang</code>.
|
||||
*/
|
||||
public PackageDoc referencedPackage();
|
||||
|
||||
/**
|
||||
* Get the class or interface name of the <code>@see</code> reference.
|
||||
* The name is fully qualified if the name specified in the
|
||||
* original <code>@see</code> tag was fully qualified, or if the class
|
||||
* or interface can be found; otherwise it is unqualified.
|
||||
* If <code>@see</code> references only a package name, then return
|
||||
* the package name instead.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see String#valueOf(java.lang.Object)</code>
|
||||
* </p>
|
||||
* return "java.lang.String".
|
||||
* For "<code>@see java.lang</code>", return "java.lang".
|
||||
* Return null if <code>@see</code> references a non-element, such as
|
||||
* <code>@see <a href="java.sun.com"></code>.
|
||||
*/
|
||||
String referencedClassName();
|
||||
|
||||
/**
|
||||
* Get the class doc referenced by the class name part of @see.
|
||||
* Return null if the class cannot be found.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see String#valueOf(java.lang.Object)</code>
|
||||
* </p>
|
||||
* return the <code>ClassDoc</code> for <code>java.lang.String</code>.
|
||||
*/
|
||||
ClassDoc referencedClass();
|
||||
|
||||
/**
|
||||
* Get the field, constructor or method substring of the <code>@see</code>
|
||||
* reference. Return null if the reference is to any other
|
||||
* element or to any non-element.
|
||||
* References to member classes (nested classes) return null.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see String#startsWith(String)</code>
|
||||
* </p>
|
||||
* return "startsWith(String)".
|
||||
*/
|
||||
String referencedMemberName();
|
||||
|
||||
/**
|
||||
* Get the member doc for the field, constructor or method
|
||||
* referenced by <code>@see</code>. Return null if the member cannot
|
||||
* be found or if the reference is to any other element or to any
|
||||
* non-element.
|
||||
* References to member classes (nested classes) return null.
|
||||
* For example, for:
|
||||
* <p>
|
||||
* <code>@see String#startsWith(java.lang.String)</code>
|
||||
* </p>
|
||||
* return the <code>MethodDoc</code> for <code>startsWith</code>.
|
||||
*/
|
||||
MemberDoc referencedMember();
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Documents a Serializable field defined by an ObjectStreamField.
|
||||
* <pre>
|
||||
* The class parses and stores the three serialField tag parameters:
|
||||
*
|
||||
* - field name
|
||||
* - field type name
|
||||
* (fully-qualified or visible from the current import context)
|
||||
* - description of the valid values for the field
|
||||
|
||||
* </pre>
|
||||
* This tag is only allowed in the javadoc for the special member
|
||||
* serialPersistentFields.
|
||||
*
|
||||
* @author Joe Fialli
|
||||
*
|
||||
* @see java.io.ObjectStreamField
|
||||
*/
|
||||
public interface SerialFieldTag extends Tag, Comparable<Object> {
|
||||
|
||||
/**
|
||||
* Return the serialziable field name.
|
||||
*/
|
||||
public String fieldName();
|
||||
|
||||
/**
|
||||
* Return the field type string.
|
||||
*/
|
||||
public String fieldType();
|
||||
|
||||
/**
|
||||
* Return the ClassDoc for field type.
|
||||
*
|
||||
* @return null if no ClassDoc for field type is visible from
|
||||
* containingClass context.
|
||||
*/
|
||||
public ClassDoc fieldTypeDoc();
|
||||
|
||||
/**
|
||||
* Return the field comment. If there is no serialField comment, return
|
||||
* javadoc comment of corresponding FieldDoc.
|
||||
*/
|
||||
public String description();
|
||||
|
||||
/**
|
||||
* Compares this Object with the specified Object for order. Returns a
|
||||
* negative integer, zero, or a positive integer as this Object is less
|
||||
* than, equal to, or greater than the given Object.
|
||||
* <p>
|
||||
* Included to make SerialFieldTag items java.lang.Comparable.
|
||||
*
|
||||
* @param obj the <code>Object</code> to be compared.
|
||||
* @return a negative integer, zero, or a positive integer as this Object
|
||||
* is less than, equal to, or greater than the given Object.
|
||||
* @exception ClassCastException the specified Object's type prevents it
|
||||
* from being compared to this Object.
|
||||
* @since 1.2
|
||||
*/
|
||||
public int compareTo(Object obj);
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* This interface describes a source position: filename, line number,
|
||||
* and column number.
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Neal M Gafter
|
||||
*/
|
||||
public interface SourcePosition {
|
||||
/** The source file. Returns null if no file information is
|
||||
* available. */
|
||||
File file();
|
||||
|
||||
/** The line in the source file. The first line is numbered 1;
|
||||
* 0 means no line number information is available. */
|
||||
int line();
|
||||
|
||||
/** The column in the source file. The first column is
|
||||
* numbered 1; 0 means no column information is available.
|
||||
* Columns count characters in the input stream; a tab
|
||||
* advances the column number to the next 8-column tab stop.
|
||||
*/
|
||||
int column();
|
||||
|
||||
/** Convert the source position to the form "Filename:line". */
|
||||
String toString();
|
||||
}
|
158
langtools/src/share/classes/com/sun/javadoc/Tag.java
Normal file
158
langtools/src/share/classes/com/sun/javadoc/Tag.java
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
import java.text.BreakIterator;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents a simple documentation tag, such as @since, @author, @version.
|
||||
* Given a tag (e.g. "@since 1.2"), holds tag name (e.g. "@since")
|
||||
* and tag text (e.g. "1.2"). Tags with structure or which require
|
||||
* special processing are handled by subclasses such as ParamTag
|
||||
* (for @param), SeeTag (for @see and {@link}), and ThrowsTag
|
||||
* (for @throws).
|
||||
*
|
||||
* @author Robert Field
|
||||
* @author Atul M Dambalkar
|
||||
* @see SeeTag
|
||||
* @see ParamTag
|
||||
* @see ThrowsTag
|
||||
* @see SerialFieldTag
|
||||
* @see Doc#tags()
|
||||
*
|
||||
*/
|
||||
public interface Tag {
|
||||
|
||||
/**
|
||||
* Return the name of this tag. The name is the string
|
||||
* starting with "@" that is used in a doc comment, such as
|
||||
* <code>@return</code>. For inline tags, such as
|
||||
* <code>{@link}</code>, the curly brackets
|
||||
* are not part of the name, so in this example the name
|
||||
* would be simply <code>@link</code>.
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Return the containing {@link Doc} of this Tag element.
|
||||
*/
|
||||
Doc holder();
|
||||
|
||||
/**
|
||||
* Return the kind of this tag.
|
||||
* similar or synonymous tags. For most tags,
|
||||
* <code>kind() == name()</code>;
|
||||
* the following table lists those cases where there is more
|
||||
* than one tag of a given kind:
|
||||
* <p>
|
||||
* <table border="1" cellpadding="4" cellspacing="0">
|
||||
* <tr><th><tt> kind() </th> <th><tt> name() </th></tr>
|
||||
* <tr><td><tt> @throws </td> <td><tt> @throws </td></tr>
|
||||
* <tr><td><tt> @throws </td> <td><tt> @exception </td></tr>
|
||||
* <tr><td><tt> @see </td> <td><tt> @see </td></tr>
|
||||
* <tr><td><tt> @see </td> <td><tt> @link </td></tr>
|
||||
* <tr><td><tt> @see </td> <td><tt> @linkplain </td></tr>
|
||||
* <tr><td><tt> @serial </td> <td><tt> @serial </td></tr>
|
||||
* <tr><td><tt> @serial </td> <td><tt> @serialData </td></tr>
|
||||
* </table>
|
||||
*/
|
||||
String kind();
|
||||
|
||||
/**
|
||||
* Return the text of this tag, that is, portion beyond tag name.
|
||||
*/
|
||||
String text();
|
||||
|
||||
/**
|
||||
* Convert this object to a string.
|
||||
*/
|
||||
String toString();
|
||||
|
||||
/**
|
||||
* For a documentation comment with embedded <code>{@link}</code>
|
||||
* tags, return an array of <code>Tag</code> objects. The entire
|
||||
* doc comment is broken down into strings separated by
|
||||
* <code>{@link}</code> tags, where each successive element
|
||||
* of the array represents either a string or
|
||||
* <code>{@link}</code> tag, in order, from start to end.
|
||||
* Each string is represented by a <code>Tag</code> object of
|
||||
* name "Text", where {@link #text()} returns the string. Each
|
||||
* <code>{@link}</code> tag is represented by a
|
||||
* {@link SeeTag} of name "@link" and kind "@see".
|
||||
* For example, given the following comment
|
||||
* tag:
|
||||
* <p>
|
||||
* <code>This is a {@link Doc commentlabel} example.</code>
|
||||
* <p>
|
||||
* return an array of Tag objects:
|
||||
* <ul>
|
||||
* <li> tags[0] is a {@link Tag} with name "Text" and text consisting
|
||||
* of "This is a "
|
||||
* <li> tags[1] is a {@link SeeTag} with name "@link", referenced
|
||||
* class <code>Doc</code> and label "commentlabel"
|
||||
* <li> tags[2] is a {@link Tag} with name "Text" and text consisting
|
||||
* of " example."
|
||||
* </ul>
|
||||
*
|
||||
* @return Tag[] array of tags
|
||||
* @see ParamTag
|
||||
* @see ThrowsTag
|
||||
*/
|
||||
Tag[] inlineTags();
|
||||
|
||||
/**
|
||||
* Return the first sentence of the comment as an array of tags.
|
||||
* Includes inline tags
|
||||
* (i.e. {@link <i>reference</i>} tags) but not
|
||||
* block tags.
|
||||
* Each section of plain text is represented as a {@link Tag}
|
||||
* of kind "Text".
|
||||
* Inline tags are represented as a {@link SeeTag} of kind "@link".
|
||||
* If the locale is English language, the first sentence is
|
||||
* determined by the rules described in the Java Language
|
||||
* Specification (first version): "This sentence ends
|
||||
* at the first period that is followed by a blank, tab, or
|
||||
* line terminator or at the first tagline.", in
|
||||
* addition a line will be terminated by paragraph and
|
||||
* section terminating HTML tags: <p> </p> <h1>
|
||||
* <h2> <h3> <h4> <h5> <h6>
|
||||
* <hr> <pre> or </pre>.
|
||||
* If the locale is not English, the sentence end will be
|
||||
* determined by
|
||||
* {@link BreakIterator#getSentenceInstance(Locale)}.
|
||||
*
|
||||
* @return an array of {@link Tag} objects representing the
|
||||
* first sentence of the comment
|
||||
*/
|
||||
Tag[] firstSentenceTags();
|
||||
|
||||
/**
|
||||
* Return the source position of this tag.
|
||||
* @return the source position of this tag.
|
||||
*/
|
||||
public SourcePosition position();
|
||||
}
|
79
langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java
Normal file
79
langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a @throws or @exception documentation tag.
|
||||
* Parses and holds the exception name and exception comment.
|
||||
* Note: @exception is a backwards compatible synonymy for @throws.
|
||||
*
|
||||
* @author Robert Field
|
||||
* @author Atul M Dambalkar
|
||||
* @see ExecutableMemberDoc#throwsTags()
|
||||
*
|
||||
*/
|
||||
public interface ThrowsTag extends Tag {
|
||||
|
||||
/**
|
||||
* Return the name of the exception
|
||||
* associated with this <code>ThrowsTag</code>.
|
||||
*
|
||||
* @return name of the exception.
|
||||
*/
|
||||
String exceptionName();
|
||||
|
||||
/**
|
||||
* Return the exception comment
|
||||
* associated with this <code>ThrowsTag</code>.
|
||||
*
|
||||
* @return exception comment.
|
||||
*/
|
||||
String exceptionComment();
|
||||
|
||||
/**
|
||||
* Return a <code>ClassDoc</code> that represents the exception.
|
||||
* If the type of the exception is a type variable, return the
|
||||
* <code>ClassDoc</code> of its erasure.
|
||||
*
|
||||
* <p> <i>This method cannot accommodate certain generic type
|
||||
* constructs. The <code>exceptionType</code> method
|
||||
* should be used instead.</i>
|
||||
*
|
||||
* @return <code>ClassDoc</code> that represents the exception.
|
||||
* @see #exceptionType
|
||||
*/
|
||||
ClassDoc exception();
|
||||
|
||||
/**
|
||||
* Return the type of the exception
|
||||
* associated with this <code>ThrowsTag</code>.
|
||||
* This may be a <code>ClassDoc</code> or a <code>TypeVariable</code>.
|
||||
*
|
||||
* @return the type of the exception.
|
||||
* @since 1.5
|
||||
*/
|
||||
Type exceptionType();
|
||||
}
|
153
langtools/src/share/classes/com/sun/javadoc/Type.java
Normal file
153
langtools/src/share/classes/com/sun/javadoc/Type.java
Normal file
@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
/**
|
||||
* Represents a type. A type can be a class or interface, an
|
||||
* invocation (like {@code List<String>}) of a generic class or interface,
|
||||
* a type variable, a wildcard type ("<code>?</code>"),
|
||||
* or a primitive data type (like <code>char</code>).
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Kaiyang Liu (original)
|
||||
* @author Robert Field (rewrite)
|
||||
* @author Scott Seligman (generics)
|
||||
*/
|
||||
public interface Type {
|
||||
|
||||
/**
|
||||
* Return unqualified name of type excluding any dimension information.
|
||||
* <p>
|
||||
* For example, a two dimensional array of String returns
|
||||
* "<code>String</code>".
|
||||
*/
|
||||
String typeName();
|
||||
|
||||
/**
|
||||
* Return qualified name of type excluding any dimension information.
|
||||
*<p>
|
||||
* For example, a two dimensional array of String
|
||||
* returns "<code>java.lang.String</code>".
|
||||
*/
|
||||
String qualifiedTypeName();
|
||||
|
||||
/**
|
||||
* Return the simple name of this type excluding any dimension information.
|
||||
* This is the unqualified name of the type, except that for nested types
|
||||
* only the identifier of the innermost type is included.
|
||||
* <p>
|
||||
* For example, the class {@code Outer.Inner} returns
|
||||
* "<code>Inner</code>".
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
String simpleTypeName();
|
||||
|
||||
/**
|
||||
* Return the type's dimension information, as a string.
|
||||
* <p>
|
||||
* For example, a two dimensional array of String returns
|
||||
* "<code>[][]</code>".
|
||||
*/
|
||||
String dimension();
|
||||
|
||||
/**
|
||||
* Return a string representation of the type.
|
||||
* This includes any dimension information and type arguments.
|
||||
* <p>
|
||||
* For example, a two dimensional array of String may return
|
||||
* "<code>java.lang.String[][]</code>",
|
||||
* and the parameterized type {@code List<Integer>} may return
|
||||
* "{@code java.util.List<java.lang.Integer>}".
|
||||
*
|
||||
* @return a string representation of the type.
|
||||
*/
|
||||
String toString();
|
||||
|
||||
/**
|
||||
* Return true if this type represents a primitive type.
|
||||
*
|
||||
* @return true if this type represents a primitive type.
|
||||
* @since 1.5
|
||||
*/
|
||||
boolean isPrimitive();
|
||||
|
||||
/**
|
||||
* Return this type as a <code>ClassDoc</code> if it represents a class
|
||||
* or interface. Array dimensions are ignored.
|
||||
* If this type is a <code>ParameterizedType</code>,
|
||||
* <code>TypeVariable</code>, or <code>WildcardType</code>, return
|
||||
* the <code>ClassDoc</code> of the type's erasure. If this is an
|
||||
* <code>AnnotationTypeDoc</code>, return this as a <code>ClassDoc</code>
|
||||
* (but see {@link #asAnnotationTypeDoc()}).
|
||||
* If this is a primitive type, return null.
|
||||
*
|
||||
* @return the <code>ClassDoc</code> of this type,
|
||||
* or null if it is a primitive type.
|
||||
*/
|
||||
ClassDoc asClassDoc();
|
||||
|
||||
/**
|
||||
* Return this type as a <code>ParameterizedType</code> if it represents
|
||||
* an invocation of a generic class or interface. Array dimensions
|
||||
* are ignored.
|
||||
*
|
||||
* @return a <code>ParameterizedType</code> if the type is an
|
||||
* invocation of a generic type, or null if it is not.
|
||||
* @since 1.5
|
||||
*/
|
||||
ParameterizedType asParameterizedType();
|
||||
|
||||
/**
|
||||
* Return this type as a <code>TypeVariable</code> if it represents
|
||||
* a type variable. Array dimensions are ignored.
|
||||
*
|
||||
* @return a <code>TypeVariable</code> if the type is a type variable,
|
||||
* or null if it is not.
|
||||
* @since 1.5
|
||||
*/
|
||||
TypeVariable asTypeVariable();
|
||||
|
||||
/**
|
||||
* Return this type as a <code>WildcardType</code> if it represents
|
||||
* a wildcard type.
|
||||
*
|
||||
* @return a <code>WildcardType</code> if the type is a wildcard type,
|
||||
* or null if it is not.
|
||||
* @since 1.5
|
||||
*/
|
||||
WildcardType asWildcardType();
|
||||
|
||||
/**
|
||||
* Return this type as an <code>AnnotationTypeDoc</code> if it represents
|
||||
* an annotation type. Array dimensions are ignored.
|
||||
*
|
||||
* @return an <code>AnnotationTypeDoc</code> if the type is an annotation
|
||||
* type, or null if it is not.
|
||||
* @since 1.5
|
||||
*/
|
||||
AnnotationTypeDoc asAnnotationTypeDoc();
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a type variable.
|
||||
* For example, the generic interface {@code List<E>} has a single
|
||||
* type variable {@code E}.
|
||||
* A type variable may have explicit bounds, as in
|
||||
* {@code C<R extends Remote>}.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface TypeVariable extends Type {
|
||||
|
||||
/**
|
||||
* Return the bounds of this type variable.
|
||||
* These are the types given by the <i>extends</i> clause.
|
||||
* Return an empty array if there are no explicit bounds.
|
||||
*
|
||||
* @return the bounds of this type variable.
|
||||
*/
|
||||
Type[] bounds();
|
||||
|
||||
/**
|
||||
* Return the class, interface, method, or constructor within
|
||||
* which this type variable is declared.
|
||||
*
|
||||
* @return the class, interface, method, or constructor within
|
||||
* which this type variable is declared.
|
||||
*/
|
||||
ProgramElementDoc owner();
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.javadoc;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a wildcard type argument.
|
||||
* Examples include: <pre>
|
||||
* {@code <?>}
|
||||
* {@code <? extends E>}
|
||||
* {@code <? super T>}
|
||||
* </pre>
|
||||
* A wildcard type can have explicit <i>extends</i> bounds
|
||||
* or explicit <i>super</i> bounds or neither, but not both.
|
||||
*
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface WildcardType extends Type {
|
||||
|
||||
/**
|
||||
* Return the upper bounds of this wildcard type argument
|
||||
* as given by the <i>extends</i> clause.
|
||||
* Return an empty array if no such bounds are explicitly given.
|
||||
*
|
||||
* @return the extends bounds of this wildcard type argument
|
||||
*/
|
||||
Type[] extendsBounds();
|
||||
|
||||
/**
|
||||
* Return the lower bounds of this wildcard type argument
|
||||
* as given by the <i>super</i> clause.
|
||||
* Return an empty array if no such bounds are explicitly given.
|
||||
*
|
||||
* @return the super bounds of this wildcard type argument
|
||||
*/
|
||||
Type[] superBounds();
|
||||
}
|
152
langtools/src/share/classes/com/sun/javadoc/package.html
Normal file
152
langtools/src/share/classes/com/sun/javadoc/package.html
Normal file
@ -0,0 +1,152 @@
|
||||
<html>
|
||||
<head>
|
||||
<TITLE>Doclet API Package</TITLE>
|
||||
<!--
|
||||
|
||||
Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Sun designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Sun in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
have any questions.
|
||||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
The Doclet API (also called the Javadoc API) provides a mechanism
|
||||
for clients to inspect the source-level structure of programs and
|
||||
libraries, including javadoc comments embedded in the source.
|
||||
This is useful for documentation, program checking, automatic
|
||||
code generation and many other tools.
|
||||
<p>
|
||||
|
||||
Doclets are invoked by javadoc and use this API to write out
|
||||
program information to files. For example, the standard doclet is called
|
||||
by default and writes out documentation to HTML files.
|
||||
<p>
|
||||
|
||||
The invocation is defined by the abstract {@link com.sun.javadoc.Doclet} class
|
||||
-- the entry point is the {@link com.sun.javadoc.Doclet#start(RootDoc) start} method:
|
||||
<pre>
|
||||
public static boolean <b>start</b>(RootDoc root)
|
||||
</pre>
|
||||
The {@link com.sun.javadoc.RootDoc} instance holds the root of the program structure
|
||||
information. From this root all other program structure
|
||||
information can be extracted.
|
||||
<p>
|
||||
|
||||
<a name="terminology"></a>
|
||||
<h3>Terminology</h3>
|
||||
|
||||
<a name="included"></a>
|
||||
When calling javadoc, you pass in package names and source file names --
|
||||
these are called the <em>specified</em> packages and classes.
|
||||
You also pass in Javadoc options; the <em>access control</em> Javadoc options
|
||||
(<code>-public</code>, <code>-protected</code>, <code>-package</code>,
|
||||
and <code>-private</code>) filter program elements, producing a
|
||||
result set, called the <em>included</em> set, or "documented" set.
|
||||
(The unfiltered set is also available through
|
||||
{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.)
|
||||
<p>
|
||||
|
||||
<a name="class"></a>
|
||||
Throughout this API, the term <em>class</em> is normally a
|
||||
shorthand for "class or interface", as in: {@link com.sun.javadoc.ClassDoc},
|
||||
{@link com.sun.javadoc.PackageDoc#allClasses() allClasses()}, and
|
||||
{@link com.sun.javadoc.PackageDoc#findClass(String) findClass(String)}.
|
||||
In only a couple of other places, it means "class, as opposed to interface",
|
||||
as in: {@link com.sun.javadoc.Doc#isClass()}.
|
||||
In the second sense, this API calls out four kinds of classes:
|
||||
{@linkplain com.sun.javadoc.Doc#isOrdinaryClass() ordinary classes},
|
||||
{@linkplain com.sun.javadoc.Doc#isEnum() enums},
|
||||
{@linkplain com.sun.javadoc.Doc#isError() errors} and
|
||||
{@linkplain com.sun.javadoc.Doc#isException() exceptions}.
|
||||
Throughout the API, the detailed description of each program element
|
||||
describes explicitly which meaning is being used.
|
||||
<p>
|
||||
|
||||
<a name="qualified"></a>
|
||||
A <em>qualified</em> class or interface name is one that has its package
|
||||
name prepended to it, such as <code>java.lang.String</code>. A non-qualified
|
||||
name has no package name, such as <code>String</code>.
|
||||
<p>
|
||||
|
||||
<a name="example"></a>
|
||||
<h3>Example</h3>
|
||||
|
||||
The following is an example doclet that
|
||||
displays information in the <code>@param</code> tags of the processed
|
||||
classes:
|
||||
<pre>
|
||||
import com.sun.javadoc.*;
|
||||
|
||||
public class ListParams extends <font color=red title="Doclet API">Doclet</font> {
|
||||
|
||||
public static boolean start(<font color=red title="Doclet API">RootDoc</font> root) {
|
||||
<font color=red title="Doclet API">ClassDoc</font>[] classes = root.<font color=red title="Doclet API">classes</font>();
|
||||
for (int i = 0; i < classes.length; ++i) {
|
||||
<font color=red title="Doclet API">ClassDoc</font> cd = classes[i];
|
||||
printMembers(cd.<font color=red title="Doclet API">constructors</font>());
|
||||
printMembers(cd.<font color=red title="Doclet API">methods</font>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void printMembers(<font color=red title="Doclet API">ExecutableMemberDoc</font>[] mems) {
|
||||
for (int i = 0; i < mems.length; ++i) {
|
||||
<font color=red title="Doclet API">ParamTag</font>[] params = mems[i].<font color=red title="Doclet API">paramTags</font>();
|
||||
System.out.println(mems[i].<font color=red title="Doclet API">qualifiedName</font>());
|
||||
for (int j = 0; j < params.length; ++j) {
|
||||
System.out.println(" " + params[j].<font color=red title="Doclet API">parameterName</font>()
|
||||
+ " - " + params[j].<font color=red title="Doclet API">parameterComment</font>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
Interfaces and methods from the Javadoc API are marked in
|
||||
<font color=red title="Doclet API">red</font>.
|
||||
{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies
|
||||
the invocation interface for doclets,
|
||||
{@link com.sun.javadoc.Doclet Doclet} holds class or interface information,
|
||||
{@link com.sun.javadoc.ExecutableMemberDoc} is a
|
||||
superinterface of {@link com.sun.javadoc.MethodDoc} and
|
||||
{@link com.sun.javadoc.ConstructorDoc},
|
||||
and {@link com.sun.javadoc.ParamTag} holds information
|
||||
from "<code>@param</code>" tags.
|
||||
<p>
|
||||
This doclet when invoked with a command line like:
|
||||
<pre>
|
||||
javadoc -doclet ListParams -sourcepath <source-location> java.util
|
||||
</pre>
|
||||
producing output like:
|
||||
<pre>
|
||||
...
|
||||
java.util.ArrayList.add
|
||||
index - index at which the specified element is to be inserted.
|
||||
element - element to be inserted.
|
||||
java.util.ArrayList.remove
|
||||
index - the index of the element to removed.
|
||||
...
|
||||
|
||||
</pre>
|
||||
@see com.sun.javadoc.Doclet
|
||||
@see com.sun.javadoc.RootDoc
|
||||
</BODY>
|
||||
</HTML>
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
/**
|
||||
* An annotation processor, used to examine and process the
|
||||
* annotations of program elements. An annotation processor may,
|
||||
* for example, create new source files and XML documents to be used
|
||||
* in conjunction with the original code.
|
||||
*
|
||||
* <p> An annotation processor is constructed by a
|
||||
* {@linkplain AnnotationProcessorFactory factory}, which provides it with an
|
||||
* {@linkplain AnnotationProcessorEnvironment environment} that
|
||||
* encapsulates the state it needs.
|
||||
* Messages regarding warnings and errors encountered during processing
|
||||
* should be directed to the environment's {@link Messager},
|
||||
* and new files may be created using the environment's {@link Filer}.
|
||||
*
|
||||
* <p> Each annotation processor is created to process annotations
|
||||
* of a particular annotation type or set of annotation types.
|
||||
* It may use its environment to find the program elements with
|
||||
* annotations of those types. It may freely examine any other program
|
||||
* elements in the course of its processing.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
public interface AnnotationProcessor {
|
||||
|
||||
/**
|
||||
* Process all program elements supported by this annotation processor.
|
||||
*/
|
||||
void process();
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.mirror.declaration.*;
|
||||
import com.sun.mirror.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The environment encapsulating the state needed by an annotation processor.
|
||||
* An annotation processing tool makes this environment available
|
||||
* to all annotation processors.
|
||||
*
|
||||
* <p> When an annotation processing tool is invoked, it is given a
|
||||
* set of type declarations on which to operate. These
|
||||
* are refered to as the <i>specified</i> types.
|
||||
* The type declarations said to be <i>included</i> in this invocation
|
||||
* consist of the specified types and any types nested within them.
|
||||
*
|
||||
* <p> {@link DeclarationFilter}
|
||||
* provides a simple way to select just the items of interest
|
||||
* when a method returns a collection of declarations.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
public interface AnnotationProcessorEnvironment {
|
||||
|
||||
/**
|
||||
* Returns the options passed to the annotation processing tool.
|
||||
* Options are returned in the form of a map from option name
|
||||
* (such as <tt>"-encoding"</tt>) to option value.
|
||||
* For an option with no value (such as <tt>"-help"</tt>), the
|
||||
* corresponding value in the map is <tt>null</tt>.
|
||||
*
|
||||
* <p> Options beginning with <tt>"-A"</tt> are <i>processor-specific.</i>
|
||||
* Such options are unrecognized by the tool, but intended to be used by
|
||||
* some annotation processor.
|
||||
*
|
||||
* @return the options passed to the tool
|
||||
*/
|
||||
Map<String,String> getOptions();
|
||||
|
||||
/**
|
||||
* Returns the messager used to report errors, warnings, and other
|
||||
* notices.
|
||||
*
|
||||
* @return the messager
|
||||
*/
|
||||
Messager getMessager();
|
||||
|
||||
/**
|
||||
* Returns the filer used to create new source, class, or auxiliary
|
||||
* files.
|
||||
*
|
||||
* @return the filer
|
||||
*/
|
||||
Filer getFiler();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the declarations of the types specified when the
|
||||
* annotation processing tool was invoked.
|
||||
*
|
||||
* @return the types specified when the tool was invoked, or an
|
||||
* empty collection if there were none
|
||||
*/
|
||||
Collection<TypeDeclaration> getSpecifiedTypeDeclarations();
|
||||
|
||||
/**
|
||||
* Returns the declaration of a package given its fully qualified name.
|
||||
*
|
||||
* @param name fully qualified package name, or "" for the unnamed package
|
||||
* @return the declaration of the named package, or null if it cannot
|
||||
* be found
|
||||
*/
|
||||
PackageDeclaration getPackage(String name);
|
||||
|
||||
/**
|
||||
* Returns the declaration of a type given its fully qualified name.
|
||||
*
|
||||
* @param name fully qualified type name
|
||||
* @return the declaration of the named type, or null if it cannot be
|
||||
* found
|
||||
*/
|
||||
TypeDeclaration getTypeDeclaration(String name);
|
||||
|
||||
/**
|
||||
* A convenience method that returns the declarations of the types
|
||||
* {@linkplain AnnotationProcessorEnvironment <i>included</i>}
|
||||
* in this invocation of the annotation processing tool.
|
||||
*
|
||||
* @return the declarations of the types included in this invocation
|
||||
* of the tool, or an empty collection if there are none
|
||||
*/
|
||||
Collection<TypeDeclaration> getTypeDeclarations();
|
||||
|
||||
/**
|
||||
* Returns the declarations annotated with the given annotation type.
|
||||
* Only declarations of the types
|
||||
* {@linkplain AnnotationProcessorEnvironment <i>included</i>}
|
||||
* in this invocation of the annotation processing tool, or
|
||||
* declarations of members, parameters, or type parameters
|
||||
* declared within those, are returned.
|
||||
*
|
||||
* @param a annotation type being requested
|
||||
* @return the declarations annotated with the given annotation type,
|
||||
* or an empty collection if there are none
|
||||
*/
|
||||
Collection<Declaration> getDeclarationsAnnotatedWith(
|
||||
AnnotationTypeDeclaration a);
|
||||
|
||||
/**
|
||||
* Returns an implementation of some utility methods for
|
||||
* operating on declarations.
|
||||
*
|
||||
* @return declaration utilities
|
||||
*/
|
||||
Declarations getDeclarationUtils();
|
||||
|
||||
/**
|
||||
* Returns an implementation of some utility methods for
|
||||
* operating on types.
|
||||
*
|
||||
* @return type utilities
|
||||
*/
|
||||
Types getTypeUtils();
|
||||
|
||||
/**
|
||||
* Add a listener. If the listener is currently registered to listen,
|
||||
* adding it again will have no effect.
|
||||
*
|
||||
* @param listener The listener to add.
|
||||
* @throws NullPointerException if the listener is null
|
||||
*/
|
||||
void addListener(AnnotationProcessorListener listener);
|
||||
|
||||
|
||||
/**
|
||||
* Remove a listener. If the listener is not currently listening,
|
||||
* the method call does nothing.
|
||||
*
|
||||
* @param listener The listener to remove.
|
||||
* @throws NullPointerException if the listener is null
|
||||
*/
|
||||
void removeListener(AnnotationProcessorListener listener);
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sun.mirror.declaration.AnnotationTypeDeclaration;
|
||||
|
||||
|
||||
/**
|
||||
* A factory for creating annotation processors.
|
||||
* Each factory is responsible for creating processors for one or more
|
||||
* annotation types.
|
||||
* The factory is said to <i>support</i> these types.
|
||||
*
|
||||
* <p> Each implementation of an <tt>AnnotationProcessorFactory</tt>
|
||||
* must provide a public no-argument constructor to be used by tools to
|
||||
* instantiate the factory.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
public interface AnnotationProcessorFactory {
|
||||
|
||||
/**
|
||||
* Returns the options recognized by this factory or by any of the
|
||||
* processors it may create.
|
||||
* Only {@linkplain AnnotationProcessorEnvironment#getOptions()
|
||||
* processor-specific} options are included, each of which begins
|
||||
* with <tt>"-A"</tt>. For example, if this factory recognizes
|
||||
* options such as <tt>-Adebug -Aloglevel=3</tt>, it will
|
||||
* return the strings <tt>"-Adebug"</tt> and <tt>"-Aloglevel"</tt>.
|
||||
*
|
||||
* <p> A tool might use this information to determine if any
|
||||
* options provided by a user are unrecognized by any processor,
|
||||
* in which case it may wish to report an error.
|
||||
*
|
||||
* @return the options recognized by this factory or by any of the
|
||||
* processors it may create, or an empty collection if none
|
||||
*/
|
||||
Collection<String> supportedOptions();
|
||||
|
||||
/**
|
||||
* Returns the names of the annotation types supported by this factory.
|
||||
* An element of the result may be the canonical (fully qualified) name
|
||||
* of a supported annotation type. Alternately it may be of the form
|
||||
* <tt>"<i>name</i>.*"</tt>
|
||||
* representing the set of all annotation types
|
||||
* with canonical names beginning with <tt>"<i>name</i>."</tt>
|
||||
* Finally, <tt>"*"</tt> by itself represents the set of all
|
||||
* annotation types.
|
||||
*
|
||||
* @return the names of the annotation types supported by this factory
|
||||
*/
|
||||
Collection<String> supportedAnnotationTypes();
|
||||
|
||||
/**
|
||||
* Returns an annotation processor for a set of annotation
|
||||
* types. The set will be empty if the factory supports
|
||||
* "<tt>*</tt>" and the specified type declarations have
|
||||
* no annotations. Note that the set of annotation types may be
|
||||
* empty for other reasons, such as giving the factory an
|
||||
* opportunity to register a listener. An
|
||||
* <tt>AnnotationProcessorFactory</tt> must gracefully handle an
|
||||
* empty set of annotations; an appropriate response to an empty
|
||||
* set will often be returning {@link AnnotationProcessors#NO_OP}.
|
||||
*
|
||||
* @param atds type declarations of the annotation types to be processed
|
||||
* @param env environment to use during processing
|
||||
* @return an annotation processor for the given annotation types,
|
||||
* or <tt>null</tt> if the types are not supported or the
|
||||
* processor cannot be created
|
||||
*/
|
||||
AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
|
||||
AnnotationProcessorEnvironment env);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
/**
|
||||
* Superinterface for all annotation processor event listeners.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AnnotationProcessorListener extends java.util.EventListener {}
|
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
import com.sun.mirror.apt.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Utilities to create specialized annotation processors.
|
||||
*
|
||||
* @since 1.5
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
*/
|
||||
public class AnnotationProcessors {
|
||||
static class NoOpAP implements AnnotationProcessor {
|
||||
NoOpAP() {}
|
||||
public void process(){}
|
||||
}
|
||||
|
||||
/**
|
||||
* Combines multiple annotation processors into a simple composite
|
||||
* processor.
|
||||
* The composite processor functions by invoking each of its component
|
||||
* processors in sequence.
|
||||
*/
|
||||
static class CompositeAnnotationProcessor implements AnnotationProcessor {
|
||||
|
||||
private List<AnnotationProcessor> aps =
|
||||
new LinkedList<AnnotationProcessor>();
|
||||
|
||||
/**
|
||||
* Constructs a new composite annotation processor.
|
||||
* @param aps the component annotation processors
|
||||
*/
|
||||
public CompositeAnnotationProcessor(Collection<AnnotationProcessor> aps) {
|
||||
this.aps.addAll(aps);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new composite annotation processor.
|
||||
* @param aps the component annotation processors
|
||||
*/
|
||||
public CompositeAnnotationProcessor(AnnotationProcessor... aps) {
|
||||
for(AnnotationProcessor ap: aps)
|
||||
this.aps.add(ap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the <tt>process</tt> method of each component processor,
|
||||
* in the order in which the processors were passed to the constructor.
|
||||
*/
|
||||
public void process() {
|
||||
for(AnnotationProcessor ap: aps)
|
||||
ap.process();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* An annotation processor that does nothing and has no state.
|
||||
* May be used multiple times.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public final static AnnotationProcessor NO_OP = new NoOpAP();
|
||||
|
||||
/**
|
||||
* Constructs a new composite annotation processor. A composite
|
||||
* annotation processor combines multiple annotation processors
|
||||
* into one and functions by invoking each of its component
|
||||
* processors' process methods in sequence.
|
||||
*
|
||||
* @param aps The processors to create a composite of
|
||||
* @since 1.5
|
||||
*/
|
||||
public static AnnotationProcessor getCompositeAnnotationProcessor(AnnotationProcessor... aps) {
|
||||
return new CompositeAnnotationProcessor(aps);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new composite annotation processor. A composite
|
||||
* annotation processor combines multiple annotation processors
|
||||
* into one and functions by invoking each of its component
|
||||
* processors' process methods in the sequence the processors are
|
||||
* returned by the collection's iterator.
|
||||
*
|
||||
* @param aps A collection of processors to create a composite of
|
||||
* @since 1.5
|
||||
*/
|
||||
public static AnnotationProcessor getCompositeAnnotationProcessor(Collection<AnnotationProcessor> aps) {
|
||||
return new CompositeAnnotationProcessor(aps);
|
||||
}
|
||||
}
|
150
langtools/src/share/classes/com/sun/mirror/apt/Filer.java
Normal file
150
langtools/src/share/classes/com/sun/mirror/apt/Filer.java
Normal file
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
||||
/**
|
||||
* This interface supports the creation of new files by an
|
||||
* annotation processor.
|
||||
* Files created in this way will be known to the annotation processing
|
||||
* tool implementing this interface, better enabling the tool to manage them.
|
||||
* Four kinds of files are distinguished:
|
||||
* source files, class files, other text files, and other binary files.
|
||||
* The latter two are collectively referred to as <i>auxiliary</i> files.
|
||||
*
|
||||
* <p> There are two distinguished locations (subtrees within the
|
||||
* file system) where newly created files are placed:
|
||||
* one for new source files, and one for new class files.
|
||||
* (These might be specified on a tool's command line, for example,
|
||||
* using flags such as <tt>-s</tt> and <tt>-d</tt>.)
|
||||
* Auxiliary files may be created in either location.
|
||||
*
|
||||
* <p> During each run of an annotation processing tool, a file
|
||||
* with a given pathname may be created only once. If that file already
|
||||
* exists before the first attempt to create it, the old contents will
|
||||
* be deleted. Any subsequent attempt to create the same file during
|
||||
* a run will fail.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
public interface Filer {
|
||||
|
||||
/**
|
||||
* Creates a new source file and returns a writer for it.
|
||||
* The file's name and path (relative to the root of all newly created
|
||||
* source files) is based on the type to be declared in that file.
|
||||
* If more than one type is being declared, the name of the principal
|
||||
* top-level type (the public one, for example) should be used.
|
||||
*
|
||||
* <p> The {@linkplain java.nio.charset.Charset charset} used to
|
||||
* encode the file is determined by the implementation.
|
||||
* An annotation processing tool may have an <tt>-encoding</tt>
|
||||
* flag or the like for specifying this. It will typically use
|
||||
* the platform's default encoding if none is specified.
|
||||
*
|
||||
* @param name canonical (fully qualified) name of the principal type
|
||||
* being declared in this file
|
||||
* @return a writer for the new file
|
||||
* @throws IOException if the file cannot be created
|
||||
*/
|
||||
PrintWriter createSourceFile(String name) throws IOException;
|
||||
|
||||
/**
|
||||
* Creates a new class file, and returns a stream for writing to it.
|
||||
* The file's name and path (relative to the root of all newly created
|
||||
* class files) is based on the name of the type being written.
|
||||
*
|
||||
* @param name canonical (fully qualified) name of the type being written
|
||||
* @return a stream for writing to the new file
|
||||
* @throws IOException if the file cannot be created
|
||||
*/
|
||||
OutputStream createClassFile(String name) throws IOException;
|
||||
|
||||
/**
|
||||
* Creates a new text file, and returns a writer for it.
|
||||
* The file is located along with either the
|
||||
* newly created source or newly created binary files. It may be
|
||||
* named relative to some package (as are source and binary files),
|
||||
* and from there by an arbitrary pathname. In a loose sense, the
|
||||
* pathname of the new file will be the concatenation of
|
||||
* <tt>loc</tt>, <tt>pkg</tt>, and <tt>relPath</tt>.
|
||||
*
|
||||
* <p> A {@linkplain java.nio.charset.Charset charset} for
|
||||
* encoding the file may be provided. If none is given, the
|
||||
* charset used to encode source files
|
||||
* (see {@link #createSourceFile(String)}) will be used.
|
||||
*
|
||||
* @param loc location of the new file
|
||||
* @param pkg package relative to which the file should be named,
|
||||
* or the empty string if none
|
||||
* @param relPath final pathname components of the file
|
||||
* @param charsetName the name of the charset to use, or null if none
|
||||
* is being explicitly specified
|
||||
* @return a writer for the new file
|
||||
* @throws IOException if the file cannot be created
|
||||
*/
|
||||
PrintWriter createTextFile(Location loc,
|
||||
String pkg,
|
||||
File relPath,
|
||||
String charsetName) throws IOException;
|
||||
|
||||
/**
|
||||
* Creates a new binary file, and returns a stream for writing to it.
|
||||
* The file is located along with either the
|
||||
* newly created source or newly created binary files. It may be
|
||||
* named relative to some package (as are source and binary files),
|
||||
* and from there by an arbitrary pathname. In a loose sense, the
|
||||
* pathname of the new file will be the concatenation of
|
||||
* <tt>loc</tt>, <tt>pkg</tt>, and <tt>relPath</tt>.
|
||||
*
|
||||
* @param loc location of the new file
|
||||
* @param pkg package relative to which the file should be named,
|
||||
* or the empty string if none
|
||||
* @param relPath final pathname components of the file
|
||||
* @return a stream for writing to the new file
|
||||
* @throws IOException if the file cannot be created
|
||||
*/
|
||||
OutputStream createBinaryFile(Location loc,
|
||||
String pkg,
|
||||
File relPath) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Locations (subtrees within the file system) where new files are created.
|
||||
*/
|
||||
enum Location {
|
||||
/** The location of new source files. */
|
||||
SOURCE_TREE,
|
||||
/** The location of new class files. */
|
||||
CLASS_TREE
|
||||
}
|
||||
}
|
88
langtools/src/share/classes/com/sun/mirror/apt/Messager.java
Normal file
88
langtools/src/share/classes/com/sun/mirror/apt/Messager.java
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
|
||||
import com.sun.mirror.util.SourcePosition;
|
||||
|
||||
|
||||
/**
|
||||
* A <tt>Messager</tt> provides the way for
|
||||
* an annotation processor to report error messages, warnings, and
|
||||
* other notices.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
public interface Messager {
|
||||
|
||||
/**
|
||||
* Prints an error message.
|
||||
* Equivalent to <tt>printError(null, msg)</tt>.
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printError(String msg);
|
||||
|
||||
/**
|
||||
* Prints an error message.
|
||||
* @param pos the position where the error occured, or null if it is
|
||||
* unknown or not applicable
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printError(SourcePosition pos, String msg);
|
||||
|
||||
/**
|
||||
* Prints a warning message.
|
||||
* Equivalent to <tt>printWarning(null, msg)</tt>.
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printWarning(String msg);
|
||||
|
||||
/**
|
||||
* Prints a warning message.
|
||||
* @param pos the position where the warning occured, or null if it is
|
||||
* unknown or not applicable
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printWarning(SourcePosition pos, String msg);
|
||||
|
||||
/**
|
||||
* Prints a notice.
|
||||
* Equivalent to <tt>printNotice(null, msg)</tt>.
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printNotice(String msg);
|
||||
|
||||
/**
|
||||
* Prints a notice.
|
||||
* @param pos the position where the noticed occured, or null if it is
|
||||
* unknown or not applicable
|
||||
* @param msg the message, or an empty string if none
|
||||
*/
|
||||
void printNotice(SourcePosition pos, String msg);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
/**
|
||||
* Event for the completion of a round of annotation processing.
|
||||
*
|
||||
* <p>While this class extends the serializable <tt>EventObject</tt>, it
|
||||
* cannot meaningfully be serialized because all of the annotation
|
||||
* processing tool's internal state would potentially be needed.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public abstract class RoundCompleteEvent extends java.util.EventObject {
|
||||
private RoundState rs;
|
||||
|
||||
/**
|
||||
* The current <tt>AnnotationProcessorEnvironment</tt> is regarded
|
||||
* as the source of events.
|
||||
*
|
||||
* @param source The source of events
|
||||
* @param rs The state of the round
|
||||
*/
|
||||
protected RoundCompleteEvent(AnnotationProcessorEnvironment source,
|
||||
RoundState rs) {
|
||||
super(source);
|
||||
this.rs = rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return round state.
|
||||
*/
|
||||
public RoundState getRoundState() {
|
||||
return rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return source.
|
||||
*/
|
||||
public AnnotationProcessorEnvironment getSource() {
|
||||
return (AnnotationProcessorEnvironment)super.getSource();
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
/**
|
||||
* Listener for the completion of a round of annotation processing.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface RoundCompleteListener extends AnnotationProcessorListener {
|
||||
/**
|
||||
* Invoked after all processors for a round have run to completion.
|
||||
*
|
||||
* @param event An event for round completion
|
||||
*/
|
||||
void roundComplete(RoundCompleteEvent event);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
package com.sun.mirror.apt;
|
||||
|
||||
/**
|
||||
* Represents the status of a completed round of annotation processing.
|
||||
*
|
||||
* @author Joseph D. Darcy
|
||||
* @author Scott Seligman
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface RoundState {
|
||||
/**
|
||||
* Returns <tt>true</tt> if this was the last round of annotation
|
||||
* processing; returns <tt>false</tt> if there will be a subsequent round.
|
||||
*/
|
||||
boolean finalRound();
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if an error was raised in this round of processing;
|
||||
* returns <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean errorRaised();
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if new source files were created in this round of
|
||||
* processing; returns <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean sourceFilesCreated();
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if new class files were created in this round of
|
||||
* processing; returns <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean classFilesCreated();
|
||||
}
|
42
langtools/src/share/classes/com/sun/mirror/apt/package.html
Normal file
42
langtools/src/share/classes/com/sun/mirror/apt/package.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
|
||||
Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Sun designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Sun in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
have any questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Classes used to communicate information between
|
||||
{@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors}
|
||||
and an annotation processing tool.
|
||||
|
||||
<p>Note that the <code>apt</code> tool and its associated APIs may be
|
||||
changed or superseded in future j2se releases.
|
||||
|
||||
@since 1.5
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user