Initial builds using bazel
Change-Id: I38123b396a2ffda5f36cdca43f3ad1fa67a7ab52
diff --git a/core/api/BUILD b/core/api/BUILD
new file mode 100644
index 0000000..be731ad
--- /dev/null
+++ b/core/api/BUILD
@@ -0,0 +1,27 @@
+COMPILE_DEPS = COMPILE + NETTY + JACKSON + METRICS + KRYO + [
+ '//utils/misc:onlab-misc',
+ '//utils/osgi:onlab-osgi',
+ '//utils/rest:onlab-rest',
+ '@joda_time//jar',
+ '@netty//jar',
+]
+
+osgi_jar_with_tests (
+ name = 'onos-api',
+ deps = COMPILE_DEPS,
+ exclude_tests = [
+ 'org.onosproject.net.config.basics.AbstractConfigTest',
+ 'org.onosproject.net.driver.AbstractDriverLoaderTest',
+ 'org.onosproject.net.intent.AbstractIntentTest',
+ 'org.onosproject.net.intent.ConnectivityIntentTest',
+ 'org.onosproject.net.intent.IntentTest',
+ 'org.onosproject.net.pi.runtime.PiConstantsTest',
+ 'org.onosproject.security.SecurityUtilTest',
+ 'org.onosproject.ui.AbstractUiTest',
+ 'org.onosproject.ui.model.AbstractUiModelTest',
+ 'org.onosproject.net.behaviour.QosIdTest',
+ ],
+ visibility = ["//visibility:public"],
+ #javadoc_files = glob(['src/main/javadoc/**/*']),
+ #javadoc_files_root = 'src/main/javadoc',
+)
diff --git a/core/api/src/main/java/org/onosproject/net/intent/IntentData.java b/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
index bb7a710..cad48ab 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
@@ -457,6 +457,7 @@
} else if (currentState == INSTALLED) {
return true;
}
+ // FALLTHROUGH
case INSTALLED:
if (currentState == INSTALLED) {
return false;
diff --git a/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java b/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
index 47aa94d..fd3d457 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
@@ -142,11 +142,10 @@
type = Type.PURGED;
break;
- // fallthrough to default from here
- case COMPILING:
- case INSTALLING:
- case RECOMPILING:
- case WITHDRAWING:
+ case COMPILING: // FALLTHROUGH
+ case INSTALLING: // FALLTHROUGH
+ case RECOMPILING: // FALLTHROUGH
+ case WITHDRAWING: // FALLTHROUGH
default:
return Optional.empty();
}
diff --git a/core/common/BUILD b/core/common/BUILD
new file mode 100644
index 0000000..7e4e557
--- /dev/null
+++ b/core/common/BUILD
@@ -0,0 +1,11 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + METRICS + [
+ '//incubator/api:onos-incubator-api',
+]
+
+TEST_DEPS = TEST + ['//core/api:onos-api-tests']
+
+osgi_jar_with_tests (
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+ visibility = ["//visibility:public"],
+)
diff --git a/core/store/dist/BUILD b/core/store/dist/BUILD
new file mode 100644
index 0000000..0608650
--- /dev/null
+++ b/core/store/dist/BUILD
@@ -0,0 +1,28 @@
+COMPILE_DEPS = CORE_DEPS + NETTY + JACKSON + KRYO + [
+ '//core/common:onos-core-common',
+ '//utils/rest:onlab-rest',
+ '//core/store/serializers:onos-core-serializers',
+ '@netty_transport//jar',
+ '@netty_codec//jar',
+ '@netty_handler//jar',
+ '@netty_transport_native_epoll//jar',
+ '@netty_resolver//jar',
+ '@commons_math3//jar',
+ '//incubator/api:onos-incubator-api',
+]
+
+TEST_DEPS = TEST + [
+ '//core/api:onos-api-tests',
+ '//core/common:onos-core-common-tests',
+]
+
+osgi_jar_with_tests (
+ name = 'onos-core-dist',
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+ exclude_tests = [
+ 'org.onosproject.store.link.impl.ECLinkStoreTest',
+ 'org.onosproject.store.flow.impl.DistributedFlowRuleStoreTest',
+ ],
+ visibility = ["//visibility:public"],
+)
diff --git a/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java b/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
index bdf5cdf..4b9ef6c 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
@@ -69,32 +69,41 @@
case READ_SENDER_IP_VERSION:
ipVersion = buffer.readByte() == 0x0 ? Version.INET : Version.INET6;
checkpoint(DecoderState.READ_SENDER_IP);
+ // FALLTHROUGH
case READ_SENDER_IP:
byte[] octets = new byte[IpAddress.byteLength(ipVersion)];
buffer.readBytes(octets);
senderIp = IpAddress.valueOf(ipVersion, octets);
checkpoint(DecoderState.READ_SENDER_PORT);
+ // FALLTHROUGH
case READ_SENDER_PORT:
senderPort = buffer.readInt();
checkpoint(DecoderState.READ_TYPE);
+ // FALLTHROUGH
case READ_TYPE:
type = InternalMessage.Type.forId(buffer.readByte());
checkpoint(DecoderState.READ_PREAMBLE);
+ // FALLTHROUGH
case READ_PREAMBLE:
preamble = buffer.readInt();
checkpoint(DecoderState.READ_LOGICAL_TIME);
+ // FALLTHROUGH
case READ_LOGICAL_TIME:
logicalTime = buffer.readLong();
checkpoint(DecoderState.READ_LOGICAL_COUNTER);
+ // FALLTHROUGH
case READ_LOGICAL_COUNTER:
logicalCounter = buffer.readLong();
checkpoint(DecoderState.READ_MESSAGE_ID);
+ // FALLTHROUGH
case READ_MESSAGE_ID:
messageId = buffer.readLong();
checkpoint(DecoderState.READ_CONTENT_LENGTH);
+ // FALLTHROUGH
case READ_CONTENT_LENGTH:
contentLength = buffer.readInt();
checkpoint(DecoderState.READ_CONTENT);
+ // FALLTHROUGH
case READ_CONTENT:
if (contentLength > 0) {
//TODO Perform a sanity check on the size before allocating
@@ -125,6 +134,7 @@
case READ_SUBJECT_LENGTH:
subjectLength = buffer.readShort();
checkpoint(DecoderState.READ_SUBJECT);
+ // FALLTHROUGH
case READ_SUBJECT:
byte[] messageTypeBytes = new byte[subjectLength];
buffer.readBytes(messageTypeBytes);
diff --git a/core/store/serializers/BUILD b/core/store/serializers/BUILD
new file mode 100644
index 0000000..83c05e3
--- /dev/null
+++ b/core/store/serializers/BUILD
@@ -0,0 +1,12 @@
+COMPILE_DEPS = CORE_DEPS + KRYO + [
+ '//incubator/api:onos-incubator-api',
+]
+
+TEST_DEPS = TEST
+
+osgi_jar_with_tests (
+ name = 'onos-core-serializers',
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+ visibility = ["//visibility:public"],
+)