bazel implementation of the bucklet for ATOMIX primitives

Change-Id: I0db54c031856d55cefe0fa8ab67237ed5a787595
diff --git a/core/store/primitives/BUILD b/core/store/primitives/BUILD
index 1c28b3e..1d726e8 100644
--- a/core/store/primitives/BUILD
+++ b/core/store/primitives/BUILD
@@ -13,9 +13,51 @@
     "//core/api:onos-api-tests",
 ]
 
+_primitive_package_names = [
+    'barrier',
+    'collection',
+    'counter',
+    'election',
+    'idgenerator',
+    'iterator',
+    'list',
+    'lock',
+    'map',
+    'multimap',
+    'multiset',
+    'queue',
+    'semaphore',
+    'set',
+    'transaction',
+    'tree',
+    'value',
+    'workqueue',
+]
+
+# A list of all core primitive packages for dynamic class loading
+PRIMITIVE_PACKAGES = ','.join(['io.atomix.primitive.session.impl'] + ['io.atomix.core.{primitive},io.atomix.core.{primitive}.impl'.format(primitive=primitive) for primitive in _primitive_package_names])
+
+# Base package names for core Atomix protocols
+_protocol_package_names = [
+    'raft',
+    'backup',
+]
+
+# A list of all core protocol packages for dynamic class loading
+PROTOCOL_PACKAGES = ','.join(['io.atomix.primitive.partition.impl'] + ['io.atomix.protocols.{protocol},io.atomix.protocols.{protocol}.partition'.format(protocol=protocol) for protocol in _protocol_package_names] + ['io.atomix.protocols.gossip'])
+
+# A list of all additional core packages used in dynamic class loading
+CORE_PACKAGES = ','.join(['io.atomix.core.profile', 'io.atomix.core.profile.impl'])
+
+# A list of all dynamically loadable Atomix packages
+INCLUDE_PACKAGES = ','.join([PRIMITIVE_PACKAGES, PROTOCOL_PACKAGES, CORE_PACKAGES])
+
+ALL_PACKAGES = '*'
+
 osgi_jar_with_tests(
     name = "onos-core-primitives",
     test_deps = TEST_DEPS,
     visibility = ["//visibility:public"],
     deps = COMPILE_DEPS,
+    import_packages = INCLUDE_PACKAGES + ',' + ALL_PACKAGES,
 )
diff --git a/tools/package/features/BUILD b/tools/package/features/BUILD
index 1afed71..6b6aaf1 100644
--- a/tools/package/features/BUILD
+++ b/tools/package/features/BUILD
@@ -10,8 +10,7 @@
 osgi_feature(
     name = "onos-thirdparty-base",
     description = "ONOS 3rd party dependencies",
-    included_bundles = [
-        "@atomix//jar",
+    included_bundles = ATOMIX + [
         "@commons_lang//jar",
         "@commons_lang3//jar",
         "@commons_text//jar",
@@ -40,7 +39,6 @@
         "@jackson_annotations//jar",
         "@jackson_databind//jar",
         "@commons_collections//jar",
-        "@typesafe_config//jar",
         "@concurrent_trees//jar",
         "@commons_io//jar",
         "@mapdb//jar",