You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2017/11/17 22:30:15 UTC

[44/50] [abbrv] beam git commit: Enforce that gogradle dependency resolution/installation is done serially.

Enforce that gogradle dependency resolution/installation is done serially.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/3e567c29
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/3e567c29
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/3e567c29

Branch: refs/heads/master
Commit: 3e567c29e5f52aa3a6109eb748bbd308efaea7e2
Parents: 17da0e0
Author: Luke Cwik <lc...@google.com>
Authored: Tue Nov 7 13:22:46 2017 -0800
Committer: Luke Cwik <lc...@google.com>
Committed: Fri Nov 17 14:27:16 2017 -0800

----------------------------------------------------------------------
 build_rules.gradle | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/3e567c29/build_rules.gradle
----------------------------------------------------------------------
diff --git a/build_rules.gradle b/build_rules.gradle
index 922218d..1b9488a 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -200,6 +200,32 @@ ext.applyGoNature = {
   golang {
     goVersion = '1.9'
   }
+
+  // GoGradle fails in a parallel build during dependency resolution/installation.
+  // Force a dependency between all GoGradle projects during dependency resolution/installation.
+  // TODO: Figure out how to do this by automatically figuring out the task dependency DAG
+  // based upon task type.
+  List<String> goProjects = [
+      ":beam-sdks-parent:beam-sdks-go",
+      ":beam-runners-parent:beam-runners-gcp-parent:beam-runners-gcp-gcemd",
+      ":beam-runners-parent:beam-runners-gcp-parent:beam-runners-gcp-gcsproxy",
+      ":beam-sdks-parent:beam-sdks-python:beam-sdks-python-container",
+      ":beam-sdks-parent:beam-sdks-java-parent:beam-sdks-java-container",
+  ]
+  if (!goProjects.contains(project.path)) {
+    throw new GradleException(project.path + " has not been defined within the list of well known go projects within build_rules.gradle.")
+  }
+
+  int index = goProjects.indexOf(project.path)
+  if (index != 0) {
+    String previous = goProjects.get(index - 1)
+    println "Forcing: '" + previous + "' to be evaulated before '" + project.path + "'"
+    evaluationDependsOn(previous)
+    afterEvaluate {
+      println "Forcing: '" + previous + ":installBuildDependencies' must run before '" + project.path + ":resolveBuildDependencies'"
+      tasks.getByPath(project.path + ":resolveBuildDependencies").mustRunAfter tasks.getByPath(previous + ":installDependencies")
+    }
+  }
 }
 
 ext.applyDockerNature = {