Repository: incubator-edgent
Updated Branches:
  refs/heads/master b4e2f5a51 -> 8fbe5fd82


Edgent-240 [gradle] [WIP] Overhaul dependency specification and handling

The upshot is to do like the ant-based scripts and specify
inter-project, core-ext, and project-private-ext
dependencies against jars in the target dir.
The original conversion specified on inter-project dependencies on
"projects" (hence their artifacts not in the target-dir) and that caused
a host of issues.

With the changes things like manifest-classpath generation are
simplified and overall the gradle build now adhears to the policies:
- Edgent projects depend on other project's jars in the target-dir, not
their classes
- Edgent project jars have a manifest-classpath that handles the
project's "private" inter-project dependencies as well as the project's
"private" external component dependencies.
- We build a target dir that includes the project's jar as well as the
project's external dependency jars
- The tests compile and run against the project jars in the target dir
(as external/integration test code would).  Well bit more to do there.
- The samples compile and run against the project jars in the target dir
(as user code would).

All seems fine including when building and testing with
ANDROID_SDK_PLATFORM and DERBY_HOME set:
- all tests pass (sans manual run of kafka tests)
- sample scripts seem to run appropriately
- console comes up

TODOs
- look into javadoc task warnings
- test's classpath is still including its project's build/main/classes
- edgent.android.{topology,hardware}.jar manifest classpath and the
"android.jar" - compared to ant-build?


More details of the changes...

- define addTargetDirProjectJarDependency(),
addTargetDirExtJarDependency(), addTargetDirCoreExtDependency(),
addTargetDirCoreExtDependencies(), addProjectExtDependency()
- change all build.gradle to use them
- configure common sample dependencies in root build.gradle
- adapt manifest classpath generation in light of above
- rework how common_ext_dependencies files get added to target-dir/ext

Other cleanup,etc
- generate project jar/war directly into targetdir with the correct name
(remove "copy/rename" of jar created by default far task)
- fix ant -> gradle conversion of api/function project
- add previously (benign) absent api/function dependency from
api/topology
- remove updateTargetDir task -- just add processing as "doLast" to the
assemble task
- other root build.gradle refactoring for hygiene
- fix issues caused by kafka's transitive dependencies
- update connectors:iotp to watson-iot:0.1.5 - initial motivation was to
cleanup the fact that 0.1.1 had dependency on a mqttv3 SNAPSHOT version


Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/a08252e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/a08252e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/a08252e1

Branch: refs/heads/master
Commit: a08252e10ad00c26892723dc1d87b1d980b2923b
Parents: 516caa8
Author: Dale LaBossiere <dlab...@us.ibm.com>
Authored: Wed Sep 14 15:00:46 2016 -0400
Committer: Dale LaBossiere <dlab...@us.ibm.com>
Committed: Wed Sep 14 15:00:46 2016 -0400

----------------------------------------------------------------------
 analytics/math3/build.gradle                    |  10 +-
 analytics/sensors/build.gradle                  |   8 +-
 android/hardware/build.gradle                   |   4 +-
 android/topology/build.gradle                   |   6 +-
 api/execution/build.gradle                      |   6 +-
 api/function/build.gradle                       |   5 +-
 api/graph/build.gradle                          |   6 +-
 api/oplet/build.gradle                          |  10 +-
 api/topology/build.gradle                       |  11 +-
 api/window/build.gradle                         |   6 +-
 apps/iot/build.gradle                           |  10 +-
 apps/runtime/build.gradle                       |  12 +-
 build.gradle                                    | 485 +++++++++----------
 connectors/command/build.gradle                 |   9 +-
 connectors/common/build.gradle                  |   8 +-
 connectors/csv/build.gradle                     |   8 +-
 connectors/edgent.javax.websocket/build.gradle  |   5 +-
 connectors/file/build.gradle                    |   8 +-
 connectors/http/build.gradle                    |  12 +-
 connectors/iot/build.gradle                     |   8 +-
 connectors/iotp/build.gradle                    |  12 +-
 connectors/javax.websocket-client/build.gradle  |   7 +-
 connectors/javax.websocket-server/build.gradle  |   7 +-
 connectors/jdbc/build.gradle                    |   8 +-
 connectors/kafka/build.gradle                   |  31 +-
 connectors/mqtt/build.gradle                    |  13 +-
 connectors/pubsub/build.gradle                  |   8 +-
 connectors/serial/build.gradle                  |   8 +-
 .../wsclient-javax.websocket/build.gradle       |  18 +-
 connectors/wsclient/build.gradle                |   8 +-
 console/server/build.gradle                     |  22 +-
 console/servlets/build.gradle                   |  15 +-
 providers/development/build.gradle              |  12 +-
 providers/direct/build.gradle                   |  19 +-
 providers/iot/build.gradle                      |  16 +-
 runtime/appservice/build.gradle                 |   8 +-
 runtime/etiao/build.gradle                      |  10 +-
 runtime/jmxcontrol/build.gradle                 |   8 +-
 runtime/jobregistry/build.gradle                |   8 +-
 runtime/jsoncontrol/build.gradle                |   8 +-
 samples/apps/build.gradle                       |  21 +-
 samples/connectors/build.gradle                 |  26 +-
 samples/console/build.gradle                    |  11 +-
 samples/scenarios/build.gradle                  |  19 +-
 samples/topology/build.gradle                   |  16 +-
 samples/utils/build.gradle                      |  15 +-
 scripts/connectors/mqtt/mqtt.properties         |   1 +
 settings.gradle                                 |   3 +
 spi/graph/build.gradle                          |   8 +-
 spi/topology/build.gradle                       |   6 +-
 test/fvtiot/build.gradle                        |  10 +-
 test/svt/build.gradle                           |  13 +-
 utils/metrics/build.gradle                      |   6 +-
 utils/streamscope/build.gradle                  |   6 +-
 54 files changed, 552 insertions(+), 492 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/analytics/math3/build.gradle
----------------------------------------------------------------------
diff --git a/analytics/math3/build.gradle b/analytics/math3/build.gradle
index 1a6f47c..65027cc 100644
--- a/analytics/math3/build.gradle
+++ b/analytics/math3/build.gradle
@@ -12,10 +12,12 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile 'org.apache.commons:commons-math3:3.4.1'
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addProjectExtDependency 'compile', 'org.apache.commons:commons-math3:3.4.1'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/analytics/sensors/build.gradle
----------------------------------------------------------------------
diff --git a/analytics/sensors/build.gradle b/analytics/sensors/build.gradle
index c15c7ef..36b0207 100644
--- a/analytics/sensors/build.gradle
+++ b/analytics/sensors/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/android/hardware/build.gradle
----------------------------------------------------------------------
diff --git a/android/hardware/build.gradle b/android/hardware/build.gradle
index 75dadec..a8d2d45 100644
--- a/android/hardware/build.gradle
+++ b/android/hardware/build.gradle
@@ -16,8 +16,10 @@
 // based on System.env.ANDROID_SDK_PLATFORM
 
 dependencies {
-  compile project(':api:topology')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
   compile files("${System.env.ANDROID_SDK_PLATFORM}/android.jar")
+  
+  // N.B. root project adds test common dependencies
 }
 
 test {

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/android/topology/build.gradle
----------------------------------------------------------------------
diff --git a/android/topology/build.gradle b/android/topology/build.gradle
index 2d3ece9..32c9975 100644
--- a/android/topology/build.gradle
+++ b/android/topology/build.gradle
@@ -16,9 +16,11 @@
 // based on System.env.ANDROID_SDK_PLATFORM
 
 dependencies {
-  compile project(':api:topology')
-  compile project(':api:oplet')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':api:oplet'
   compile files("${System.env.ANDROID_SDK_PLATFORM}/android.jar")
+
+  // N.B. root project adds test common dependencies
 }
 
 test {

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/execution/build.gradle
----------------------------------------------------------------------
diff --git a/api/execution/build.gradle b/api/execution/build.gradle
index d136bd0..5a741ca 100644
--- a/api/execution/build.gradle
+++ b/api/execution/build.gradle
@@ -12,6 +12,8 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:function')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/function/build.gradle
----------------------------------------------------------------------
diff --git a/api/function/build.gradle b/api/function/build.gradle
index 332495b..8e3df4b 100644
--- a/api/function/build.gradle
+++ b/api/function/build.gradle
@@ -11,6 +11,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 dependencies {
-  compile core_ext_dependencies
+  // none
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/graph/build.gradle
----------------------------------------------------------------------
diff --git a/api/graph/build.gradle b/api/graph/build.gradle
index 373be70..b294214 100644
--- a/api/graph/build.gradle
+++ b/api/graph/build.gradle
@@ -12,8 +12,10 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:oplet')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:oplet'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 test {

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/oplet/build.gradle
----------------------------------------------------------------------
diff --git a/api/oplet/build.gradle b/api/oplet/build.gradle
index 9438108..f9b89e8 100644
--- a/api/oplet/build.gradle
+++ b/api/oplet/build.gradle
@@ -12,8 +12,10 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:function')
-  compile project(':api:execution')
-  compile project(':api:window')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:window'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/topology/build.gradle
----------------------------------------------------------------------
diff --git a/api/topology/build.gradle b/api/topology/build.gradle
index 75df1df..3d8b5d7 100644
--- a/api/topology/build.gradle
+++ b/api/topology/build.gradle
@@ -12,10 +12,13 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:graph')
-  compile project(':api:oplet')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirProjectJarDependency 'compile', ':api:graph'
+  addTargetDirProjectJarDependency 'compile', ':api:oplet'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 //Build a jar file containing the applications to test the ApplicationService

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/api/window/build.gradle
----------------------------------------------------------------------
diff --git a/api/window/build.gradle b/api/window/build.gradle
index d136bd0..5a741ca 100644
--- a/api/window/build.gradle
+++ b/api/window/build.gradle
@@ -12,6 +12,8 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:function')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/apps/iot/build.gradle
----------------------------------------------------------------------
diff --git a/apps/iot/build.gradle b/apps/iot/build.gradle
index 4cc6355..8e9c63d 100644
--- a/apps/iot/build.gradle
+++ b/apps/iot/build.gradle
@@ -12,8 +12,10 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':connectors:pubsub')
-  compile project(':connectors:iot')
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':connectors:pubsub'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iot'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/apps/runtime/build.gradle
----------------------------------------------------------------------
diff --git a/apps/runtime/build.gradle b/apps/runtime/build.gradle
index 500e132..1a7b60d 100644
--- a/apps/runtime/build.gradle
+++ b/apps/runtime/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':runtime:jobregistry')
-  compile project(':runtime:appservice')
-  testCompile project(':providers:direct')
-  testCompile project(':runtime:jmxcontrol')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jobregistry'
+  addTargetDirProjectJarDependency 'compile', ':runtime:appservice'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  addTargetDirProjectJarDependency 'testCompile', ':runtime:jmxcontrol'
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a2fc91b..5eee9ac 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,11 +21,6 @@ allprojects {
 
   repositories {
     mavenCentral()
-    maven {
-      // TODO - is this the right repo to use?
-      // related?... watson-iot-0.1.1.jar ends up referencing 
org.eclipse.paho.client.mqttv3-1.0.3-SNAPSHOT.jar
-      url 'https://repo.eclipse.org/content/repositories/paho-snapshots/'
-    }
   }
   
   project.version = build_version
@@ -78,41 +73,33 @@ ext {
     project -> !aggregatorOnlyProjects.contains(project.path)
   }
   
-  // for manifest classpath hackery
-  jarNameToProjectMap = [:]  // e.g., "edgent.connectors.iotp-0.4.0.jar" => 
Project(':component:iotp')
-  projectToJarNameMap = [:]
-  
   // Edgent core external dependencies
   core_ext_dependencies = ['com.google.code.gson:gson:2.2.4',
                    'org.slf4j:slf4j-api:1.7.12',
                    'io.dropwizard.metrics:metrics-core:3.1.2']
-  copied_core_ext_dependencies_jars = false
   
   // Edgent Samples external dependencies
   samples_ext_dependencies = ['org.slf4j:slf4j-jdk14:1.7.12']
-  copied_samples_ext_dependencies_jars = false
 
   // Edgent tests external dependencies
-  tests_ext_dependencies = ['org.slf4j:slf4j-jdk14:1.7.12']
-  copied_tests_ext_dependencies_jars = false
+  test_common_dependencies = ['org.slf4j:slf4j-jdk14:1.7.12']
   
   common_ext_dependencies = [
     core_ext_dependencies,
     samples_ext_dependencies,
-    // tests_ext_dependencies, // omit as tests aren't included in release tgz
+    // test_common_dependencies, // omit as tests aren't included in release 
tgz
   ].flatten()
 }
 
-def recordProjectJar(Project proj) {
-  // manifest classpath hackery: update maps of project's jar <=> Project
-  // This, and use of these maps, is fallout from floundering
-  // trying to leverage the gradle object model for dealing with
-  // project (and dependent project) artifacts and/or other nice
-  // gradle declaritive-isms for dealing with this.
-  def jarName = "${proj.group}.${proj.name}-${project.version}.jar"
-  jarNameToProjectMap[jarName] = proj
-  projectToJarNameMap[proj] = jarName
-  //println "#### $proj.path updated jar <=> project maps: $jarName"
+// Declare the common_ext_dependencies as dependencies of the root project
+// to easily copy them (their resolved paths) to the target dir
+dependencies {
+  compile common_ext_dependencies
+}
+task copyCommonExtJars(type: Copy) {
+  description = "Copy common external jars to target_java8_ext_dir"
+  from configurations.compile.files
+  into target_java8_ext_dir
 }
 
 def String mkJarNameFromSpec(String jarSpec) {
@@ -120,90 +107,15 @@ def String mkJarNameFromSpec(String jarSpec) {
   return jarSpec.split(':')[1] + '-' + jarSpec.split(':')[2] + '.jar'
 }
 
-def String stripJarNameVersion(String jarName) {
-  // e.g., edgent.api.topology-0.4.0.jar => edgent.api.topology.jar
-  return jarName.substring(0, jarName.lastIndexOf('-')) + '.jar'
-}
-
-def String getSimpleProjectGroup(Project proj) {
-  // e.g., 'edgent.api' => 'api'
-  return "$proj.group".replace("edgent.", "")
-}
-
-// create a path to dir2 relative to dir1
-// e.g., dir1:'lib', dir2:'connectors/iotp/lib' => ../connectors/iotp/lib
-def String mkRelativePath(File dir1, File dir2) {
-  def relPath = dir1.toPath().relativize(dir2.toPath())
-  //println "#### relPath: "+relPath+"   dir1:"+dir1+" dir2:"+dir2
-  return relPath.toString()
-}
-def String mkRelativePath(String dir1, String dir2) {
-  return mkRelativePath(new File(dir1), new File(dir2))
-}
-
-// e.g., =>  "lib" or "<component>/<subcomponent>/lib"
-def String getTargetRelProjDir(Project proj, String kind) {  // kind: "lib", 
"ext"
-  // the general case location
-  def simpleProjectGroup = getSimpleProjectGroup(proj);
-  def relProjDir = "$simpleProjectGroup/$proj.name/$kind"
-   
-  // special cases
-  if (target_java8_lib_groups.contains(simpleProjectGroup)) {
-    relProjDir = "$kind"
-  }
-  else if ('samples' == simpleProjectGroup) {
-    relProjDir = "$simpleProjectGroup/$kind"
-  }
-   
-  return relProjDir
-}
-
-// Get paths relative to the project's dir in the target-dir
-// to the project's immediate-only dependant project's jars
-// in their project's dir in the target dir
-// 
-// e.g., returns ['../../../lib/edgent.api.topology.jar', ...]
-def Collection getTargetRelDirectDependantProjJars(Project proj) {
-
-  def directDependantProjects = proj.configurations.compile.dependencies
-            .withType(ProjectDependency.class)
-            .collect { it.dependencyProject }
-  //println "#### $proj.path directDependantProjects: $directDependantProjects"
-  
-  def directDependantProjJars = directDependantProjects.collect {
-    def relProjDirInTarget = getTargetRelProjDir(it, 'lib')
-    def jarName = projectToJarNameMap[it]
-    "$relProjDirInTarget/$jarName"
-  }
-  
-  // make relative paths from the project's dir in targetDir to the
-  // jars in the dependent projects' dir in targetDir
-  def myProjDirInTargetDir = getTargetRelProjDir(proj, 'lib')
-  def relDependantJars = directDependantProjJars.collect {
-    mkRelativePath(myProjDirInTargetDir, it)
-  }
-  //println "#### $proj.path relDependantJars: $relDependantJars"
-  return relDependantJars
-}
-
-// e.g., returns ['../../../ext/gson-2.2.4.jar', ...]
-def Collection getTargetRelDependantCommonExtJars(Project proj, Collection 
ext_dependencies) {
-  // make relative paths from the project's dir in targetDir to the
-  // "ext" dir in targetDir (target_java8_ext_dir)
-  def myProjDirInTargetDir = getTargetRelProjDir(proj, 'lib')
-  def relDependantJars = ext_dependencies.collect {
-    jarSpec ->
-      def jarName = mkJarNameFromSpec jarSpec
-      def relativeDependantJarDir = mkRelativePath(myProjDirInTargetDir, 'ext')
-      "$relativeDependantJarDir/$jarName"
-  }
-  //println "#### $proj.path relDependantJars: $relDependantJars"
-  return relDependantJars
-}
-
 def getProjectExtDepFiles(Project proj) { // project's direct ext deps and 
their transitive deps
   // TODO suspect this is picking up ext dependencies of transitive 
**project** dependencies???
+  
+  // handle ext jar deps expressed via "compile <external-dependency-spec>"
   def allExtDepFiles = proj.configurations.runtime.files { it instanceof 
ExternalDependency }
+  
+  // handle ext jar deps expressed via addTargetDirExtJarDependency
+  allExtDepFiles.addAll proj.files(proj.directTargetDirExtJarDependencies)
+  
   logger.info "$proj.path allExtDepFiles: "+allExtDepFiles
   return allExtDepFiles
 }
@@ -219,58 +131,34 @@ def getProjectNonCommonExtDepFiles(Project proj) {
   return filteredExtDepFiles
 }
 
-// Get paths relative to the project's lib dir in the target-dir
-// to the project's immediate external jar dependencies (and their dependencies
-// transitively) in the project's ext dir in the target dir
-//
-// Should NOT include any external dependencies from the project's dependant 
*projects* (transitively)
-// TODO fix that
-// 
-// e.g., returns ['../ext/jetty-...', ...]
-def Collection getTargetRelDependantProjExtJars(Project proj) {
-  def myProjLibDirInTargetDir = getTargetRelProjDir(proj, 'lib')
-  def myProjExtDirInTargetDir = getTargetRelProjDir(proj, 'ext')
-  def relProjExtDirPath = mkRelativePath(myProjLibDirInTargetDir, 
myProjExtDirInTargetDir)
-    
-  // assumes updateTargetDir task copies all the project's ext dependencies
-  // to <projectDirInTarget>/ext
-  
-  def relProjExtDeps = getProjectNonCommonExtDepFiles(proj).collect {
-    file -> "$relProjExtDirPath/$file.name"
-  }
-  //println "#### $proj.path relProjExtDeps: $relProjExtDeps"
-  return relProjExtDeps
-}
-
 def String mkManifestClassPath(Project proj) {
   // The manifest's classpath needs to include the project's:
-  // - immediate-only dependant edgent jars (not transitive and not their ext 
deps)
-  // - "other" dependant external jars - e.g., samples_ext_dependencies
-  // - immediate dependant external jars and their transitive deps
-  // - the core_ext_dependencies jars
-  
-  def depProjJars = getTargetRelDirectDependantProjJars proj
-  depProjJars = depProjJars.collect { stripJarNameVersion it }
-  
-  def projExtJars = getTargetRelDependantProjExtJars proj
-  
-  // unfortunate to include these if project didn't declare them as a 
dependency
-  def coreExtJars = getTargetRelDependantCommonExtJars(proj, 
core_ext_dependencies)
-  
-  def otherExtJars = []
-  if (proj.path ==~ '^:samples.*') {
-     otherExtJars.addAll getTargetRelDependantCommonExtJars(proj, 
samples_ext_dependencies)
-  }
+  // - immediate-only dependant edgent jars (not transitive and not their ext 
deps
+  //   since our project jars are build with a manifest-classpath that
+  //   handles the project's "private" dependencies)
+  // - immediate dependant external jars and their transitive deps (since
+  //   these don't seem to have a manifest classpath that takes care of their
+  //   dependencies)
+  // - common_ext_dependencies jars when declared as dependencies
+  //
+  // proj.configurations.runtime.files (mostly) captures all of the above
+  // since do to our project build.gradle use of our various add*Dependency().
+
+  def depJars = proj.configurations.runtime.files
     
-  def jars = []
-  jars.addAll depProjJars
-  jars.addAll otherExtJars
-  jars.addAll projExtJars
-  jars.addAll coreExtJars
+  // assume that any deps still in the gradle cache are project private ext 
deps
+  // (that will-get/have-been copied into the project's ext dir in the 
targetdir) 
+  def projExtDir = "$target_java8_dir/$proj.targetRelProjExtDir"
+  depJars = depJars.collect { file ->
+    if (file.toString().contains('/.gradle/caches/')) {
+      return proj.file("$projExtDir/"+file.getName())
+    }
+    return file
+  }
     
-  def classPathStr = jars.join(' ')
-  //println "#### $proj.path manifest-classPath: $classPathStr"
-  return classPathStr
+  def cp = proj.mkRelativePaths(depJars).join(' ')
+  logger.info "$proj.path manifest-classPath: $cp"
+  return cp
 }
 
 gradle.taskGraph.whenReady {taskGraph ->
@@ -303,22 +191,116 @@ subprojects {
     return
   }
   
-  assemble { // in configure phase...
-    recordProjectJar(project)
+  ext.simpleGroupName = project.group.replace('edgent.', '') // e.g., 
'edgent.api' => 'api'
+
+  ext.mkRelativePaths = { Collection files ->
+    // make all files paths relative to the project's lib dir in targetdir
+    // well... unless this is for a war, which resides in the group's "webapps"
+    // dir instead of project's lib dir.  See :console:servlets build.gradle.
+    def projLibDir = project.file("$target_java8_dir/$targetRelProjLibDir")
+    if (project.pluginManager.hasPlugin('war')) {
+      projLibDir = 
project.file("$target_java8_dir/$project.simpleGroupName/webapps")
+    }
+    files.collect {  projLibDir.toPath().relativize(it.toPath()) }
   }
 
-  if (["javax.websocket-client", "javax.websocket-server", 
"edgent.javax.websocket"].contains(project.name)) {
-    archivesBaseName = "${project.name}"
-  } else {
-    archivesBaseName = "${rootProject.name}${project.path.replace(':', '.')}"
+  ext.targetRelProjDir = { String kind ->  // kind: "lib", "ext"
+    // use targetRelProject{Lib,Ext}Dir
+    // e.g., =>  "lib" or "<component>/<subcomponent>/lib"
+    // the general case location
+    def relProjDir = "$simpleGroupName/$project.name/$kind"
+   
+    // special cases
+    if (target_java8_lib_groups.contains(simpleGroupName)) {
+      relProjDir = "$kind"
+    }
+    else if ('samples' == simpleGroupName) {
+      relProjDir = "samples/$kind"
+    }
+   
+    return relProjDir
   }
+  ext.targetRelProjLibDir = targetRelProjDir('lib')
+  ext.targetRelProjExtDir = targetRelProjDir('ext')
+  
+  // N.B. regarding the various add*Dependency() methods
+  //
+  // The methods need to be used in project build.gradle "dependencies" 
declarations.
+  // e.g.,
+  //   dependencies {
+  //     addTargetDirProjectJarDependency 'compile', ':api:topology' # NOT 
compile project(':api:topology')
+  //     addProjectExtDependency 'compile', 
'com.ibm.messaging:watson-iot:0.1.5'  # NOT compile 
'com.ibm.messaging:watson-iot:0.1.5'
+  //     addProjectExtDependency 'compile', 
'org.apache.kafka:kafka_2.10:0.8.2.2@jar'
+  //     addTargetDirCoreExtDependencies 'compile'
+  //     addMyTargetDirProjectJarDependency 'testCompile'
+  //     // N.B. root project adds test common dependencies
+  //   }
+  // 
+  // These methods play a role in the policies:
+  // - Edgent projects depend on other project's jars in the target-dir, not 
their classes
+  // - Edgent project jars have a manifest-classpath that handles
+  //   the project's "private" inter-project dependencies
+  //   as well as the project's "private" external component dependencies.
+  // - We build a target dir that includes the project's jar as well as
+  //   the project's external dependency jars
+  // - The tests compile and run against the project jars in the target dir
+  //   (as external/integration test code would).
+  // - The samples compile and run against the project jars in the target dir
+  //   (as user code would).
+  
+  ext.directTargetDirExtJarDependencies = [] 
 
-  dependencies {
-    testCompile 'junit:junit:4.10'
-    testRuntime 'org.slf4j:slf4j-jdk14:1.7.12'
+  ext.addTargetDirProjectJarDependency = { config,proj ->
+    // add a dependency on a project's jar in the target-dir
+    def jarPath = project(proj).jar.archivePath
+    
+    // add the jar as a dependency and ensure it's present when we need it
+    // ? script error with: dependencies { "$config" files(jarPath) builtBy 
"${proj}:assemble" }
+    dependencies { "$config" files(jarPath) }
+    def task = "${config}Java"
+    if (config == "testCompile") {
+      task = "compileTestJava"
+    }
+    else if (config == "providedCompile") {
+      task = "compileJava"
+    }
+    "$task" { dependsOn "${proj}:assemble" }
+  }
+
+  ext.addMyTargetDirProjectJarDependency = { config ->
+    // add a dependency on my project's jar in the target dir
+    addTargetDirProjectJarDependency(config, project.path)
+  }
+  
+  ext.addTargetDirExtJarDependency = { config,jarName ->
+    // add a dependency on a target_java8_ext_dir jarName
+    // record the addition
+    def jar = "$target_java8_ext_dir/$jarName"
+    if (!directTargetDirExtJarDependencies.contains(jar)) {
+      directTargetDirExtJarDependencies.add jar
+    }
+    
+    // add the jar as a dependency
+    dependencies { "$config" files(jar) }
+    compileJava { dependsOn ':copyCommonExtJars' }
+  }
+  
+  ext.addTargetDirCoreExtJarDependencies = { config ->
+    core_ext_dependencies.collect { depSpec ->
+      mkJarNameFromSpec(depSpec)
+    }.each { jarName ->
+      addTargetDirExtJarDependency config, jarName
+    }
+  }
+
+  ext.addProjectExtDependency = { config,externalDepSpec ->
+    // for declaring project private external dependencies
+    // ends up (transitively) copying the dependency to the project's ext dir
+    dependencies { "$config" externalDepSpec }
   }
 
   ext.addCompileTestDependencies = { String... deps ->
+    // add a dependency on other project's testClasses
     deps.each { dep ->
       dependencies {
         testCompile project(dep).sourceSets.test.output
@@ -347,13 +329,6 @@ subprojects {
   }
 
   test {
-    // TODO fix this - this dependency handling shouldn't occur here,
-    // rather :console:server should dependOn :console:servlets
-    // (really the server doesn't exist w/o the servlets)
-    if(it.path == ":test:fvtiot" ||  it.path == ":providers:development") {
-      dependsOn ":console:servlets"
-    }
-    
     filter {
       includeTestsMatching '*Test'  // can override via --tests command line 
option
     }
@@ -368,120 +343,97 @@ subprojects {
       html.enabled = true
     }
   }
-
-  ext.jarOptions = {
-    manifest {
-      attributes(
-              'Implementation-Title': "${-> baseName}",
-              'Implementation-Vendor': build_vendor,
-              // TODO inclusion of DSTAMP/TSTAMP results in regeneration
-              // of a jar when none of its contents/dependencies have changed.
-              // If possible use a canned DSTAMP/TSTAMP for non-"release" tasks
-              // to make the dev cycle more efficient at the expense of the 
TSTAMP.
-              'Implementation-Version': "${commithash}-${DSTAMP}-${TSTAMP}",
-              'Class-Path': mkManifestClassPath(project),
-      )
+  
+  dependencies {
+    // common dependencies for tests
+    testCompile 'junit:junit:4.10'
+    addMyTargetDirProjectJarDependency 'testCompile'
+    if (project.path != ':api:function') {
+      addTargetDirExtJarDependency 'testRuntime', 'slf4j-jdk14-1.7.12.jar'
     }
-    metaInf {
-      from rootProject.file('LICENSE')
-      from rootProject.file('NOTICE')
+    else {
+      // the add... induces UnsupportedOperationException elsewhere in script 
when processing :api:function:jar ???
+      // can't figure it out but cleaning directTargetDirExtJarDependencies
+      // avoids it ???... with seemingly no other consequences.
+      addTargetDirExtJarDependency 'testRuntime', 'slf4j-jdk14-1.7.12.jar'
+      project.directTargetDirExtJarDependencies = []
+    }
+
+    // common dependencies for samples
+    if (project.path ==~ '^:samples.*') {
+      addTargetDirProjectJarDependency 'compile', ':providers:development'
+      addTargetDirProjectJarDependency 'compile', ':providers:direct'
+
+      addTargetDirCoreExtJarDependencies 'compile'      
+      addTargetDirExtJarDependency 'runtime', 'slf4j-jdk14-1.7.12.jar'
     }
   }
+
   jar {
-    // TODO fix this - this dependency handling shouldn't occur here,
-    // rather :console:server should dependOn :console:servlets
-    // (really the server doesn't exist w/o the servlets)
-    if(it.path == ":test:fvtiot" ||  it.path == ":providers:development") {
-      dependsOn ":console:servlets"
+    // adjust jar task config and also augment the task to do our additional 
processing
+    
+    // generate the project's jar into the target dir location
+    // with the appropriate name and manifest.
+    // TODO - gradle/maven best practice has version in jarname
+    
+    archiveName = "${project.group}.${project.name}.${extension}"
+    if (["javax.websocket-client", "javax.websocket-server", 
"edgent.javax.websocket"].contains(project.name)) {
+      archiveName = "${project.name}.${extension}"
     }
-  }
-  jar.doFirst {
-    configure jarOptions
-  }
+    destinationDir = file("$target_java8_dir/" + targetRelProjLibDir)
 
-  task updateTargetDir() {
-    description = "Copy subproject's assembled artifacts to target_dir 
(implicitly builds jars due to 'from jar')"    
+    doFirst {
+      configure jarOptions
+    }
+    
     doLast {
-      def simpleProjectGroup = getSimpleProjectGroup(project)
+      // Copy the project jar's "private" external dependencies (transitively)
+      // into the project's ext dir in the target-dir.
       
-      // Copy the project's jar or war
-      def relProjDirInTarget = getTargetRelProjDir(project, 'lib')
-      if (relProjDirInTarget != null) {
-        if (project.pluginManager.hasPlugin('war')) {
-          copy {
-            from war
-            into "$target_java8_dir/$simpleProjectGroup/webapps"
-          }
-        }
-        else {
-          copy {
-            from jar
-            into "$target_java8_dir/$relProjDirInTarget"
-            rename("$jar.archiveName", "$jar.baseName.$jar.extension")
-          }
-        }
-      }
-    
-      // Copy SRC when appropriate
-      if (simpleProjectGroup == 'samples') {
-        copy {
-          from(sourceSets.main.allSource.srcDirs) { include '**/*.java' }
-          into 
"$target_java8_dir/$simpleProjectGroup/src/$project.name/src/main/java/"
-        }
-      }
-
-      // Copy the project's external dependencies (transitively)
-      // TODO we're getting more transitive ext deps
+      // FYI we're getting more transitive ext deps than the ant build
       // in some cases - e.g., for watson iot we "knew" we only needed a subset
       // of all watson iot deps known to maven
       
-      def projectExtDir = getTargetRelProjDir(project, 'ext')
+      def projectExtDir = targetRelProjExtDir
       def nonCommonExtFiles = getProjectNonCommonExtDepFiles(project)
-      logger.info "$project.path copying extDepFiles jars: 
"+nonCommonExtFiles.collect { it.getName() }
-      //println "#### $project.path copying extDepFiles jars: 
"+nonCommonExtFiles.collect { it.getName() }
+      logger.info "$project.path copying projExtDepFiles jars: 
"+nonCommonExtFiles.collect { it.getName() }
       copy {
         from nonCommonExtFiles
         includeEmptyDirs = false
         into "$target_java8_dir/$projectExtDir"
       }
-    
-      // Copy core_ext_dependencies jars once
-      if (!copied_core_ext_dependencies_jars) {
-        copied_core_ext_dependencies_jars = true
-        def coreExtJarNames = core_ext_dependencies.collect {
-          mkJarNameFromSpec it
-        }
-        def coreExtDeps = getProjectExtDepFiles(project).findAll {
-          coreExtJarNames.contains(it.getName())
-        }
-        logger.info "$project.path copying core_ext_dependencies_jars: 
"+coreExtDeps.collect { it.getName() }
-        //println "#### $project.path copying core_ext_dependencies_jars: 
"+coreExtDeps.collect { it.getName() }
-        copy {
-          from coreExtDeps
-          includeEmptyDirs = false
-          into target_java8_ext_dir
-        }
-      }
+    }
+  }
 
-      // Copy samples_ext_dependencies jars once
-      if ('samples' == simpleProjectGroup && 
!copied_samples_ext_dependencies_jars) {
-        copied_samples_ext_dependencies_jars = true
-        def samplesExtJarNames = samples_ext_dependencies.collect {
-          mkJarNameFromSpec it
-        }
-        def commonExtDeps = getProjectExtDepFiles(project).findAll {
-          samplesExtJarNames.contains(it.getName())
-        }
-        logger.info "$project.path copying samples_ext_dependencies_jars: 
"+commonExtDeps.collect { it.getName() }
-        //println "#### $project.path copying samples_ext_dependencies_jars: 
"+commonExtDeps.collect { it.getName() }
-        copy {
-          from commonExtDeps
-          includeEmptyDirs = false
-          into target_java8_ext_dir
-        }
+  ext.jarOptions = {
+    manifest {
+      attributes(
+        'Implementation-Title': "${-> baseName}",
+        'Implementation-Vendor': build_vendor,
+        // TODO inclusion of DSTAMP/TSTAMP results in regeneration
+        // of a jar when none of its contents/dependencies have changed.
+        // If possible use a canned DSTAMP/TSTAMP for non-"release" tasks
+        // to make the dev cycle more efficient at the expense of the TSTAMP.
+        'Implementation-Version': "${commithash}-${DSTAMP}-${TSTAMP}",
+        'Class-Path': mkManifestClassPath(project),
+      )
+    }
+    metaInf {
+      from rootProject.file('LICENSE')
+      from rootProject.file('NOTICE')
+    }
+  }
+
+  assemble.doLast {
+    // augment assemble with our additional target dir update processing
+    
+    // Copy SRC into target dir when appropriate
+    if (project.path ==~ '^:samples.*') {
+      copy {
+        from(sourceSets.main.allSource.srcDirs) { include '**/*.java' }
+        into 
"$target_java8_dir/$project.simpleGroupName/src/$project.name/src/main/java/"
       }
-      
-    } // doLast
+    }
   }
   
   task sourceJar(type: Jar) {
@@ -490,7 +442,7 @@ subprojects {
     classifier = 'sources'
   }  
 
-  // support for 'gradle publishToMavanLocal' etc 
+  // support for 'gradle publishToMavenLocal' etc 
   // TODO publishing test.{fvt,svt} and samples ... doesn't seem desirable? 
e.g., we're excluding test.{fvt,svt} jars from the tgz
   publishing {
     publications {
@@ -508,9 +460,6 @@ subprojects {
       }
     }
   }  
-  
-  // assemble: inject updating target_dir 
-  assemble.finalizedBy updateTargetDir
 }
 
 task copyScripts(type: Copy) {

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/command/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/command/build.gradle b/connectors/command/build.gradle
index ae1c166..f4c1bb9 100644
--- a/connectors/command/build.gradle
+++ b/connectors/command/build.gradle
@@ -12,10 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':connectors:common')
-  testCompile project(':providers:direct')
-  testRuntime core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':connectors:common'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/common/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/common/build.gradle b/connectors/common/build.gradle
index 4f2d99b..a9cb454 100644
--- a/connectors/common/build.gradle
+++ b/connectors/common/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/csv/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/csv/build.gradle b/connectors/csv/build.gradle
index f32d8a9..c53d87a 100644
--- a/connectors/csv/build.gradle
+++ b/connectors/csv/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/edgent.javax.websocket/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/edgent.javax.websocket/build.gradle 
b/connectors/edgent.javax.websocket/build.gradle
index ca8b478..b56e457 100644
--- a/connectors/edgent.javax.websocket/build.gradle
+++ b/connectors/edgent.javax.websocket/build.gradle
@@ -14,6 +14,7 @@
 archivesBaseName = project.name
 
 dependencies {
-  compile 'javax.websocket:javax.websocket-api:1.0'
-  testRuntime core_ext_dependencies
+  addProjectExtDependency 'compile', 'javax.websocket:javax.websocket-api:1.0'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/file/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/file/build.gradle b/connectors/file/build.gradle
index f32d8a9..c53d87a 100644
--- a/connectors/file/build.gradle
+++ b/connectors/file/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/http/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/http/build.gradle b/connectors/http/build.gradle
index e3a8402..e6fdc5d 100644
--- a/connectors/http/build.gradle
+++ b/connectors/http/build.gradle
@@ -12,11 +12,13 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile 'org.apache.httpcomponents:httpclient:4.5.1'
-  compile 'org.apache.httpcomponents:httpcore:4.4.4'
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addProjectExtDependency 'compile', 
'org.apache.httpcomponents:httpclient:4.5.1'
+  addProjectExtDependency 'compile', 'org.apache.httpcomponents:httpcore:4.4.4'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/iot/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/iot/build.gradle b/connectors/iot/build.gradle
index c15c7ef..36b0207 100644
--- a/connectors/iot/build.gradle
+++ b/connectors/iot/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/iotp/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/iotp/build.gradle b/connectors/iotp/build.gradle
index 6f05955..f86f870 100644
--- a/connectors/iotp/build.gradle
+++ b/connectors/iotp/build.gradle
@@ -12,11 +12,13 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':connectors:iot')
-  compile 'com.ibm.messaging:watson-iot:0.1.1'
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iot'
+  addProjectExtDependency 'compile', 'com.ibm.messaging:watson-iot:0.1.5'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/javax.websocket-client/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/javax.websocket-client/build.gradle 
b/connectors/javax.websocket-client/build.gradle
index 8967e21..947852d 100644
--- a/connectors/javax.websocket-client/build.gradle
+++ b/connectors/javax.websocket-client/build.gradle
@@ -14,7 +14,8 @@
 archivesBaseName = project.name
 
 dependencies {
-  compile project(':connectors:edgent.javax.websocket')
-  compile 
'org.eclipse.jetty.websocket:javax-websocket-client-impl:9.3.6.v20151106'
-  testRuntime core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', 
':connectors:edgent.javax.websocket'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty.websocket:javax-websocket-client-impl:9.3.6.v20151106'
+  
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/javax.websocket-server/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/javax.websocket-server/build.gradle 
b/connectors/javax.websocket-server/build.gradle
index 7fbd6d2..66d1367 100644
--- a/connectors/javax.websocket-server/build.gradle
+++ b/connectors/javax.websocket-server/build.gradle
@@ -14,7 +14,8 @@
 archivesBaseName = project.name
 
 dependencies {
-  compile project(':connectors:javax.websocket-client')
-  compile 
'org.eclipse.jetty.websocket:javax-websocket-server-impl:9.3.6.v20151106'
-  testRuntime core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', 
':connectors:javax.websocket-client'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty.websocket:javax-websocket-server-impl:9.3.6.v20151106'
+  
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/jdbc/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/jdbc/build.gradle b/connectors/jdbc/build.gradle
index a34e16e..33bcfde 100644
--- a/connectors/jdbc/build.gradle
+++ b/connectors/jdbc/build.gradle
@@ -12,10 +12,12 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  
   testCompile files("${System.env.DERBY_HOME}/lib/derby.jar")
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/kafka/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/kafka/build.gradle b/connectors/kafka/build.gradle
index 9852252..8eed0c2 100644
--- a/connectors/kafka/build.gradle
+++ b/connectors/kafka/build.gradle
@@ -12,11 +12,32 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile 'org.apache.kafka:kafka_2.10:0.8.2.2'
-  compile 'org.apache.kafka:kafka-clients:0.8.2.2'
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  
+  // The pom for kafka includes dependencies that don't make sense for us.
+  // In at least one case kafka dependencies include a slf4j *implementation* 
jar
+  // and that conflicts with our samples' binding to a particular
+  // version of slf4j implementation.
+  // This all seems like fallout from, I believe, the kafka jars containing
+  // the code for their cli tools too, and possibly tests, which need things 
like:
+  //   slf4j-log4j12, snappy-java, jline, jopt-simple, junit-3.8.1
+  //
+  // So at least for now, avoid transitive and just match our ant based config
+  //
+  // addProjectExtDependency 'compile', 'org.apache.kafka:kafka_2.10:0.8.2.2'
+  // addProjectExtDependency 'compile', 
'org.apache.kafka:kafka-clients:0.8.2.2'
+  addProjectExtDependency 'compile', 'org.apache.kafka:kafka_2.10:0.8.2.2@jar'
+  addProjectExtDependency 'compile', 
'org.apache.kafka:kafka-clients:0.8.2.2@jar'
+  addProjectExtDependency 'compile', 'log4j:log4j:1.2.16@jar'
+  addProjectExtDependency 'compile', 
'com.yammer.metrics:metrics-core:2.2.0@jar'
+  addProjectExtDependency 'compile', 'org.scala-lang:scala-library:2.10.4@jar'
+  addProjectExtDependency 'compile', 'com.101tec:zkclient:0.3@jar'
+  addProjectExtDependency 'compile', 'org.apache.zookeeper:zookeeper:3.4.6@jar'
+  
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/mqtt/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/mqtt/build.gradle b/connectors/mqtt/build.gradle
index 9b5958c..9f09b1b 100644
--- a/connectors/mqtt/build.gradle
+++ b/connectors/mqtt/build.gradle
@@ -12,12 +12,13 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':connectors:iot')
-  compile project(':connectors:common')
-  compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
-  testCompile project(':providers:direct')
-  testRuntime core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iot'
+  addTargetDirProjectJarDependency 'compile', ':connectors:common'
+  addProjectExtDependency 'compile', 
'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/pubsub/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/pubsub/build.gradle b/connectors/pubsub/build.gradle
index c15c7ef..36b0207 100644
--- a/connectors/pubsub/build.gradle
+++ b/connectors/pubsub/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/serial/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/serial/build.gradle b/connectors/serial/build.gradle
index c15c7ef..36b0207 100644
--- a/connectors/serial/build.gradle
+++ b/connectors/serial/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/wsclient-javax.websocket/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/wsclient-javax.websocket/build.gradle 
b/connectors/wsclient-javax.websocket/build.gradle
index b145db0..08ba82c 100644
--- a/connectors/wsclient-javax.websocket/build.gradle
+++ b/connectors/wsclient-javax.websocket/build.gradle
@@ -12,14 +12,16 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':connectors:common')
-  compile project(':connectors:wsclient')
-  compile project(':connectors:edgent.javax.websocket')
-  testCompile project(':providers:direct')
-  testCompile project(':connectors:javax.websocket-client')
-  testCompile project(':connectors:javax.websocket-server')
-  testRuntime core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':connectors:common'
+  addTargetDirProjectJarDependency 'compile', ':connectors:wsclient'
+  addTargetDirProjectJarDependency 'compile', 
':connectors:edgent.javax.websocket'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  addTargetDirProjectJarDependency 'testCompile', 
':connectors:javax.websocket-client'
+  addTargetDirProjectJarDependency 'testCompile', 
':connectors:javax.websocket-server'
+  
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct', 
':connectors:common'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/connectors/wsclient/build.gradle
----------------------------------------------------------------------
diff --git a/connectors/wsclient/build.gradle b/connectors/wsclient/build.gradle
index c15c7ef..36b0207 100644
--- a/connectors/wsclient/build.gradle
+++ b/connectors/wsclient/build.gradle
@@ -12,9 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
-  testCompile project(':providers:direct')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  addTargetDirProjectJarDependency 'testCompile', ':providers:direct'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':providers:direct'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/console/server/build.gradle
----------------------------------------------------------------------
diff --git a/console/server/build.gradle b/console/server/build.gradle
index 6b48e13..2cbb6e1 100644
--- a/console/server/build.gradle
+++ b/console/server/build.gradle
@@ -12,13 +12,17 @@
  * limitations under the License.
  */
 dependencies {
-  compile 'org.eclipse.jetty:jetty-http:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-io:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-security:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-server:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-servlet:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-util:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-webapp:9.3.6.v20151106'
-  compile 'org.eclipse.jetty:jetty-xml:9.3.6.v20151106'
-  compile core_ext_dependencies
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-http:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-io:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-security:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-server:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-servlet:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-util:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-webapp:9.3.6.v20151106'
+  addProjectExtDependency 'compile', 
'org.eclipse.jetty:jetty-xml:9.3.6.v20151106'
+  addTargetDirCoreExtJarDependencies 'compile'
+  
+  // TODO runtime dependsOn ":console:servlets"  ???  
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/console/servlets/build.gradle
----------------------------------------------------------------------
diff --git a/console/servlets/build.gradle b/console/servlets/build.gradle
index f419e09..0b19f71 100644
--- a/console/servlets/build.gradle
+++ b/console/servlets/build.gradle
@@ -16,14 +16,15 @@ distsDirName = 'webapps'
 plugins.apply 'war'
 
 dependencies {
-  providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
-  providedCompile project(':utils:streamscope')
-  providedCompile core_ext_dependencies
+  addTargetDirProjectJarDependency 'providedCompile', ':utils:streamscope'
+  addProjectExtDependency 'providedCompile', 
'javax.servlet:javax.servlet-api:3.1.0'
+  addTargetDirCoreExtJarDependencies 'providedCompile'
+
+  // N.B. root project adds test common dependencies
 }
 
 war {
-  configure jarOptions
-  destinationDir = project.distsDir
+  destinationDir = file("$target_java8_dir/$project.simpleGroupName/webapps")
   archiveName 'console.war'
   from file('webapp_content/html')
   into('resources') {
@@ -33,6 +34,10 @@ war {
     from file('webapp_content/js')
   }
   webXml = file('webapp_content/WEB-INF/console.xml')
+  
+  doFirst {
+    configure jarOptions
+  }
 }
 
 testClasses.dependsOn war

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/providers/development/build.gradle
----------------------------------------------------------------------
diff --git a/providers/development/build.gradle 
b/providers/development/build.gradle
index a20e665..88e300c 100644
--- a/providers/development/build.gradle
+++ b/providers/development/build.gradle
@@ -12,11 +12,13 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:direct')
-  compile project(':console:server')
-  compile project(':utils:metrics')
-  compile project(':utils:streamscope')
-  compile project(':runtime:jmxcontrol')
+  addTargetDirProjectJarDependency 'compile', ':providers:direct'
+  addTargetDirProjectJarDependency 'compile', ':console:server'
+  addTargetDirProjectJarDependency 'compile', ':utils:metrics'
+  addTargetDirProjectJarDependency 'compile', ':utils:streamscope'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jmxcontrol'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':utils:streamscope'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/providers/direct/build.gradle
----------------------------------------------------------------------
diff --git a/providers/direct/build.gradle b/providers/direct/build.gradle
index b221d2b..22d77a8 100644
--- a/providers/direct/build.gradle
+++ b/providers/direct/build.gradle
@@ -12,15 +12,16 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile project(':spi:topology')
-  compile project(':spi:graph')
-  compile project(':runtime:appservice')
-  compile project(':runtime:etiao')
-  compile project(':runtime:jsoncontrol')
-  compile core_ext_dependencies
-  testCompile project(':utils:metrics')
-  testCompile project(':runtime:appservice')
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirProjectJarDependency 'compile', ':spi:topology'
+  addTargetDirProjectJarDependency 'compile', ':spi:graph'
+  addTargetDirProjectJarDependency 'compile', ':runtime:appservice'
+  addTargetDirProjectJarDependency 'compile', ':runtime:etiao'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jsoncontrol'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  addTargetDirProjectJarDependency 'testCompile', ':utils:metrics'
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology', ':utils:metrics', 
':runtime:appservice'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/providers/iot/build.gradle
----------------------------------------------------------------------
diff --git a/providers/iot/build.gradle b/providers/iot/build.gradle
index c3ea797..7bd3521 100644
--- a/providers/iot/build.gradle
+++ b/providers/iot/build.gradle
@@ -12,13 +12,15 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:direct')
-  compile project(':runtime:jsoncontrol')
-  compile project(':runtime:appservice')
-  compile project(':connectors:iot')
-  compile project(':connectors:pubsub')
-  compile project(':apps:iot')
-  compile project(':apps:runtime')
+  addTargetDirProjectJarDependency 'compile', ':providers:direct'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jsoncontrol'
+  addTargetDirProjectJarDependency 'compile', ':runtime:appservice'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iot'
+  addTargetDirProjectJarDependency 'compile', ':connectors:pubsub'
+  addTargetDirProjectJarDependency 'compile', ':apps:iot'
+  addTargetDirProjectJarDependency 'compile', ':apps:runtime'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/runtime/appservice/build.gradle
----------------------------------------------------------------------
diff --git a/runtime/appservice/build.gradle b/runtime/appservice/build.gradle
index 692d1dc..c4b88ed 100644
--- a/runtime/appservice/build.gradle
+++ b/runtime/appservice/build.gradle
@@ -12,7 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:topology')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/runtime/etiao/build.gradle
----------------------------------------------------------------------
diff --git a/runtime/etiao/build.gradle b/runtime/etiao/build.gradle
index 9dc1641..dbefb76 100644
--- a/runtime/etiao/build.gradle
+++ b/runtime/etiao/build.gradle
@@ -12,10 +12,12 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:graph')
-  compile project(':spi:graph')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:graph'
+  addTargetDirProjectJarDependency 'compile', ':spi:graph'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:graph'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/runtime/jmxcontrol/build.gradle
----------------------------------------------------------------------
diff --git a/runtime/jmxcontrol/build.gradle b/runtime/jmxcontrol/build.gradle
index 3183e4d..017bd82 100644
--- a/runtime/jmxcontrol/build.gradle
+++ b/runtime/jmxcontrol/build.gradle
@@ -12,7 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:function')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/runtime/jobregistry/build.gradle
----------------------------------------------------------------------
diff --git a/runtime/jobregistry/build.gradle b/runtime/jobregistry/build.gradle
index 692d1dc..c4b88ed 100644
--- a/runtime/jobregistry/build.gradle
+++ b/runtime/jobregistry/build.gradle
@@ -12,7 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:topology')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/runtime/jsoncontrol/build.gradle
----------------------------------------------------------------------
diff --git a/runtime/jsoncontrol/build.gradle b/runtime/jsoncontrol/build.gradle
index 3183e4d..017bd82 100644
--- a/runtime/jsoncontrol/build.gradle
+++ b/runtime/jsoncontrol/build.gradle
@@ -12,7 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:function')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:function'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/apps/build.gradle
----------------------------------------------------------------------
diff --git a/samples/apps/build.gradle b/samples/apps/build.gradle
index 23ddc07..059e969 100644
--- a/samples/apps/build.gradle
+++ b/samples/apps/build.gradle
@@ -12,15 +12,14 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':connectors:mqtt')
-  compile project(':connectors:file')
-  compile project(':connectors:serial')
-  compile project(':analytics:math3')
-  compile project(':analytics:sensors')
-  compile project(':samples:utils')
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':connectors:mqtt'
+  addTargetDirProjectJarDependency 'compile', ':connectors:file'
+  addTargetDirProjectJarDependency 'compile', ':connectors:serial'
+  addTargetDirProjectJarDependency 'compile', ':analytics:math3'
+  addTargetDirProjectJarDependency 'compile', ':analytics:sensors'
+  addTargetDirProjectJarDependency 'compile', ':samples:utils'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/connectors/build.gradle
----------------------------------------------------------------------
diff --git a/samples/connectors/build.gradle b/samples/connectors/build.gradle
index 0eb5d9a..593d748 100644
--- a/samples/connectors/build.gradle
+++ b/samples/connectors/build.gradle
@@ -12,17 +12,17 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':connectors:mqtt')
-  compile project(':connectors:kafka')
-  compile project(':connectors:file')
-  compile project(':connectors:iotp')
-  compile project(':connectors:jdbc')
-  compile project(':connectors:serial')
-  compile project(':samples:topology')
-  compile project(':samples:utils')
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':analytics:math3'
+  addTargetDirProjectJarDependency 'compile', ':connectors:mqtt'
+  addTargetDirProjectJarDependency 'compile', ':connectors:kafka'
+  addTargetDirProjectJarDependency 'compile', ':connectors:file'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iotp'
+  addTargetDirProjectJarDependency 'compile', ':connectors:jdbc'
+  addTargetDirProjectJarDependency 'compile', ':connectors:serial'
+  addTargetDirProjectJarDependency 'compile', ':samples:topology'
+  addTargetDirProjectJarDependency 'compile', ':samples:utils'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/console/build.gradle
----------------------------------------------------------------------
diff --git a/samples/console/build.gradle b/samples/console/build.gradle
index 867ca86..b1f9013 100644
--- a/samples/console/build.gradle
+++ b/samples/console/build.gradle
@@ -12,10 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':console:server')
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':console:server'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/scenarios/build.gradle
----------------------------------------------------------------------
diff --git a/samples/scenarios/build.gradle b/samples/scenarios/build.gradle
index 72f2a4d..c1f26aa 100644
--- a/samples/scenarios/build.gradle
+++ b/samples/scenarios/build.gradle
@@ -12,13 +12,14 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':samples:connectors')
-  compile project(':providers:iot')
-  compile project(':connectors:iotp')
-  compile 'com.pi4j:pi4j-core:1.0'
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':analytics:math3'
+  addTargetDirProjectJarDependency 'compile', ':samples:connectors'
+  addTargetDirProjectJarDependency 'compile', ':providers:iot'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iot'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iotp'
+  addProjectExtDependency 'compile', 'com.pi4j:pi4j-core:1.0'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/topology/build.gradle
----------------------------------------------------------------------
diff --git a/samples/topology/build.gradle b/samples/topology/build.gradle
index c679470..26de0a1 100644
--- a/samples/topology/build.gradle
+++ b/samples/topology/build.gradle
@@ -11,13 +11,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':analytics:math3')
-  compile project(':runtime:jobregistry')
-  compile project(':samples:utils')
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':analytics:math3'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jobregistry'
+  addTargetDirProjectJarDependency 'compile', ':samples:utils'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/samples/utils/build.gradle
----------------------------------------------------------------------
diff --git a/samples/utils/build.gradle b/samples/utils/build.gradle
index 6ba00f7..685d1ad 100644
--- a/samples/utils/build.gradle
+++ b/samples/utils/build.gradle
@@ -12,12 +12,11 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:development')
-  compile project(':providers:direct')
-  compile project(':utils:metrics')
-  compile project(':analytics:math3')
-  compile project(':analytics:sensors')
-  compile core_ext_dependencies
-  
-  runtime samples_ext_dependencies
+  // N.B. common dependencies are set in root build.gradle
+
+  addTargetDirProjectJarDependency 'compile', ':utils:metrics'
+  addTargetDirProjectJarDependency 'compile', ':analytics:math3'
+  addTargetDirProjectJarDependency 'compile', ':analytics:sensors'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/scripts/connectors/mqtt/mqtt.properties
----------------------------------------------------------------------
diff --git a/scripts/connectors/mqtt/mqtt.properties 
b/scripts/connectors/mqtt/mqtt.properties
index 3d400c7..8707644 100644
--- a/scripts/connectors/mqtt/mqtt.properties
+++ b/scripts/connectors/mqtt/mqtt.properties
@@ -1,4 +1,5 @@
 mqtt.serverURLs=tcp://localhost:1883
+#mqtt.serverURLs=tcp://test.mosquitto.org:1883
 mqtt.topic=mqttSampleTopic
 #mqtt.userName=
 #mqtt.password=

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index dd78693..dce6cc9 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -70,5 +70,8 @@ if (System.env.ANDROID_SDK_PLATFORM != null) {
   include 'android:topology'
   include 'android:hardware'
 }
+else {
+  logger.lifecycle 'ANDROID_SDK_PLATFORM ev not set. Omitting 
android:{topology,hardware} projects.'
+}
 
 rootProject.name = build_name

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/spi/graph/build.gradle
----------------------------------------------------------------------
diff --git a/spi/graph/build.gradle b/spi/graph/build.gradle
index 05e565a..558e7df 100644
--- a/spi/graph/build.gradle
+++ b/spi/graph/build.gradle
@@ -12,7 +12,9 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:execution')
-  compile project(':api:graph')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:execution'
+  addTargetDirProjectJarDependency 'compile', ':api:graph'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/spi/topology/build.gradle
----------------------------------------------------------------------
diff --git a/spi/topology/build.gradle b/spi/topology/build.gradle
index 8ea0eeb..1e61856 100644
--- a/spi/topology/build.gradle
+++ b/spi/topology/build.gradle
@@ -12,6 +12,8 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/test/fvtiot/build.gradle
----------------------------------------------------------------------
diff --git a/test/fvtiot/build.gradle b/test/fvtiot/build.gradle
index 7fe9f99..fd1dd55 100644
--- a/test/fvtiot/build.gradle
+++ b/test/fvtiot/build.gradle
@@ -12,10 +12,12 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':providers:iot')
-  compile project(':runtime:appservice')
-  compile project(':runtime:jsoncontrol')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':providers:iot'
+  addTargetDirProjectJarDependency 'compile', ':runtime:appservice'
+  addTargetDirProjectJarDependency 'compile', ':runtime:jsoncontrol'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':apps:iot'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/test/svt/build.gradle
----------------------------------------------------------------------
diff --git a/test/svt/build.gradle b/test/svt/build.gradle
index cfeba53..bd6e6f0 100644
--- a/test/svt/build.gradle
+++ b/test/svt/build.gradle
@@ -11,16 +11,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-def projectGroup = "$project.group".replace("edgent.", "")
-def lib= "${rootProject.ext.target_java8_dir}/" + projectGroup + 
"/$project.name".replaceAll(":", "/")
+def lib= "$target_java8_dir/$project.simpleGroupName/$project.name"
 
 //def lib="${project.distsDir}/lib"
 
 dependencies {
-  compile project(':providers:development')
-  compile project(':samples:apps')
-  compile project(':connectors:iotp')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':providers:development'
+  addTargetDirProjectJarDependency 'compile', ':samples:apps'
+  addTargetDirProjectJarDependency 'compile', ':connectors:iotp'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 tasks.build.doFirst(){

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/utils/metrics/build.gradle
----------------------------------------------------------------------
diff --git a/utils/metrics/build.gradle b/utils/metrics/build.gradle
index 42c5dc9..c25ca14 100644
--- a/utils/metrics/build.gradle
+++ b/utils/metrics/build.gradle
@@ -12,8 +12,10 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology'

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/a08252e1/utils/streamscope/build.gradle
----------------------------------------------------------------------
diff --git a/utils/streamscope/build.gradle b/utils/streamscope/build.gradle
index f6d1138..105586e 100644
--- a/utils/streamscope/build.gradle
+++ b/utils/streamscope/build.gradle
@@ -12,8 +12,10 @@
  * limitations under the License.
  */
 dependencies {
-  compile project(':api:topology')
-  compile core_ext_dependencies
+  addTargetDirProjectJarDependency 'compile', ':api:topology'
+  addTargetDirCoreExtJarDependencies 'compile'
+
+  // N.B. root project adds test common dependencies
 }
 
 addCompileTestDependencies ':api:topology'

Reply via email to