[ 
https://issues.apache.org/jira/browse/BEAM-6056?focusedWorklogId=166742&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-166742
 ]

ASF GitHub Bot logged work on BEAM-6056:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Nov/18 01:29
            Start Date: 16/Nov/18 01:29
    Worklog Time Spent: 10m 
      Work Description: lukecwik closed pull request #7042: [BEAM-6056] Publish 
gRPC 1.13.1 as a vendored dependency.
URL: https://github.com/apache/beam/pull/7042
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
index ff1d38b859f..14285ca2e2d 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -813,7 +813,10 @@ artifactId=${project.name}
           }
 
           dependsOn 'generatePomFileForMavenJavaPublication'
-          into("META-INF/maven/${project.group}/${project.name}") { from 
"${pomFile}" }
+          into("META-INF/maven/${project.group}/${project.name}") {
+            from "${pomFile}"
+            rename('.*', 'pom.xml')
+          }
 
           dependsOn project.generatePomPropertiesFileForMavenJavaPublication
           into("META-INF/maven/${project.group}/${project.name}") { from 
"${pomPropertiesFile}" }
@@ -1352,10 +1355,10 @@ artifactId=${project.name}
 
     project.ext.applyPortabilityNature = {
       println "applyPortabilityNature with " + (it ? "$it" : "default 
configuration") + " for project $project.name"
-      project.ext.applyJavaNature(enableFindbugs: false, shadowClosure: 
GrpcVendoring.shadowClosure(project) << {
+      project.ext.applyJavaNature(enableFindbugs: false, shadowClosure: 
GrpcVendoring.shadowClosure() << {
         // We perform all the code relocations but don't include
         // any of the actual dependencies since they will be supplied
-        // by beam-vendor-java-grpc-v1
+        // by beam-vendor-grpc-v1_13_1
         dependencies {
           exclude(dependency(".*:.*"))
         }
@@ -1392,7 +1395,7 @@ artifactId=${project.name}
         }
       }
 
-      project.dependencies GrpcVendoring.dependenciesClosure(project) << {
+      project.dependencies GrpcVendoring.dependenciesClosure() << {
         shadow it.project(path: ":beam-vendor-grpc-v1_13_1", configuration: 
"shadow")
       }
 
diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/GrpcVendoring.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/GrpcVendoring.groovy
index 13de8148d57..fc0a966c1af 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/GrpcVendoring.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/GrpcVendoring.groovy
@@ -24,36 +24,40 @@ import org.gradle.api.Project
  * Utilities for working with our vendored version of gRPC.
  */
 class GrpcVendoring {
-  /**
-   * Returns a closure contaning the dependencies map used for shading gRPC.
-   */
-  static Object dependenciesClosure(Project project) {
-    return {
-      compile 'com.google.guava:guava:20.0'
-      compile 'com.google.protobuf:protobuf-java:3.6.0'
-      compile 'com.google.protobuf:protobuf-java-util:3.6.0'
-      compile 'com.google.code.gson:gson:2.7'
-      compile 'io.grpc:grpc-auth:1.13.1'
-      compile 'io.grpc:grpc-core:1.13.1'
-      compile 'io.grpc:grpc-context:1.13.1'
-      compile 'io.grpc:grpc-netty:1.13.1'
-      compile 'io.grpc:grpc-protobuf:1.13.1'
-      compile 'io.grpc:grpc-stub:1.13.1'
-      compile 'io.netty:netty-transport-native-epoll:4.1.25.Final'
-      compile 'io.netty:netty-tcnative-boringssl-static:2.0.8.Final'
-      compile 'com.google.auth:google-auth-library-credentials:0.10.0'
-      compile 'io.grpc:grpc-testing:1.13.1'
-      compile 'com.google.api.grpc:proto-google-common-protos:1.12.0'
-      compile 'io.opencensus:opencensus-api:0.12.3'
-      compile 'io.opencensus:opencensus-contrib-grpc-metrics:0.12.3'
-      shadow 'com.google.errorprone:error_prone_annotations:2.1.2'
-    }
+  /** Returns the list of compile time dependencies. */
+  static List<String> dependencies() {
+    return [
+      'com.google.guava:guava:20.0',
+      'com.google.protobuf:protobuf-java:3.6.0',
+      'com.google.protobuf:protobuf-java-util:3.6.0',
+      'com.google.code.gson:gson:2.7',
+      'io.grpc:grpc-auth:1.13.1',
+      'io.grpc:grpc-core:1.13.1',
+      'io.grpc:grpc-context:1.13.1',
+      'io.grpc:grpc-netty:1.13.1',
+      'io.grpc:grpc-protobuf:1.13.1',
+      'io.grpc:grpc-stub:1.13.1',
+      'io.netty:netty-transport-native-epoll:4.1.25.Final',
+      'io.netty:netty-tcnative-boringssl-static:2.0.8.Final',
+      'com.google.auth:google-auth-library-credentials:0.10.0',
+      'io.grpc:grpc-testing:1.13.1',
+      'com.google.api.grpc:proto-google-common-protos:1.12.0',
+      'io.opencensus:opencensus-api:0.12.3',
+      'io.opencensus:opencensus-contrib-grpc-metrics:0.12.3',
+    ]
   }
 
   /**
-   * Returns a closure with the code relocation configuration for shading gRPC.
+   * Returns the list of runtime time dependencies that should be exported as 
runtime
+   * dependencies within the vendored jar.
    */
-  static Object shadowClosure(Project project) {
+  static List<String> runtimeDependencies() {
+    return [
+      'com.google.errorprone:error_prone_annotations:2.1.2'
+    ]
+  }
+
+  static Map<String, String> relocations() {
     // The relocation paths below specifically use gRPC and the full version 
string as
     // the code relocation prefix. See 
https://lists.apache.org/thread.html/4c12db35b40a6d56e170cd6fc8bb0ac4c43a99aa3cb7dbae54176815@%3Cdev.beam.apache.org%3E
     // for further details.
@@ -69,40 +73,72 @@ class GrpcVendoring {
     // ensures that there are no classes outside of the 'org.apache.beam' 
namespace.
 
     String prefix = "org.apache.beam.vendor.grpc.v1_13_1";
-    return {
+    List<String> packagesToRelocate = [
       // guava uses the com.google.common and com.google.thirdparty package 
namespaces
-      relocate "com.google.common", "${prefix}.com.google.common"
-      relocate "com.google.thirdparty", "${prefix}.com.google.thirdparty"
-
-      relocate "com.google.protobuf", "${prefix}.com.google.protobuf"
-      relocate "com.google.gson", "${prefix}.com.google.gson"
-      relocate "io.grpc", "${prefix}.io.grpc"
-      relocate "com.google.auth", "${prefix}.com.google.auth"
-      relocate "com.google.api", "${prefix}.com.google.api"
-      relocate "com.google.cloud", "${prefix}.com.google.cloud"
-      relocate "com.google.logging", "${prefix}.com.google.logging"
-      relocate "com.google.longrunning", "${prefix}.com.google.longrunning"
-      relocate "com.google.rpc", "${prefix}.com.google.rpc"
-      relocate "com.google.type", "${prefix}.com.google.type"
-      relocate "io.opencensus", "${prefix}.io.opencensus"
+      "com.google.common",
+      "com.google.thirdparty",
+      "com.google.protobuf",
+      "com.google.gson",
+      "io.grpc",
+      "com.google.auth",
+      "com.google.api",
+      "com.google.cloud",
+      "com.google.logging",
+      "com.google.longrunning",
+      "com.google.rpc",
+      "com.google.type",
+      "io.opencensus",
+      "io.netty"
+    ]
 
+    return packagesToRelocate.collectEntries {
+      [ (it): "org.apache.beam.vendor.grpc.v1_13_1.${it}" ]
+    } + [
       // Adapted from 
https://github.com/grpc/grpc-java/blob/e283f70ad91f99c7fee8b31b605ef12a4f9b1690/netty/shaded/build.gradle#L41
-      relocate "io.netty", "${prefix}.io.netty"
-      // We have to be careful with these replacements as they must not match 
any
+      // We       "io.netty": "${prefix}.io.netty",have to be careful with 
these replacements as they must not match any
       // string in NativeLibraryLoader, else they cause corruption. Note that
       // this includes concatenation of string literals and constants.
-      relocate 'META-INF/native/libnetty', 
'META-INF/native/liborg_apache_beam_vendor_grpc_v1_13_1_netty'
-      relocate 'META-INF/native/netty', 
'META-INF/native/org_apache_beam_vendor_grpc_v1_13_1_netty'
+      'META-INF/native/libnetty': 
'META-INF/native/liborg_apache_beam_vendor_grpc_v1_13_1_netty',
+      'META-INF/native/netty': 
'META-INF/native/org_apache_beam_vendor_grpc_v1_13_1_netty',
+    ]
+  }
 
+  /** Returns the list of shading exclusions. */
+  static List<String> exclusions() {
+    return [
       // Don't include errorprone, JDK8 annotations, objenesis, junit, and 
mockito in the vendored jar
-      exclude "com/google/errorprone/**"
-      exclude "com/google/instrumentation/**"
-      exclude "javax/annotation/**"
-      exclude "junit/**"
-      exclude "org/hamcrest/**"
-      exclude "org/junit/**"
-      exclude "org/mockito/**"
-      exclude "org/objenesis/**"
+      "com/google/errorprone/**",
+      "com/google/instrumentation/**",
+      "javax/annotation/**",
+      "junit/**",
+      "org/hamcrest/**",
+      "org/junit/**",
+      "org/mockito/**",
+      "org/objenesis/**",
+    ]
+  }
+
+  /**
+   * Returns a closure contaning the dependencies map used for shading gRPC 
within the main
+   * Apache Beam project.
+   */
+  static Object dependenciesClosure() {
+    return {
+      dependencies().each { compile it }
+      runtimeDependencies().each { shadow it }
+    }
+  }
+
+  /**
+   * Returns a closure with the code relocation configuration for shading gRPC 
within the main
+   * Apache Beam project.
+   */
+  static Object shadowClosure() {
+    return {
+      relocations().each { srcNamespace, destNamespace ->
+        relocate srcNamespace, destNamespace
+      }
+      exclusions().each { exclude it }
     }
   }
 }
diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy
index d668f092ab2..70f87db9fcc 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.beam.gradle
 
 import org.gradle.api.GradleException
@@ -25,12 +24,35 @@ import org.gradle.api.Project
 import org.gradle.api.file.FileTree
 import org.gradle.api.publish.maven.MavenPublication
 
+/**
+ * Usage:
+ * <ul>
+ *   <li>The version embedded in the vendored artifactId must match exactly 
the version of the vendored library with
+ *   using '_' as a replacement for special characters like '.'.
+ *   <li>The package relocation prefix should be 
'org.apache.beam.vendor.canonical_library_name.version_identifier.'.
+ *   <li>Upgrading the version of a vendored library should trigger a change 
in the artifact name.
+ *   <li>Vendored artifact versioning starts at 0.1 and is decoupled from 
Apache Beam releases and version numbers.
+ *   <li>Increment the vendored artifact version only if we need to release a 
new version.
+ * </ul>
+ *
+ * <p>Example for com.google.guava:guava:20.0:
+ * <ul>
+ *   <li>groupId: org.apache.beam
+ *   <li>artifactId: guava-20_0
+ *   <li>namespace: org.apache.beam.vendor.guava.v20_0
+ *   <li>version: 0.1
+ * </ul>
+ *
+ * <p>See <a 
href="https://lists.apache.org/thread.html/4c12db35b40a6d56e170cd6fc8bb0ac4c43a99aa3cb7dbae54176815@%3Cdev.beam.apache.org%3E";>
+ * original email thread</a> for a discussion of the topic.
+ */
 class VendorJavaPlugin implements Plugin<Project> {
 
   static class VendorJavaPluginConfig {
-    String dependency
-    List<String> packagesToRelocate
-    String intoPackage
+    List<String> dependencies
+    List<String> runtimeDependencies
+    Map<String, String> relocations
+    List<String> exclusions
     String groupId
     String artifactId
     String version
@@ -48,6 +70,10 @@ class VendorJavaPlugin implements Plugin<Project> {
     project.ext.vendorJava = {
       VendorJavaPluginConfig config = it ? it as VendorJavaPluginConfig : new 
VendorJavaPluginConfig()
 
+      if (!isRelease(project)) {
+        config.version += '-SNAPSHOT'
+      }
+
       project.apply plugin: 'com.github.johnrengelman.shadow'
 
       project.apply plugin: 'java'
@@ -61,12 +87,31 @@ class VendorJavaPlugin implements Plugin<Project> {
       // when attempting to resolve dependency issues.
       project.apply plugin: "project-report"
 
-      project.dependencies { compile "${config.dependency}" }
+      project.dependencies {
+        config.dependencies.each { compile it }
+        config.runtimeDependencies.each { runtime it }
+      }
+
+      // Create a task which emulates the maven-archiver plugin in generating a
+      // pom.properties file.
+      def pomPropertiesFile = 
"${project.buildDir}/publications/mavenJava/pom.properties"
+      project.task('generatePomPropertiesFileForMavenJavaPublication') {
+        outputs.file "${pomPropertiesFile}"
+        doLast {
+          new File("${pomPropertiesFile}").text =
+                  """version=${config.version}
+groupId=${project.group}
+artifactId=${project.name}
+"""
+        }
+      }
 
       project.shadowJar {
-        config.packagesToRelocate.each { srcNamespace ->
-          relocate(srcNamespace, "${config.intoPackage}.${srcNamespace}")
+        config.relocations.each { srcNamespace, destNamespace ->
+          relocate(srcNamespace, destNamespace)
         }
+        config.exclusions.each { exclude it }
+
         classifier = null
         mergeServiceFiles()
         zip64 true
@@ -89,61 +134,178 @@ class VendorJavaPlugin implements Plugin<Project> {
           }
         }
       }
+      project.check.dependsOn 'validateVendoring'
 
       project.apply plugin: 'maven-publish'
 
-      project.publishing {
-        repositories {
-          maven {
-            name "testPublicationLocal"
-            url "file://${project.rootProject.projectDir}/testPublication/"
+      // Only publish vendored dependencies if specifically requested.
+      if (project.hasProperty("vendoredDependenciesOnly")) {
+        // Have the shaded jar include both the generate pom.xml and its 
properties file
+        // emulating the behavior of the maven-archiver plugin.
+        project.shadowJar {
+          def pomFile = 
"${project.buildDir}/publications/mavenJava/pom-default.xml"
+
+          // Validate that the artifacts exist before copying them into the 
jar.
+          doFirst {
+            if (!project.file("${pomFile}").exists()) {
+              throw new GradleException("Expected ${pomFile} to have been 
generated by the 'generatePomFileForMavenJavaPublication' task.")
+            }
+            if (!project.file("${pomPropertiesFile}").exists()) {
+              throw new GradleException("Expected ${pomPropertiesFile} to have 
been generated by the 'generatePomPropertiesFileForMavenJavaPublication' task.")
+            }
+          }
+
+          dependsOn 'generatePomFileForMavenJavaPublication'
+          into("META-INF/maven/${project.group}/${project.name}") {
+            from "${pomFile}"
+            rename('.*', 'pom.xml')
+          }
+
+          dependsOn project.generatePomPropertiesFileForMavenJavaPublication
+          into("META-INF/maven/${project.group}/${project.name}") { from 
"${pomPropertiesFile}" }
+        }
+
+        project.publishing {
+          repositories {
+            maven {
+              name "testPublicationLocal"
+              url "file://${project.rootProject.projectDir}/testPublication/"
+            }
+            maven {
+              url(project.properties['distMgmtSnapshotsUrl'] ?: 
isRelease(project)
+                      ? 
'https://repository.apache.org/service/local/staging/deploy/maven2'
+                      : 
'https://repository.apache.org/content/repositories/snapshots')
+
+              // We attempt to find and load credentials from 
~/.m2/settings.xml file that a user
+              // has configured with the Apache release and snapshot staging 
credentials.
+              // <settings>
+              //   <servers>
+              //     <server>
+              //       <id>apache.releases.https</id>
+              //       <username>USER_TOKEN</username>
+              //       <password>PASS_TOKEN</password>
+              //     </server>
+              //     <server>
+              //       <id>apache.snapshots.https</id>
+              //       <username>USER_TOKEN</username>
+              //       <password>PASS_TOKEN</password>
+              //     </server>
+              //   </servers>
+              // </settings>
+              def settingsXml = new File(System.getProperty('user.home'), 
'.m2/settings.xml')
+              if (settingsXml.exists()) {
+                def serverId = (project.properties['distMgmtServerId'] ?: 
isRelease(project)
+                        ? 'apache.releases.https' : 'apache.snapshots.https')
+                def m2SettingCreds = new 
XmlSlurper().parse(settingsXml).servers.server.find { server -> 
serverId.equals(server.id.text()) }
+                if (m2SettingCreds) {
+                  credentials {
+                    username m2SettingCreds.username.text()
+                    password m2SettingCreds.password.text()
+                  }
+                }
+              }
+            }
           }
-          maven {
-            url(project.properties['distMgmtSnapshotsUrl'] ?: 
isRelease(project)
-                    ? 
'https://repository.apache.org/service/local/staging/deploy/maven2'
-                    : 
'https://repository.apache.org/content/repositories/snapshots')
-
-            // We attempt to find and load credentials from ~/.m2/settings.xml 
file that a user
-            // has configured with the Apache release and snapshot staging 
credentials.
-            // <settings>
-            //   <servers>
-            //     <server>
-            //       <id>apache.releases.https</id>
-            //       <username>USER_TOKEN</username>
-            //       <password>PASS_TOKEN</password>
-            //     </server>
-            //     <server>
-            //       <id>apache.snapshots.https</id>
-            //       <username>USER_TOKEN</username>
-            //       <password>PASS_TOKEN</password>
-            //     </server>
-            //   </servers>
-            // </settings>
-            def settingsXml = new File(System.getProperty('user.home'), 
'.m2/settings.xml')
-            if (settingsXml.exists()) {
-              def serverId = (project.properties['distMgmtServerId'] ?: 
isRelease(project)
-                      ? 'apache.releases.https' : 'apache.snapshots.https')
-              def m2SettingCreds = new 
XmlSlurper().parse(settingsXml).servers.server.find { server -> 
serverId.equals(server.id.text()) }
-              if (m2SettingCreds) {
-                credentials {
-                  username m2SettingCreds.username.text()
-                  password m2SettingCreds.password.text()
+
+          publications {
+            mavenJava(MavenPublication) {
+              groupId = config.groupId
+              artifactId = config.artifactId
+              version = config.version
+              artifact project.shadowJar
+
+              pom {
+                name = project.description
+                if (project.hasProperty("summary")) {
+                  description = project.summary
+                }
+                url = "http://beam.apache.org";
+                inceptionYear = "2016"
+                licenses {
+                  license {
+                    name = "Apache License, Version 2.0"
+                    url = "http://www.apache.org/licenses/LICENSE-2.0.txt";
+                    distribution = "repo"
+                  }
+                }
+                scm {
+                  connection = 
"scm:git:https://gitbox.apache.org/repos/asf/beam.git";
+                  developerConnection = 
"scm:git:https://gitbox.apache.org/repos/asf/beam.git";
+                  url = 
"https://gitbox.apache.org/repos/asf?p=beam.git;a=summary";
+                }
+                issueManagement {
+                  system = "jira"
+                  url = "https://issues.apache.org/jira/browse/BEAM";
+                }
+                mailingLists {
+                  mailingList {
+                    name = "Beam Dev"
+                    subscribe = "[email protected]"
+                    unsubscribe = "[email protected]"
+                    post = "[email protected]"
+                    archive = "http://www.mail-archive.com/dev%beam.apache.org";
+                  }
+                  mailingList {
+                    name = "Beam User"
+                    subscribe = "[email protected]"
+                    unsubscribe = "[email protected]"
+                    post = "[email protected]"
+                    archive = 
"http://www.mail-archive.com/user%beam.apache.org";
+                  }
+                  mailingList {
+                    name = "Beam Commits"
+                    subscribe = "[email protected]"
+                    unsubscribe = "[email protected]"
+                    post = "[email protected]"
+                    archive = 
"http://www.mail-archive.com/commits%beam.apache.org";
+                  }
                 }
+                developers {
+                  developer {
+                    name = "The Apache Beam Team"
+                    email = "[email protected]"
+                    url = "http://beam.apache.org";
+                    organization = "Apache Software Foundation"
+                    organizationUrl = "http://www.apache.org";
+                  }
+                }
+              }
+
+              pom.withXml {
+                // NB: This must come after asNode() logic, as it seems 
asNode()
+                // removes XML comments.
+                // TODO: Load this from file?
+                def elem = asElement()
+                def hdr = elem.getOwnerDocument().createComment(
+                        '''
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+        http://www.apache.org/licenses/LICENSE-2.0
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+  ''')
+                elem.insertBefore(hdr, elem.getFirstChild())
               }
             }
           }
         }
 
-        publications {
-          mavenJava(MavenPublication) {
-            groupId = config.groupId
-            artifactId = config.artifactId
-            version = config.version
-            artifact project.shadowJar
+        // Only sign artifacts if we are performing a release
+        if (isRelease(project) && !project.hasProperty('noSigning')) {
+          project.apply plugin: "signing"
+          project.signing {
+            useGpgCmd()
+            sign project.publishing.publications
           }
         }
       }
     }
   }
-
 }
diff --git a/settings.gradle b/settings.gradle
index ec056e7ef43..8b2d4d3df25 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -180,8 +180,11 @@ include "beam-sdks-python-container"
 project(":beam-sdks-python-container").dir = file("sdks/python/container")
 include "beam-sdks-python-container-py3"
 project(":beam-sdks-python-container-py3").dir = 
file("sdks/python/container/py3")
+// Temporary version that will be deleted once we migrate to using the 
published version.
 include "beam-vendor-grpc-v1_13_1"
 project(":beam-vendor-grpc-v1_13_1").dir = file("vendor/grpc-v1_13_1")
+include "beam-vendor-grpc-1_13_1"
+project(":beam-vendor-grpc-1_13_1").dir = file("vendor/grpc-1_13_1")
 include "beam-sdks-java-test-utils"
 project(":beam-sdks-java-test-utils").dir = 
file("sdks/java/testing/test-utils")
 include "beam-vendor-sdks-java-extensions-protobuf"
diff --git a/vendor/grpc-1_13_1/build.gradle b/vendor/grpc-1_13_1/build.gradle
new file mode 100644
index 00000000000..f307b99e7d8
--- /dev/null
+++ b/vendor/grpc-1_13_1/build.gradle
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.beam.gradle.GrpcVendoring
+
+apply plugin: org.apache.beam.gradle.VendorJavaPlugin
+
+description = "Apache Beam :: Vendored Dependencies :: gRPC :: 1.13.1"
+
+group = "org.apache.beam"
+version = "0.1"
+
+vendorJava(
+  dependencies: GrpcVendoring.dependencies(),
+  runtimeDependencies: GrpcVendoring.runtimeDependencies(),
+  relocations: GrpcVendoring.relocations(),
+  exclusions: GrpcVendoring.exclusions(),
+  artifactId: "beam-vendor-grpc-1_13_1",
+  groupId: group,
+  version: version,
+)
\ No newline at end of file
diff --git a/vendor/grpc-v1_13_1/build.gradle b/vendor/grpc-v1_13_1/build.gradle
index e99616a05ea..853993b6519 100644
--- a/vendor/grpc-v1_13_1/build.gradle
+++ b/vendor/grpc-v1_13_1/build.gradle
@@ -22,7 +22,7 @@ description = "Apache Beam :: Vendored Dependencies :: Java 
:: gRPC :: v1"
 ext.summary = "Add support to Apache Beam for Vendored gRPC V1."
 
 apply plugin: org.apache.beam.gradle.BeamModulePlugin
-applyJavaNature(enableFindbugs: false, shadowClosure: 
GrpcVendoring.shadowClosure(project))
+applyJavaNature(enableFindbugs: false, shadowClosure: 
GrpcVendoring.shadowClosure())
 
 // Don't force modules here because we don't want to take the shared 
declarations in build_rules.gradle
 // because we would like to have the freedom to choose which versions of 
dependencies we
@@ -31,6 +31,6 @@ configurations.all { config ->
   config.resolutionStrategy { forcedModules = []}
 }
 
-dependencies GrpcVendoring.dependenciesClosure(project)
+dependencies GrpcVendoring.dependenciesClosure()
 
 // TODO(BEAM-4544): Integrate intellij support into this.
diff --git a/vendor/guava-20_0/build.gradle b/vendor/guava-20_0/build.gradle
index d6bc6e4f939..2b51af84159 100644
--- a/vendor/guava-20_0/build.gradle
+++ b/vendor/guava-20_0/build.gradle
@@ -23,10 +23,11 @@ description = "Apache Beam :: Vendored Dependencies :: 
Guava 20"
 group = "org.apache.beam"
 version = "0.1"
 
-
 vendorJava(
-  dependency: "com.google.guava:guava:20.0",
-  packagesToRelocate: ["com.google.common", "com.google.thirdparty"],
-  intoPackage: "org.apache.beam.guava.v20_0",
+  dependencies: ["com.google.guava:guava:20.0"],
+  relocations: [
+    "com.google.common": 
"org.apache.beam.vendor.guava.v20_0.com.google.common",
+    "com.google.thirdparty": 
"org.apache.beam.vendor.guava.v20_0.com.google.thirdparty",
+  ],
   artifactId: "beam-vendor-guava-20_0"
 )


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 166742)
    Time Spent: 2h  (was: 1h 50m)

> Migrate gRPC to use vendoring library and vendoring format
> ----------------------------------------------------------
>
>                 Key: BEAM-6056
>                 URL: https://issues.apache.org/jira/browse/BEAM-6056
>             Project: Beam
>          Issue Type: Sub-task
>          Components: build-system
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: Minor
>              Labels: portability
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> This thread discusses the work: 
> https://lists.apache.org/thread.html/4c12db35b40a6d56e170cd6fc8bb0ac4c43a99aa3cb7dbae54176815@%3Cdev.beam.apache.org%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to