Updated to build and test with Bazel 1.0 official release.

Change-Id: Ie47df8a3a11aeeb11b6c5f43cc1608827f8ddf8f
diff --git a/.bazelrc b/.bazelrc
index 5ff2635..3cc21a2 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -26,6 +26,8 @@
 # intellij-bazel plugin needs this
 build --incompatible_depset_is_not_iterable=false
 build --incompatible_new_actions_api=false
+build --incompatible_generated_protos_in_virtual_imports=false
+build --incompatible_depset_union=false
 
 test --test_summary=terse
 test --test_output=errors
diff --git a/WORKSPACE b/WORKSPACE
index a75dd90..f94f4d3 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -117,9 +117,10 @@
 # See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
 http_archive(
     name = "io_bazel_rules_go",
-    sha256 = "f04d2373bcaf8aa09bccb08a98a57e721306c8f6043a2a0ee610fd6853dcde3d",
+    sha256 = "9fb16af4d4836c8222142e54c9efa0bb5fc562ffc893ce2abeac3e25daead144",
     urls = [
-        "https://github.com/bazelbuild/rules_go/releases/download/0.18.6/rules_go-0.18.6.tar.gz",
+        "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
+        "https://github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
     ],
 )
 
@@ -130,12 +131,30 @@
 go_register_toolchains()
 
 http_archive(
-    name = "com_github_bazelbuild_buildtools",
-    sha256 = "e0b5b400cfef17d65886365dc7289cb4ef8dfe07066165607413a271a32aa2a4",
-    strip_prefix = "buildtools-db073457c5a56d810e46efc18bb93a4fd7aa7b5e",
-    url = "https://github.com/bazelbuild/buildtools/archive/db073457c5a56d810e46efc18bb93a4fd7aa7b5e.zip",
+    name = "bazel_gazelle",
+    sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
+    urls = [
+        "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
+        "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
+    ],
 )
 
-load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")
+load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
 
-buildifier_dependencies()
+gazelle_dependencies()
+
+http_archive(
+    name = "com_google_protobuf",
+    strip_prefix = "protobuf-master",
+    urls = ["https://github.com/protocolbuffers/protobuf/archive/master.zip"],
+)
+
+load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
+
+protobuf_deps()
+
+http_archive(
+    name = "com_github_bazelbuild_buildtools",
+    strip_prefix = "buildtools-master",
+    url = "https://github.com/bazelbuild/buildtools/archive/master.zip",
+)
diff --git a/core/protobuf/models/proto/BUILD b/core/protobuf/models/proto/BUILD
index 6c7d5cd..2da22b8 100644
--- a/core/protobuf/models/proto/BUILD
+++ b/core/protobuf/models/proto/BUILD
@@ -1,6 +1,6 @@
 load("//tools/build/bazel:osgi_java_library.bzl", "osgi_proto_jar")
 
-PROTO_SOURCE_ROOT = "core/protobuf/models/proto"
+PROTO_SOURCE_ROOT = "/core/protobuf/models/proto"
 
 osgi_proto_jar(
     name = "onos-core-protobuf-models-proto",
@@ -67,20 +67,20 @@
 proto_library(
     name = "ApplicationsEnums_proto",
     srcs = ["app/ApplicationEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 ### cfg ###
 proto_library(
     name = "ConfigPropertyEnums_proto",
     srcs = ["cfg/ConfigPropertyEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "ConfigProperty_proto",
     srcs = ["cfg/ConfigPropertyProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":ConfigPropertyEnums_proto"],
 )
 
@@ -88,13 +88,13 @@
 proto_library(
     name = "NodeId_proto",
     srcs = ["cluster/NodeIdProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "RoleInfo_proto",
     srcs = ["cluster/RoleInfoProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":NodeId_proto"],
 )
 
@@ -103,13 +103,13 @@
 proto_library(
     name = "ApplicationId_proto",
     srcs = ["core/ApplicationIdProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "ApplicationProto_proto",
     srcs = ["core/ApplicationProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ApplicationId_proto",
         ":ApplicationsEnums_proto",
@@ -121,7 +121,7 @@
 proto_library(
     name = "Version_proto",
     srcs = ["core/VersionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 ### net ###
@@ -130,20 +130,20 @@
 proto_library(
     name = "DeviceDescription_proto",
     srcs = ["net/device/DeviceDescriptionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":DeviceEnums_proto"],
 )
 
 proto_library(
     name = "DeviceEnums_proto",
     srcs = ["net/device/DeviceEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "DeviceEvent_proto",
     srcs = ["net/device/DeviceEventProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":DeviceEnums_proto",
         ":Device_proto",
@@ -154,20 +154,20 @@
 proto_library(
     name = "PortDescription_proto",
     srcs = ["net/device/PortDescriptionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":PortEnums_proto"],
 )
 
 proto_library(
     name = "PortEnums_proto",
     srcs = ["net/device/PortEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "PortStatistics_proto",
     srcs = ["net/device/PortStatisticsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 ### flow ###
@@ -175,45 +175,45 @@
 proto_library(
     name = "Criterion_proto",
     srcs = ["net/flow/criteria/CriterionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 ## instrcutions ##
 proto_library(
     name = "Instruction_proto",
     srcs = ["net/flow/instructions/InstructionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "Instructions_proto",
     srcs = ["net/flow/instructions/InstructionsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "FlowEntryEnums_proto",
     srcs = ["net/flow/FlowEntryEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "FlowEntry_proto",
     srcs = ["net/flow/FlowEntryProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":FlowEntryEnums_proto"],
 )
 
 proto_library(
     name = "FlowRuleEnums_proto",
     srcs = ["net/flow/FlowRuleEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "FlowRule_proto",
     srcs = ["net/flow/FlowRuleProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":FlowRuleEnums_proto",
         ":TrafficTreatment_proto",
@@ -224,14 +224,14 @@
 proto_library(
     name = "TraficSelector_proto",
     srcs = ["net/flow/TrafficSelectorProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":Criterion_proto"],
 )
 
 proto_library(
     name = "TrafficTreatment_proto",
     srcs = ["net/flow/TrafficTreatmentProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":Instruction_proto",
         ":Instructions_proto",
@@ -243,20 +243,20 @@
 proto_library(
     name = "HostDescription_proto",
     srcs = ["net/host/HostDescriptionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":HostLocation_proto"],
 )
 
 proto_library(
     name = "HostEnums_proto",
     srcs = ["net/host/HostEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "HostEvent_proto",
     srcs = ["net/host/HostEventProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":HostEnums_proto",
         ":Host_proto",
@@ -268,7 +268,7 @@
 proto_library(
     name = "LinkDescription_proto",
     srcs = ["net/link/LinkDescriptionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ConnectPoint_proto",
         ":LinkEnums_proto",
@@ -278,13 +278,13 @@
 proto_library(
     name = "LinkEnums_proto",
     srcs = ["net/link/LinkEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "LinkEvent_proto",
     srcs = ["net/link/LinkEventProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":LinkEnums_proto",
         ":Link_proto",
@@ -296,26 +296,26 @@
 proto_library(
     name = "BandEnums_proto",
     srcs = ["net/meter/BandEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "Band_proto",
     srcs = ["net/meter/BandProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":BandEnums_proto"],
 )
 
 proto_library(
     name = "MeterEnums_proto",
     srcs = ["net/meter/MeterEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "MeterEvent_proto",
     srcs = ["net/meter/MeterEventProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":MeterEnums_proto",
         ":Meter_proto",
@@ -325,7 +325,7 @@
 proto_library(
     name = "Meter_proto",
     srcs = ["net/meter/MeterProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ApplicationId_proto",
         ":Band_proto",
@@ -336,7 +336,7 @@
 proto_library(
     name = "MeterRequest_proto",
     srcs = ["net/meter/MeterRequestProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ApplicationId_proto",
         ":Band_proto",
@@ -349,20 +349,20 @@
 proto_library(
     name = "OutboundPacket_proto",
     srcs = ["net/packet/OutboundPacketProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":TrafficTreatment_proto"],
 )
 
 proto_library(
     name = "PacketEnums_proto",
     srcs = ["net/packet/PacketEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "PacketEvent_proto",
     srcs = ["net/packet/PacketEventProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":OutboundPacket_proto",
         ":PacketEnums_proto",
@@ -372,20 +372,20 @@
 proto_library(
     name = "PacketProcessorEntry_proto",
     srcs = ["net/packet/PacketProcessorEntryProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":PacketProcessor_proto"],
 )
 
 proto_library(
     name = "PacketProcessor_proto",
     srcs = ["net/packet/PacketProcessorProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "PacketRequest_proto",
     srcs = ["net/packet/PacketRequestProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ApplicationId_proto",
         ":NodeId_proto",
@@ -398,46 +398,46 @@
 proto_library(
     name = "RegionEnums_proto",
     srcs = ["net/region/RegionEnumsProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "ConnectPoint_proto",
     srcs = ["net/ConnectPointProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "Device_proto",
     srcs = ["net/DeviceProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":DeviceEnums_proto"],
 )
 
 proto_library(
     name = "DisjointPath_proto",
     srcs = ["net/DisjointPathProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":Path_proto"],
 )
 
 proto_library(
     name = "HostId_proto",
     srcs = ["net/HostIdProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "HostLocation_proto",
     srcs = ["net/HostLocationProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":ConnectPoint_proto"],
 )
 
 proto_library(
     name = "Host_proto",
     srcs = ["net/HostProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":HostId_proto",
         ":HostLocation_proto",
@@ -448,7 +448,7 @@
 proto_library(
     name = "Link_proto",
     srcs = ["net/LinkProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [
         ":ConnectPoint_proto",
         ":LinkEnums_proto",
@@ -459,38 +459,38 @@
 proto_library(
     name = "MastershipRole_proto",
     srcs = ["net/MastershipRoleProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "Path_proto",
     srcs = ["net/PathProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":Link_proto"],
 )
 
 proto_library(
     name = "Port_proto",
     srcs = ["net/PortProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":PortEnums_proto"],
 )
 
 proto_library(
     name = "ProviderId_proto",
     srcs = ["net/ProviderIdProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
 
 proto_library(
     name = "Region_proto",
     srcs = ["net/RegionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
     deps = [":RegionEnums_proto"],
 )
 
 proto_library(
     name = "Permission_proto",
     srcs = ["security/PermissionProto.proto"],
-    proto_source_root = PROTO_SOURCE_ROOT,
+    strip_import_prefix = PROTO_SOURCE_ROOT,
 )
diff --git a/tools/build/bazel/bazel_version.bzl b/tools/build/bazel/bazel_version.bzl
index 9a0046e..5ee5489 100644
--- a/tools/build/bazel/bazel_version.bzl
+++ b/tools/build/bazel/bazel_version.bzl
@@ -22,6 +22,6 @@
         return
 
     versions = native.bazel_version.split(".")
-    if not int(versions[1]) >= 27:
-        fail("\nBazel version %s is not supported; please use 0.27.* official release!\n\n" %
+    if not int(versions[0]) >= 1:
+        fail("\nBazel version %s is not supported; please use 1.0.* official release!\n\n" %
              native.bazel_version)
diff --git a/tools/build/bazel/protobuf_workspace.bzl b/tools/build/bazel/protobuf_workspace.bzl
index 98e31be..e7dc063 100644
--- a/tools/build/bazel/protobuf_workspace.bzl
+++ b/tools/build/bazel/protobuf_workspace.bzl
@@ -1,7 +1,7 @@
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
-PROTOBUF_VERSION = "3.9.0"
-SHA = "8eb5ca331ab8ca0da2baea7fc0607d86c46c80845deca57109a5d637ccb93bb4"
+PROTOBUF_VERSION = "3.10.0"
+SHA = "33cba8b89be6c81b1461f1c438424f7a1aa4e31998dbe9ed6f8319583daac8c7"
 
 def generate_protobuf():
     http_archive(