getting javadoc to build
Change-Id: I7f214c6ce5a876f458626e12c8cfdd3072ad107f
Showing
5 changed files
with
383 additions
and
2 deletions
| ... | @@ -8,4 +8,6 @@ COMPILE_DEPS = [ | ... | @@ -8,4 +8,6 @@ COMPILE_DEPS = [ |
| 8 | osgi_jar_with_tests ( | 8 | osgi_jar_with_tests ( |
| 9 | name = 'onos-api', | 9 | name = 'onos-api', |
| 10 | deps = COMPILE_DEPS, | 10 | deps = COMPILE_DEPS, |
| 11 | + javadoc_files = glob(['src/main/javadoc/**/*']), | ||
| 12 | + javadoc_files_root = 'src/main/javadoc', | ||
| 11 | ) | 13 | ) |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
docs/BUCK
0 → 100644
| 1 | +external_deps = UTILS + API + [ | ||
| 2 | + '//apps/cpman/api:onos-apps-cpman-api', | ||
| 3 | + '//apps/routing-api:onos-apps-routing-api', | ||
| 4 | + '//apps/dhcp/api:onos-apps-dhcp-api', | ||
| 5 | +] | ||
| 6 | + | ||
| 7 | +external_groups = [ | ||
| 8 | + ( 'Network Model & Services', [ 'org.onosproject.*' ]), | ||
| 9 | + ( 'Incubator for Network Model & Services', [ 'org.onosproject.incubator.*' ]), | ||
| 10 | + ( 'Utilities', [ 'org.onlab.*' ]), | ||
| 11 | + ( 'App & Extensions', [ | ||
| 12 | + 'org.onosproject.dhcp', | ||
| 13 | + 'org.onosproject.cpman', | ||
| 14 | + 'org.onosproject.routing', | ||
| 15 | + ]), | ||
| 16 | +] | ||
| 17 | + | ||
| 18 | +internal_groups = [ | ||
| 19 | + ( 'Network Model & Services', [ 'org.onosproject.*' ]), | ||
| 20 | + ( 'Incubator for Network Model & Services', [ 'org.onosproject.incubator.*' ]), | ||
| 21 | + ( 'Core Subsystems', [ | ||
| 22 | + 'org.onosproject.cfg.impl', | ||
| 23 | + 'org.onosproject.cluster.impl', | ||
| 24 | + 'org.onosproject.core.impl', | ||
| 25 | + 'org.onosproject.event.impl', | ||
| 26 | + 'org.onosproject.net.config.impl', | ||
| 27 | + 'org.onosproject.net.device.impl', | ||
| 28 | + 'org.onosproject.net.driver.impl', | ||
| 29 | + 'org.onosproject.net.edgeservice.impl', | ||
| 30 | + 'org.onosproject.net.flow.impl', | ||
| 31 | + 'org.onosproject.net.flowobjective.impl', | ||
| 32 | + 'org.onosproject.net.flowobjective.impl.composition', | ||
| 33 | + 'org.onosproject.net.group.impl', | ||
| 34 | + 'org.onosproject.net.host.impl', | ||
| 35 | + 'org.onosproject.net.intent.impl', | ||
| 36 | + 'org.onosproject.net.intent.impl.compiler', | ||
| 37 | + 'org.onosproject.net.intent.impl.phase', | ||
| 38 | + 'org.onosproject.net.link.impl', | ||
| 39 | + 'org.onosproject.net.newresource.impl', | ||
| 40 | + 'org.onosproject.net.packet.impl', | ||
| 41 | + 'org.onosproject.net.proxyarp.impl', | ||
| 42 | + 'org.onosproject.net.resource.impl', | ||
| 43 | + 'org.onosproject.net.statistic.impl', | ||
| 44 | + 'org.onosproject.net.topology.impl', | ||
| 45 | + 'org.onosproject.json', | ||
| 46 | + 'org.onosproject.json.*', | ||
| 47 | + 'org.onosproject.common.*', | ||
| 48 | + 'org.onosproject.security.impl', | ||
| 49 | + 'org.onosproject.security.store', | ||
| 50 | + ]), | ||
| 51 | + ( 'Distributed Stores', [ | ||
| 52 | + 'org.onosproject.store.*', | ||
| 53 | + 'org.onosproject.persistence.impl', | ||
| 54 | + ]), | ||
| 55 | + ( 'Incubator for Core Subsystems & Distributed Stores', [ | ||
| 56 | + 'org.onosproject.incubator.net.impl', | ||
| 57 | + 'org.onosproject.incubator.store.impl', | ||
| 58 | + 'org.onosproject.incubator.net.resource.label.impl', | ||
| 59 | + 'org.onosproject.incubator.store.resource.impl', | ||
| 60 | + 'org.onosproject.incubator.net.tunnel.impl', | ||
| 61 | + 'org.onosproject.incubator.store.tunnel.impl', | ||
| 62 | + 'org.onosproject.incubator.net.config.impl', | ||
| 63 | + 'org.onosproject.incubator.net.domain.impl', | ||
| 64 | + 'org.onosproject.incubator.store.config.impl', | ||
| 65 | + 'org.onosproject.incubator.net.intf.impl', | ||
| 66 | + 'org.onosproject.incubator.net.meter.impl', | ||
| 67 | + 'org.onosproject.incubator.net.resource.label', | ||
| 68 | + 'org.onosproject.incubator.store.meter.impl', | ||
| 69 | + ]), | ||
| 70 | + ( 'Utilities', [ 'org.onlab.*' ]), | ||
| 71 | + ( 'GUI, REST & Command-Line', [ | ||
| 72 | + 'org.onosproject.ui.impl*', | ||
| 73 | + 'org.onosproject.rest.*', | ||
| 74 | + 'org.onosproject.cli*', | ||
| 75 | + 'org.onosproject.codec.impl', | ||
| 76 | + ]), | ||
| 77 | + ( 'Builtin Applications', [ | ||
| 78 | + 'org.onosproject.app.*', | ||
| 79 | + 'org.onosproject.acl*', | ||
| 80 | + 'org.onosproject.aaa', | ||
| 81 | + 'org.onosproject.fwd', | ||
| 82 | + 'org.onosproject.dhcp*', | ||
| 83 | + 'org.onosproject.flowanalyzer', | ||
| 84 | + 'org.onosproject.cpman*', | ||
| 85 | + 'org.onosproject.mobility', | ||
| 86 | + 'org.onosproject.proxyarp', | ||
| 87 | + 'org.onosproject.calendar', | ||
| 88 | + 'org.onosproject.olt*', | ||
| 89 | + 'org.onosproject.optical*', | ||
| 90 | + 'org.onosproject.newoptical*', | ||
| 91 | + 'org.onosproject.sdnip', | ||
| 92 | + 'org.onosproject.sdnip.*', | ||
| 93 | + 'org.onosproject.config', | ||
| 94 | + 'org.onosproject.routing', | ||
| 95 | + 'org.onosproject.routing*', | ||
| 96 | + 'org.onosproject.bgprouter', | ||
| 97 | + 'org.onosproject.segmentrouting*', | ||
| 98 | + 'org.onosproject.reactive.routing*', | ||
| 99 | + 'org.onosproject.messagingperf', | ||
| 100 | + 'org.onosproject.virtualbng*', | ||
| 101 | + 'org.onosproject.cordfabric*', | ||
| 102 | + 'org.onosproject.xosintegration*', | ||
| 103 | + 'org.onosproject.cip*', | ||
| 104 | + 'org.onosproject.vtn*', | ||
| 105 | + 'org.onosproject.cord*', | ||
| 106 | + 'org.onosproject.mcast*', | ||
| 107 | + 'org.onosproject.mfwd*', | ||
| 108 | + 'org.onosproject.mlb*', | ||
| 109 | + 'org.onosproject.igmp*', | ||
| 110 | + 'org.onosproject.pim*', | ||
| 111 | + 'org.onosproject.vpls*', | ||
| 112 | + 'org.onosproject.vrouter*', | ||
| 113 | + 'org.onosproject.faultmanagement*', | ||
| 114 | + 'org.onosproject.iptopology*', | ||
| 115 | + 'org.onosproject.drivermatrix*', | ||
| 116 | + 'org.onosproject.pathpainter*', | ||
| 117 | + 'org.onosproject.openstack*', | ||
| 118 | + 'org.onosproject.scalablegateway*', | ||
| 119 | + 'org.onosproject.forwarder*', | ||
| 120 | + 'org.onosproject.sfc*', | ||
| 121 | + 'org.onosproject.netcfgmonitor*', | ||
| 122 | + 'org.onosproject.flowperf', | ||
| 123 | + 'org.onosproject.loadtest', | ||
| 124 | + 'org.onosproject.events', | ||
| 125 | + 'org.onosproject.bmv2*', | ||
| 126 | + 'org.onosproject.xosclient*', | ||
| 127 | + 'org.onosproject.kafkaintegration*', | ||
| 128 | + 'org.onosproject.gangliametrics*', | ||
| 129 | + 'org.onosproject.graphitemetrics*', | ||
| 130 | + 'org.onosproject.influxdbmetrics*', | ||
| 131 | + 'org.onosproject.yms*', | ||
| 132 | + ]), | ||
| 133 | + ( 'Test Instrumentation & Applications', [ | ||
| 134 | + 'org.onosproject.metrics.*', | ||
| 135 | + 'org.onosproject.demo*', | ||
| 136 | + 'org.onosproject.election*', | ||
| 137 | + 'org.onosproject.distributedprimitives*', | ||
| 138 | + 'org.onosproject.intentperf*', | ||
| 139 | + 'org.onosproject.messagingperf*', | ||
| 140 | + 'org.onosproject.optical.testapp*', | ||
| 141 | + ]), | ||
| 142 | + ( 'OpenFlow Providers & Controller', [ | ||
| 143 | + 'org.onosproject.openflow.*', | ||
| 144 | + 'org.onosproject.provider.of.*', | ||
| 145 | + ]), | ||
| 146 | + ( 'NetConf Protocol & Providers', [ | ||
| 147 | + 'org.onosproject.netconf*', | ||
| 148 | + 'org.onosproject.provider.netconf*', | ||
| 149 | + ]), | ||
| 150 | + ( 'OVSDB Protocol & Providers', [ | ||
| 151 | + 'org.onosproject.provider.ovsdb*', | ||
| 152 | + 'org.onosproject.ovsdb*', | ||
| 153 | + ]), | ||
| 154 | + ( 'PCEP Protocol & Providers', [ | ||
| 155 | + 'org.onosproject.pce.*', | ||
| 156 | + 'org.onosproject.pcerest*', | ||
| 157 | + 'org.onosproject.pceweb*', | ||
| 158 | + 'org.onosproject.pcep*', | ||
| 159 | + 'org.onosproject.pcepio*', | ||
| 160 | + 'org.onosproject.provider.pcep*', | ||
| 161 | + ]), | ||
| 162 | + ( 'BGP-LS Protocol & Providers', [ | ||
| 163 | + 'org.onosproject.bgp.controller*', | ||
| 164 | + 'org.onosproject.bgp*', | ||
| 165 | + 'org.onosproject.provider.bgp*', | ||
| 166 | + ]), | ||
| 167 | + ( 'OSPF Protocol & Providers', [ 'org.onosproject.ospf*' ]), | ||
| 168 | + ( 'ISIS Protocol & Providers', [ 'org.onosproject.isis*' ]), | ||
| 169 | + ( 'LISP Protocol & Providers', [ 'org.onosproject.lisp*' ]), | ||
| 170 | + ( 'SNMP Protocol & Providers', [ 'org.onosproject.snmp*' ]), | ||
| 171 | + ( 'REST Protocol & Providers', [ | ||
| 172 | + 'org.onosproject.protocol.rest*', | ||
| 173 | + 'org.onosproject.provider.rest*', | ||
| 174 | + ]), | ||
| 175 | + ( 'Other Providers', [ | ||
| 176 | + 'org.onosproject.provider.*', | ||
| 177 | + 'org.onosproject.protocol.*', | ||
| 178 | + ]), | ||
| 179 | + ( 'Device Drivers', [ 'org.onosproject.driver*' ]), | ||
| 180 | +] | ||
| 181 | + | ||
| 182 | +project_javadoc( | ||
| 183 | + name = 'external', | ||
| 184 | + project_title = 'ONOS Java API (%s)' % ONOS_VERSION, | ||
| 185 | + javadoc_files = glob(['src/main/javadoc/doc-files/*']), | ||
| 186 | + overview = 'src/main/javadoc/overview.html', | ||
| 187 | + deps = external_deps, | ||
| 188 | + groups = external_groups, | ||
| 189 | +) | ||
| 190 | + | ||
| 191 | +project_javadoc( | ||
| 192 | + name = 'internal', | ||
| 193 | + project_title = 'ONOS Java API (%s)' % ONOS_VERSION, | ||
| 194 | + javadoc_files = glob(['src/main/javadoc/doc-files/*']), | ||
| 195 | + overview = 'src/main/javadoc/overview.html', | ||
| 196 | + deps = CORE, | ||
| 197 | + groups = internal_groups, | ||
| 198 | +) |
| 1 | -CORE = [ | 1 | +UTILS = [ |
| 2 | '//utils/osgi:onlab-osgi', | 2 | '//utils/osgi:onlab-osgi', |
| 3 | '//utils/junit:onlab-junit', | 3 | '//utils/junit:onlab-junit', |
| 4 | '//utils/misc:onlab-misc', | 4 | '//utils/misc:onlab-misc', |
| 5 | '//utils/rest:onlab-rest', | 5 | '//utils/rest:onlab-rest', |
| 6 | +] | ||
| 6 | 7 | ||
| 8 | +API = [ | ||
| 7 | '//core/api:onos-api', | 9 | '//core/api:onos-api', |
| 10 | + '//incubator/api:onos-incubator-api', | ||
| 11 | +] | ||
| 12 | + | ||
| 13 | +CORE = UTILS + API + [ | ||
| 8 | '//core/net:onos-core-net', | 14 | '//core/net:onos-core-net', |
| 9 | '//core/common:onos-core-common', | 15 | '//core/common:onos-core-common', |
| 10 | '//core/store/primitives:onos-core-primitives', | 16 | '//core/store/primitives:onos-core-primitives', |
| ... | @@ -13,7 +19,6 @@ CORE = [ | ... | @@ -13,7 +19,6 @@ CORE = [ |
| 13 | '//core/security:onos-security', | 19 | '//core/security:onos-security', |
| 14 | '//core/store/persistence:onos-core-persistence', | 20 | '//core/store/persistence:onos-core-persistence', |
| 15 | 21 | ||
| 16 | - '//incubator/api:onos-incubator-api', | ||
| 17 | '//incubator/net:onos-incubator-net', | 22 | '//incubator/net:onos-incubator-net', |
| 18 | '//incubator/core:onos-incubator-core', | 23 | '//incubator/core:onos-incubator-core', |
| 19 | '//incubator/store:onos-incubator-store', | 24 | '//incubator/store:onos-incubator-store', | ... | ... |
| ... | @@ -42,6 +42,7 @@ import com.facebook.buck.rules.BuildRuleType; | ... | @@ -42,6 +42,7 @@ import com.facebook.buck.rules.BuildRuleType; |
| 42 | import com.facebook.buck.rules.BuildRules; | 42 | import com.facebook.buck.rules.BuildRules; |
| 43 | import com.facebook.buck.rules.BuildTargetSourcePath; | 43 | import com.facebook.buck.rules.BuildTargetSourcePath; |
| 44 | import com.facebook.buck.rules.Description; | 44 | import com.facebook.buck.rules.Description; |
| 45 | +import com.facebook.buck.rules.SourcePath; | ||
| 45 | import com.facebook.buck.rules.SourcePathResolver; | 46 | import com.facebook.buck.rules.SourcePathResolver; |
| 46 | import com.facebook.buck.rules.SourcePaths; | 47 | import com.facebook.buck.rules.SourcePaths; |
| 47 | import com.facebook.buck.rules.TargetGraph; | 48 | import com.facebook.buck.rules.TargetGraph; |
| ... | @@ -49,6 +50,7 @@ import com.google.common.base.Function; | ... | @@ -49,6 +50,7 @@ import com.google.common.base.Function; |
| 49 | import com.google.common.base.Optional; | 50 | import com.google.common.base.Optional; |
| 50 | import com.google.common.base.Preconditions; | 51 | import com.google.common.base.Preconditions; |
| 51 | import com.google.common.collect.ImmutableSet; | 52 | import com.google.common.collect.ImmutableSet; |
| 53 | +import com.google.common.collect.ImmutableSortedMap; | ||
| 52 | import com.google.common.collect.ImmutableSortedSet; | 54 | import com.google.common.collect.ImmutableSortedSet; |
| 53 | import com.google.common.collect.Iterables; | 55 | import com.google.common.collect.Iterables; |
| 54 | 56 | ||
| ... | @@ -149,17 +151,35 @@ public class OnosJarDescription implements Description<OnosJarDescription.Arg>, | ... | @@ -149,17 +151,35 @@ public class OnosJarDescription implements Description<OnosJarDescription.Arg>, |
| 149 | } | 151 | } |
| 150 | }); | 152 | }); |
| 151 | 153 | ||
| 154 | + JavadocJar.JavadocArgs.Builder javadocArgs = JavadocJar.JavadocArgs.builder() | ||
| 155 | + .addArg("-windowtitle", target.getShortName()) | ||
| 156 | + .addArg("-link", "http://docs.oracle.com/javase/8/docs/api") | ||
| 157 | + .addArg("-tag", "onos.rsModel:a:\"onos model\""); //FIXME from buckconfig + rule | ||
| 158 | + | ||
| 159 | + final ImmutableSortedMap.Builder<SourcePath, Path> javadocFiles = ImmutableSortedMap.naturalOrder(); | ||
| 160 | + if (args.javadocFiles.isPresent()) { | ||
| 161 | + for (SourcePath path : args.javadocFiles.get()) { | ||
| 162 | + javadocFiles.put(path, | ||
| 163 | + JavadocJar.getDocfileWithPath(pathResolver, path, args.javadocFilesRoot.orNull())); | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + | ||
| 152 | if (!flavors.contains(JavaLibrary.MAVEN_JAR)) { | 168 | if (!flavors.contains(JavaLibrary.MAVEN_JAR)) { |
| 153 | return new JavadocJar( | 169 | return new JavadocJar( |
| 154 | params, | 170 | params, |
| 155 | pathResolver, | 171 | pathResolver, |
| 156 | args.srcs.get(), | 172 | args.srcs.get(), |
| 173 | + javadocFiles.build(), | ||
| 174 | + javadocArgs.build(), | ||
| 157 | args.mavenCoords); | 175 | args.mavenCoords); |
| 158 | } else { | 176 | } else { |
| 159 | return MavenUberJar.MavenJavadocJar.create( | 177 | return MavenUberJar.MavenJavadocJar.create( |
| 160 | Preconditions.checkNotNull(paramsWithMavenFlavor), | 178 | Preconditions.checkNotNull(paramsWithMavenFlavor), |
| 161 | pathResolver, | 179 | pathResolver, |
| 162 | args.srcs.get(), | 180 | args.srcs.get(), |
| 181 | + javadocFiles.build(), | ||
| 182 | + javadocArgs.build(), | ||
| 163 | args.mavenCoords); | 183 | args.mavenCoords); |
| 164 | } | 184 | } |
| 165 | } | 185 | } | ... | ... |
tools/build/buck-plugin/src/main/java/org/onosproject/onosjar/ProjectJavadocDescription.java
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright 2016-present Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | +package org.onosproject.onosjar; | ||
| 17 | + | ||
| 18 | +import com.facebook.buck.cli.BuckConfig; | ||
| 19 | +import com.facebook.buck.jvm.java.JavaLibrary; | ||
| 20 | +import com.facebook.buck.jvm.java.JavadocJar; | ||
| 21 | +import com.facebook.buck.model.BuildTarget; | ||
| 22 | +import com.facebook.buck.model.Flavor; | ||
| 23 | +import com.facebook.buck.model.Flavored; | ||
| 24 | +import com.facebook.buck.model.Pair; | ||
| 25 | +import com.facebook.buck.parser.NoSuchBuildTargetException; | ||
| 26 | +import com.facebook.buck.rules.BuildRule; | ||
| 27 | +import com.facebook.buck.rules.BuildRuleParams; | ||
| 28 | +import com.facebook.buck.rules.BuildRuleResolver; | ||
| 29 | +import com.facebook.buck.rules.BuildRuleType; | ||
| 30 | +import com.facebook.buck.rules.Description; | ||
| 31 | +import com.facebook.buck.rules.SourcePath; | ||
| 32 | +import com.facebook.buck.rules.SourcePathResolver; | ||
| 33 | +import com.facebook.buck.rules.TargetGraph; | ||
| 34 | +import com.google.common.base.Optional; | ||
| 35 | +import com.google.common.base.Suppliers; | ||
| 36 | +import com.google.common.collect.FluentIterable; | ||
| 37 | +import com.google.common.collect.ImmutableList; | ||
| 38 | +import com.google.common.collect.ImmutableSet; | ||
| 39 | +import com.google.common.collect.ImmutableSortedMap; | ||
| 40 | +import com.google.common.collect.ImmutableSortedSet; | ||
| 41 | +import com.google.common.collect.Ordering; | ||
| 42 | + | ||
| 43 | +import java.nio.file.Path; | ||
| 44 | +import java.util.Map; | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * Description for the onos_jar rules. | ||
| 48 | + * | ||
| 49 | + * Currently, this only does Swagger generation. | ||
| 50 | + */ | ||
| 51 | +public class ProjectJavadocDescription implements Description<ProjectJavadocDescription.Arg>, Flavored { | ||
| 52 | + public static final BuildRuleType TYPE = BuildRuleType.of("project_javadoc"); | ||
| 53 | + | ||
| 54 | + public ProjectJavadocDescription(BuckConfig config) { | ||
| 55 | + //TODO | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + @Override | ||
| 59 | + public BuildRuleType getBuildRuleType() { | ||
| 60 | + return TYPE; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + @Override | ||
| 64 | + public Arg createUnpopulatedConstructorArg() { | ||
| 65 | + return new Arg(); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public <A extends Arg> BuildRule createBuildRule(TargetGraph targetGraph, | ||
| 70 | + BuildRuleParams params, | ||
| 71 | + BuildRuleResolver resolver, | ||
| 72 | + A args) | ||
| 73 | + throws NoSuchBuildTargetException { | ||
| 74 | + | ||
| 75 | + ImmutableSet.Builder<SourcePath> srcs = ImmutableSet.builder(); | ||
| 76 | + ImmutableSet.Builder<BuildRule> deps = ImmutableSet.builder(); | ||
| 77 | + ImmutableSortedMap.Builder<SourcePath, Path> docfiles = ImmutableSortedMap.naturalOrder(); | ||
| 78 | + for(BuildTarget dep : args.deps) { | ||
| 79 | + BuildRule rule = resolver.requireRule(dep.withFlavors(JavaLibrary.JAVADOC_JAR)); | ||
| 80 | + if (rule instanceof JavadocJar) { | ||
| 81 | + JavadocJar jarRule = (JavadocJar) rule; | ||
| 82 | + srcs.addAll(jarRule.getSources()); | ||
| 83 | + deps.addAll(jarRule.getDeps()); | ||
| 84 | + docfiles.putAll(jarRule.getDocFiles()); | ||
| 85 | + } else { | ||
| 86 | + throw new RuntimeException("rule is not a javalib"); //FIXME | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + BuildRuleParams newParams = params.copyWithDeps( | ||
| 91 | + Suppliers.ofInstance( | ||
| 92 | + FluentIterable.from(deps.build()) | ||
| 93 | + .toSortedSet(Ordering.<BuildRule>natural())), | ||
| 94 | + Suppliers.ofInstance(ImmutableSortedSet.<BuildRule>of())); | ||
| 95 | + | ||
| 96 | + SourcePathResolver sourceResolver = new SourcePathResolver(resolver); | ||
| 97 | + ImmutableList.Builder<SourcePath> auxSources = ImmutableList.builder(); | ||
| 98 | + | ||
| 99 | + JavadocJar.JavadocArgs.Builder javadocArgs = JavadocJar.JavadocArgs.builder() | ||
| 100 | + .addArg("-windowtitle", args.projectTitle) | ||
| 101 | + .addArg("-doctitle", args.projectTitle) | ||
| 102 | + .addArg("-link", "http://docs.oracle.com/javase/8/docs/api") | ||
| 103 | + .addArg("-tag", "onos.rsModel:a:\"onos model\""); //FIXME from buckconfig + rule | ||
| 104 | + | ||
| 105 | + if (args.groups.isPresent()) { | ||
| 106 | + for (Pair<String, ImmutableList<String>> pair : args.groups.get()) { | ||
| 107 | + javadocArgs.addArg("-group", pair.getFirst(), pair.getSecond()); | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + if (args.excludePackages.isPresent() && | ||
| 112 | + !args.excludePackages.get().isEmpty()) { | ||
| 113 | + javadocArgs.addArg("-exclude", args.excludePackages.get()); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + if (args.overview.isPresent()) { | ||
| 117 | + javadocArgs.addArg("-overview", | ||
| 118 | + sourceResolver.getAbsolutePath(args.overview.get()).toString()); | ||
| 119 | + | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + if (args.javadocFiles.isPresent()) { | ||
| 123 | + for (SourcePath path : args.javadocFiles.get()) { | ||
| 124 | + docfiles.put(path, | ||
| 125 | + JavadocJar.getDocfileWithPath(sourceResolver, path, args.javadocFilesRoot.orNull())); | ||
| 126 | + } | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + | ||
| 130 | + JavadocJar javadocJar = new JavadocJar(newParams, | ||
| 131 | + sourceResolver, | ||
| 132 | + ImmutableSortedSet.copyOf(srcs.build()), | ||
| 133 | + docfiles.build(), | ||
| 134 | + javadocArgs.build(), | ||
| 135 | + /* mavenCoords */ Optional.absent()); | ||
| 136 | + return javadocJar; | ||
| 137 | + | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + @Override | ||
| 141 | + public boolean hasFlavors(ImmutableSet<Flavor> flavors) { | ||
| 142 | + return false; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + public static class Arg { | ||
| 146 | + public ImmutableSortedSet<BuildTarget> deps; | ||
| 147 | + public String projectTitle; | ||
| 148 | + | ||
| 149 | + public Optional<SourcePath> overview; | ||
| 150 | + public Optional<ImmutableSortedSet<SourcePath>> javadocFiles; | ||
| 151 | + public Optional<Path> javadocFilesRoot; | ||
| 152 | + | ||
| 153 | + public Optional<ImmutableList<String>> excludePackages; | ||
| 154 | + public Optional<ImmutableList<Pair<String, ImmutableList<String>>>> groups; | ||
| 155 | + } | ||
| 156 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment