Re-enabling Swagger stuff and preparing to integrate cfgdef stuff.
Change-Id: Ic6a3718396048bf5e4d5bcf2978f6a61c64164f3
diff --git a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
index 963bac6..2914965 100644
--- a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
+++ b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
@@ -157,18 +157,22 @@
//@Property(name = PROP_ENABLED, boolValue = true,
// label = "If false, link discovery is disabled")
+ /** If false, link discovery is disabled. */
protected boolean enabled = false;
//@Property(name = PROP_USE_BDDP, boolValue = true,
// label = "Use BDDP for link discovery")
+ /** Use BDDP for link discovery. */
protected boolean useBddp = USE_BDDP_DEFAULT;
//@Property(name = PROP_PROBE_RATE, intValue = DEFAULT_PROBE_RATE,
// label = "LLDP and BDDP probe rate specified in millis")
+ /** LLDP and BDDP probe rate specified in millis. */
protected int probeRate = PROBE_RATE_DEFAULT;
//@Property(name = PROP_STALE_LINK_AGE, intValue = DEFAULT_STALE_LINK_AGE,
// label = "Number of millis beyond which links will be considered stale")
+ /** Number of millis beyond which links will be considered stale. */
protected int staleLinkAge = STALE_LINK_AGE_DEFAULT;
//@Property(name = PROP_DISCOVERY_DELAY, intValue = DEFAULT_DISCOVERY_DELAY,
diff --git a/tools/build/bazel/osgi_java_library.bzl b/tools/build/bazel/osgi_java_library.bzl
index 91ecc850..0014eb8 100644
--- a/tools/build/bazel/osgi_java_library.bzl
+++ b/tools/build/bazel/osgi_java_library.bzl
@@ -169,6 +169,45 @@
)
"""
+ Implementation of the rule to generate cfgdef files from java class source
+"""
+
+def _cfgdef_impl(ctx):
+ output_jar = ctx.outputs.cfgdef_jar.path
+
+ # call swagger generator to make the swagger JSON and java files
+ arguments = [
+ output_jar,
+ ctx.files.srcs,
+ ]
+
+ ctx.actions.run(
+ inputs = ctx.files.srcs,
+ outputs = [ctx.outputs.cfgdef_jar],
+ arguments = arguments,
+ progress_message = "Running cfgdef generator on: %s" % ctx.attr.name,
+ executable = ctx.executable._cfgdef_generator_exe,
+ )
+
+"""
+ Rule definition to call cfgdef generator to create the *.cfgdef files from java sources
+"""
+_cfgdef = rule(
+ attrs = {
+ "srcs": attr.label_list(allow_files = True),
+ "_cfgdef_generator_exe": attr.label(
+ executable = True,
+ cfg = "host",
+ allow_files = True,
+ default = Label("//tools/build/cfgdef:cfgdef_generator"),
+ ),
+ "cfgdef_jar": attr.output(),
+ },
+ fragments = ["java"],
+ implementation = _cfgdef_impl,
+)
+
+"""
Implementation of the rule to call swagger generator to create the registrator java class source
"""
@@ -414,7 +453,15 @@
native_srcs = srcs
native_resources = resources
- if web_context != None and api_title != "" and len(resources) != 0 and 1 == 0:
+
+ # _cfgdef(
+ # name = name + "_cfgdef",
+ # srcs = native_srcs,
+ # visibility = visibility,
+ # )
+ # native_resources.append(name + "_cfgdef_jar")
+
+ if web_context != None and api_title != "" and len(resources) != 0:
# generate Swagger files if needed
_swagger_java(
name = name + "_swagger_java",
diff --git a/tools/build/buck-plugin/src/main/resources/registrator.javat b/tools/build/buck-plugin/src/main/resources/registrator.javat
index 6596450..aa1d44f 100644
--- a/tools/build/buck-plugin/src/main/resources/registrator.javat
+++ b/tools/build/buck-plugin/src/main/resources/registrator.javat
@@ -18,7 +18,7 @@
*/
package ${api.package};
-import org.apache.felix.scr.annotations.Component;
+import org.osgi.service.component.annotations.Component;
import org.onosproject.rest.AbstractApiDocRegistrator;
import org.onosproject.rest.ApiDocProvider;