Skip to content

Commit dd4a744

Browse files
committed
Checkin v0.1.0
1 parent cf1eaf6 commit dd4a744

File tree

180 files changed

+30071
-30000
lines changed

Some content is hidden

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

180 files changed

+30071
-30000
lines changed

Diff for: .travis.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
dist: trusty
2+
sudo: required
3+
language: java
4+
5+
env:
6+
- V=HEAD URL=http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=linux-x86_64/lastSuccessfulBuild/artifact/output/ci/bazel--installer.sh FLAGS='--worker_verbose --strategy=Javac=worker --strategy=JsChecker=worker'
7+
- V=0.3.1 URL=https://github.com/bazelbuild/bazel/releases/download/0.3.1/bazel-0.3.1-installer-linux-x86_64.sh FLAGS=''
8+
- V=0.3.0 URL=https://github.com/bazelbuild/bazel/releases/download/0.3.0/bazel-0.3.0-installer-linux-x86_64.sh FLAGS=''
9+
10+
before_install:
11+
- wget -O install.sh $URL
12+
- chmod +x install.sh
13+
- ./install.sh --user
14+
- rm -f install.sh
15+
16+
script:
17+
- |
18+
bazel \
19+
--output_base=$HOME/.cache/bazel \
20+
--batch \
21+
--host_jvm_args=-Xmx500m \
22+
--host_jvm_args=-Xms500m \
23+
build \
24+
--verbose_failures \
25+
--sandbox_debug \
26+
--spawn_strategy=standalone \
27+
--genrule_strategy=standalone \
28+
--local_resources=400,1,1.0 \
29+
//java/... \
30+
$FLAGS
31+
32+
notifications:
33+
email: false

Diff for: LICENSE

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
GNU CLASSPATH
2+
=============
3+
4+
Classpath is distributed under the terms of the GNU General Public
5+
License with the following clarification and special exception.
6+
7+
Linking this library statically or dynamically with other modules is
8+
making a combined work based on this library. Thus, the terms and
9+
conditions of the GNU General Public License cover the whole
10+
combination.
11+
12+
As a special exception, the copyright holders of this library give you
13+
permission to link this library with independent modules to produce an
14+
executable, regardless of the license terms of these independent
15+
modules, and to copy and distribute the resulting executable under
16+
terms of your choice, provided that you also meet, for each linked
17+
independent module, the terms and conditions of the license of that
18+
module. An independent module is a module which is not derived from or
19+
based on this library. If you modify this library, you may extend this
20+
exception to your version of the library, but you are not obligated to
21+
do so. If you do not wish to do so, delete this exception statement
22+
from your version.
23+
24+
As such, it can be used to run, create and distribute a large class of
25+
applications and applets. When GNU Classpath is used unmodified as the
26+
core class library for a virtual machine, compiler for the java
27+
languge, or for a program written in the java programming language it
28+
does not affect the licensing for distributing those programs
29+
directly.
30+
31+
Classpath::Documentation Redistribution Policy
32+
++++++++++++++++++++++++++++++++++++++++++++++
33+
34+
GNU Documentation is unique because of our attitude towards it. We
35+
believe the reader should be free to copy and redistribute it, just
36+
like our software. Originally, all our documentation was released
37+
under a short Copyleft license, or under the GNU General Public
38+
License (GPL) itself; in 2001 the Free Documentation License (FDL) was
39+
created to address certain needs that were not met by licenses
40+
originally designed for software.

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fmt:
22
buildifier WORKSPACE
33
find . -name BUILD | xargs buildifier
4-
find src -name '*.java' | xargs java -jar ~/bin/google-java-format-0.1-alpha.jar --replace
4+
find java -name '*.java' | xargs java -jar ~/bin/google-java-format-0.1-alpha.jar --replace

