beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lc...@apache.org
Subject [49/50] [abbrv] beam git commit: Create uber jar of the Java SDK harness and copy it into the location that Dockerfile expects
Date Fri, 17 Nov 2017 22:30:20 GMT
Create uber jar of the Java SDK harness and copy it into the location that Dockerfile expects


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

Branch: refs/heads/master
Commit: 7fe89437dcf8765af5baf652a6131cd04ebc5ff3
Parents: c03d0c6
Author: Luke Cwik <lcwik@google.com>
Authored: Mon Nov 6 13:30:05 2017 -0800
Committer: Luke Cwik <lcwik@google.com>
Committed: Fri Nov 17 14:27:16 2017 -0800

----------------------------------------------------------------------
 build.gradle                     |  1 +
 sdks/java/container/build.gradle | 41 +++++++++++++++++++++++------------
 sdks/java/harness/build.gradle   |  9 ++++++++
 3 files changed, 37 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/7fe89437/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 14d9bc5..cb56985 100644
--- a/build.gradle
+++ b/build.gradle
@@ -152,6 +152,7 @@ buildscript {
     classpath "gradle.plugin.com.github.blindpirate:gogradle:0.7.0"
     classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0"
     classpath "cz.malohlava:visteg:1.0.3"
+    classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
   }
 }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/7fe89437/sdks/java/container/build.gradle
----------------------------------------------------------------------
diff --git a/sdks/java/container/build.gradle b/sdks/java/container/build.gradle
index 8933c93..11b3009 100644
--- a/sdks/java/container/build.gradle
+++ b/sdks/java/container/build.gradle
@@ -27,25 +27,38 @@ description = "Apache Beam :: SDKs :: Java :: Container"
 // "./github.com/apache/beam/sdks/go"
 resolveBuildDependencies.dependsOn ":beam-sdks-parent:beam-sdks-go:build"
 
+configurations {
+  dockerDependency
+}
+
 dependencies {
-    golang {
-        // TODO(herohde): use "./" prefix to prevent gogradle use base github path, for now.
-        // TODO(herohde): get the pkg subdirectory only, if possible. We spend mins pulling
cmd/beamctl deps.
-        build name: './github.com/apache/beam/sdks/go', dir: project(':beam-sdks-parent:beam-sdks-go').projectDir
-    }
+  golang {
+    // TODO(herohde): use "./" prefix to prevent gogradle use base github path, for now.
+    // TODO(herohde): get the pkg subdirectory only, if possible. We spend mins pulling cmd/beamctl
deps.
+    build name: './github.com/apache/beam/sdks/go', dir: project(':beam-sdks-parent:beam-sdks-go').projectDir
+  }
+  dockerDependency library.java.slf4j_api
+  dockerDependency library.java.slf4j_jdk14
+  dockerDependency project(path: ":beam-sdks-parent:beam-sdks-java-parent:beam-sdks-java-harness",
configuration: "shadow")
+}
+
+task copyDockerfileDependencies(type: Copy) {
+  from configurations.dockerDependency
+  into "build/target"
 }
+docker.dependsOn copyDockerfileDependencies
 
 golang {
-    packagePath = 'github.com/apache/beam/sdks/python/boot'
-    build {
-        // TODO(herohde): build local platform + linux-amd64, if possible.
-        targetPlatform = ['linux-amd64']
-        outputLocation = './build/target/${GOOS}_${GOARCH}/boot'
-    }
+  packagePath = 'github.com/apache/beam/sdks/python/boot'
+  build {
+    // TODO(herohde): build local platform + linux-amd64, if possible.
+    targetPlatform = ['linux-amd64']
+    outputLocation = './build/target/${GOOS}_${GOARCH}/boot'
+  }
 }
 
 docker {
-    // TODO(herohde): make the name easier to generate for releases.
-    name System.properties['user.name'] + '-docker-apache.bintray.io/beam/java:latest'
-    files "./build/"
+  // TODO(herohde): make the name easier to generate for releases.
+  name System.properties['user.name'] + '-docker-apache.bintray.io/beam/python:latest'
+  files "./build/"
 }

http://git-wip-us.apache.org/repos/asf/beam/blob/7fe89437/sdks/java/harness/build.gradle
----------------------------------------------------------------------
diff --git a/sdks/java/harness/build.gradle b/sdks/java/harness/build.gradle
index ff21999..1f23dad 100644
--- a/sdks/java/harness/build.gradle
+++ b/sdks/java/harness/build.gradle
@@ -19,6 +19,8 @@
 apply from: project(":").file("build_rules.gradle")
 applyJavaNature(javaVersion: 1.8)
 
+apply plugin: "com.github.johnrengelman.shadow"
+
 description = "Apache Beam :: SDKs :: Java :: Harness"
 
 /*
@@ -57,6 +59,13 @@ dependencies {
   testCompile library.java.slf4j_jdk14
 }
 
+// Create an uber jar without repackaging for the SDK harness
+// Note, this jar should never be published because it bundles
+// dependencies without repackaging.
+shadowJar {
+  mergeServiceFiles()
+}
+
 task packageTests(type: Jar) {
   from sourceSets.test.output
   classifier = "tests"


Mime
View raw message