Skip to content

Commit 220ad18

Browse files
7903799: apidiff: add initial code
Reviewed-by: iris
1 parent 60b6ab3 commit 220ad18

File tree

175 files changed

+40655
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+40655
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**.iml
2+
.DS_store
3+
.idea
4+
/.src-rev
5+
/build.properties
6+
attic
7+
build
8+
dist
9+
nbproject
10+
out
11+
play
12+
tmp
13+
webrev

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contributing to APIDiff
2+
3+
APIDiff is part of the OpenJDK [CodeTools] Project.
4+
5+
Please see <https://openjdk.org/contribute/> for how to contribute.
6+
7+
8+
[CodeTools]: https://openjdk.org/projects/code-tools

COPYRIGHT

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
2+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3+
4+
This code is free software; you can redistribute it and/or modify it
5+
under the terms of the GNU General Public License version 2 only, as
6+
published by the Free Software Foundation.
7+
8+
This code is distributed in the hope that it will be useful, but WITHOUT
9+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11+
version 2 for more details (a copy is included in the LICENSE file that
12+
accompanied this code).
13+
14+
You should have received a copy of the GNU General Public License version
15+
2 along with this work; if not, write to the Free Software Foundation,
16+
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17+
18+
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19+
or visit www.oracle.com if you need additional information or have any
20+
questions.

LICENSE

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# APIDiff
2+
3+
APIDiff is a utility to compare two or more versions of an API, each as
4+
defined by a series of options similar to those supported by `javac`.
5+
6+
## Building `apidiff`
7+
8+
`apidiff` uses the following dependencies:
9+
10+
* _[Daisy Diff]_: an HTML comparison library, required when building `apidiff`
11+
* _[Java Diff Utils]_: a plain-text comparison library, required when building `apidiff`
12+
* _[TestNG]_: the testing framework, used to run some of the tests for `apidiff`
13+
14+
Suitable versions of these dependencies can be downloaded by running
15+
`make/build.sh`.
16+
17+
### Building with Apache Ant
18+
19+
The default configuration assumes that dependencies have been downloaded
20+
into the `build/deps` directory.
21+
These values can be overridden with project-specific local configuration values
22+
in `build.properties`, if it exists in the root directory of the repo.
23+
24+
````
25+
ant -f make/build.xml <target>
26+
````
27+
28+
### Building with GNU Make
29+
30+
The default configuration uses values provided in `make/dependencies.gmk`,
31+
unless these values have been overridden on the command line used to run `make`.
32+
33+
````
34+
make -C make Makefile <target>
35+
````
36+
37+
### Building with an IDE
38+
39+
An IDE such as IntelliJ IDEA needs the following configuration:
40+
41+
* Sources Root: `src`
42+
* TestNG Test Root: `test/testng`
43+
* Libraries:
44+
* _Daisy Diff_, _Java Diff Utils_ available for compilation
45+
* _TestNG_ available for testing
46+
47+
In addition, some TestNG tests require access to internal classes in
48+
the `jdk.compiler` and `jdk.jdeps` modules:
49+
50+
````
51+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
52+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
53+
--add-modules jdk.jdeps
54+
--add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
55+
````
56+
57+
The following compiler options may also be desirable:
58+
59+
````
60+
-Xdoclint:missing/protected
61+
-Xlint:unchecked
62+
````
63+
64+
_Note:_ When working on the test files, be careful not to mark module source directories
65+
as `Test Sources Root` at the same time as any source directories that are not
66+
for a module.
67+
68+
## Documentation
69+
70+
A "man" page is generated as part of the build, and is the primary source
71+
of information for how to run `apidiff`.
72+
73+
## ShowDocs
74+
75+
`showDocs` is a small utility program that is a simple wrapper around the
76+
`APIReader` and `SerializedFormReader` classes in `apidiff`, that can provide
77+
filtered views of the files generated by `javadoc`, in order to view the
78+
parts of those files that will be compared by `apidiff`.
79+
80+
81+
[Daisy Diff]: https://github.com/DaisyDiff/DaisyDiff
82+
[Java Diff Utils]: https://github.com/java-diff-utils/java-diff-utils
83+
[TestNG]: https://testng.org/

0 commit comments

Comments
 (0)