Diff for: README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `rules_apidoc` [![Build Status](https://travis-ci.org/pubref/rules_apidoc.svg?branch=master)](https://travis-ci.org/pubref/rules_apidoc)
2+
3+
First, load `rules_apidoc` in your `WORKSPACE`:
4+
5+
```python
6+
git_repository(
7+
name = "org_pubref_rules_apidoc",
8+
tag = "0.1.0",
9+
remote = "https://github.com/pubref/rules_apidoc.git",
10+
)
11+
```
12+
13+
Then, use a `BUILD` file rule to generate documentation for the
14+
language of your choice.
15+
16+
| Language | Rule | Description |
17+
| :--- | ---: | :---------- |
18+
| [Java](java) | [java_apidoc](java#java_apidoc) | Generate `javadoc` api documentation. |

Diff for: apidoc/internal/java_apidoc.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def _mk_attrs():
8686
single_file = True,
8787
),
8888
"doclet_deps": attr.label_list(
89-
default = [Label("//src/com/inxar/doclet1")],
9089
providers = ["java"],
9190
),
9291
"taglet_deps": attr.label_list(

Diff for: java/README.md

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Java Rules
2+
3+
| Rule | Description |
4+
| ---: | :--- |
5+
| [java_apidoc](#java_apidoc) | Generate `javadoc` HTML documentation. |
6+
7+
## java\_apidoc
8+
9+
Runs the `javadoc` command installed in the `@local_jdk//`. To run
10+
this command, you'll want to generally provide either `deps + srcs` (pattern 1) or
11+
`deps + sourcepaths + packages` (pattern 2):
12+
13+
1. `deps`: java_library dependencies that provide compiled jar outputs
14+
that will be uses to populate the `--classpath` argument.
15+
16+
1. `srcs`: filegroup dependencies that provide the `*.java`
17+
sourcefiles.
18+
19+
1. `packages`: a list of package names that the javadoc command should
20+
generated output for. Unless your java source package naming
21+
starts in the root of the workspace, you'll need to provide it in
22+
the 'sourcepaths` attribute.
23+
24+
1. `sourcepaths`: a list of strings that name directories where your
25+
java is stored.
26+
27+
The list of attributes for this rule is extensive but mirrors the
28+
`javadoc` command closely. Please refer to the
29+
[source code](https://github.com/pubref/rules_apidoc/blob/master/apidoc/internal/java_apidoc.bzl)
30+
for definitive reference.
31+
32+
### Pattern 1: Using a set of source files via the `srcs` attribute
33+
34+
Here's an [example command](org/pubref/rules_apidoc/taglets) that
35+
generates API documentation for a Taglet that links to the bazel
36+
documentation (as well as using *itself* as a custom taglet):
37+
38+
```python
39+
load("@org_pubref_rules_apidoc//java:rules.bzl", "java_apidoc")
40+
41+
filegroup(
42+
name = "srcs",
43+
srcs = ["BazelTaglet.java"],
44+
)
45+
46+
filegroup(
47+
name = "overview",
48+
srcs = ["overview.html"],
49+
)
50+
51+
java_library(
52+
name = "bazel",
53+
srcs = ["srcs"],
54+
deps = ["@org_pubref_rules_apidoc//java:tools_jar"],
55+
)
56+
57+
java_apidoc(
58+
name = "api",
59+
deps = [":bazel"],
60+
srcs = ["srcs"],
61+
62+
taglet = ["org.pubref.rules_apidoc.taglets.BazelTaglet"],
63+
taglet_deps = [":bazel"],
64+
65+
overview = "overview.html",
66+
quiet = True,
67+
)
68+
```
69+
70+
```sh
71+
~/github/rules_apidoc*master$ bazel build java/org/pubref/rules_apidoc/taglets:api
72+
Target //java/org/pubref/rules_apidoc/taglets:api up-to-date:
73+
bazel-genfiles/java/org/pubref/rules_apidoc/taglets/index.html
74+
```
75+
76+
### Pattern 2: Using a sourcepath and package names.
77+
78+
Here's an [example command](com/sun/tools/doclets) that generates API
79+
documentation for the Docklet API (as well as using *itself* as the
80+
custom doclet):
81+
82+
```python
83+
load("@org_pubref_rules_apidoc//java:rules.bzl", "java_apidoc")
84+
85+
java_library(
86+
name = "doclets",
87+
srcs = glob(["**/*.java"]),
88+
deps = ["@org_pubref_rules_apidoc//java:tools_jar"],
89+
)
90+
91+
java_apidoc(
92+
name = "api",
93+
94+
deps = [":doclets"],
95+
sourcepaths = ["java/"],
96+
packages = [
97+
"com.sun.tools.doclets",
98+
"com.sun.tools.doclets.formats.html",
99+
"com.sun.tools.doclets.formats.html.markup",
100+
"com.sun.tools.doclets.internal.toolkit",
101+
"com.sun.tools.doclets.internal.toolkit.builders",
102+
"com.sun.tools.doclets.internal.toolkit.taglets",
103+
"com.sun.tools.doclets.internal.toolkit.util",
104+
],
105+
106+
doclet = "com.sun.tools.doclets.standard.Standard",
107+
doclet_deps = [":doclets"],
108+
quiet = True,
109+
)
110+
```
111+
112+
Building this target will generate HTML documentation in the
113+
`bazel-genfiles` package subdirectory:
114+
115+
```sh
116+
~/github/rules_apidoc*master$ bazel build java/com/sun/tools/doclets:api
117+
Target //java/com/sun/tools/doclets:api up-to-date:
118+
bazel-genfiles/java/com/sun/tools/doclets/index.html ```
119+
```

Diff for: java/com/sun/tools/doclets/BUILD

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//apidoc:rules.bzl", "java_apidoc")
1+
load("//java:rules.bzl", "java_apidoc")
22

33
java_library(
44
name = "doclets",
@@ -7,23 +7,15 @@ java_library(
77
]),
88
deps = [
99
"//java:tools_jar",
10-
]
10+
],
1111
)
1212

1313
java_apidoc(
1414
name = "api",
15-
deps = [
16-
"doclets",
17-
"//java:tools_jar",
18-
],
19-
sourcepaths = [
20-
"java/",
21-
],
15+
doclet = "com.sun.tools.doclets.standard.Standard",
2216
doclet_deps = [
2317
"doclets",
24-
"//java:tools_jar",
2518
],
26-
doclet = "com.sun.tools.doclets.standard.Standard",
2719
packages = [
2820
"com.sun.tools.doclets",
2921
"com.sun.tools.doclets.formats.html",
@@ -34,4 +26,10 @@ java_apidoc(
3426
"com.sun.tools.doclets.internal.toolkit.util",
3527
],
3628
quiet = True,
29+
sourcepaths = [
30+
"java/",
31+
],
32+
deps = [
33+
"doclets",
34+
],
3735
)

0 commit comments

Comments
 (0)