This is an automated email from the ASF dual-hosted git repository.
scott pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 02be861 upgrade to gogradle plugin 0.11.2
new 622c9c8 Merge pull request #7762: upgrade to gogradle plugin 0.11.2
02be861 is described below
commit 02be861791ffbb7f642cfd8cd541db297f4057e5
Author: Michael Luckey <[email protected]>
AuthorDate: Thu Feb 7 00:28:08 2019 +0100
upgrade to gogradle plugin 0.11.2
---
build.gradle | 4 ++--
.../main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy | 6 ++++++
sdks/go/build.gradle | 4 ++--
sdks/go/container/build.gradle | 6 +++---
sdks/go/examples/build.gradle | 4 ++--
sdks/go/test/build.gradle | 4 ++--
sdks/java/container/build.gradle | 6 +++---
sdks/python/container/build.gradle | 10 +++++-----
8 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/build.gradle b/build.gradle
index 2af3d20..4a8a948 100644
--- a/build.gradle
+++ b/build.gradle
@@ -55,7 +55,7 @@ buildscript {
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"
// Enable Apache license enforcement
classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0"
// Enable Avro code generation
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.17.0"
// Enable a code formatting plugin
- classpath "gradle.plugin.com.github.blindpirate:gogradle:0.10"
// Enable Go code compilation
+ classpath "gradle.plugin.com.github.blindpirate:gogradle:0.11.2"
// Enable Go code compilation
classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.20.1"
// Enable building Docker containers
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.3.1"
// Adds a 'taskTree' task to print task dependency tree
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.3"
// Enable shading Java dependencies
@@ -211,7 +211,7 @@ task javaPostCommitPortabilityApi () {
}
task goPreCommit() {
- dependsOn ":beam-sdks-go:test"
+ dependsOn ":beam-sdks-go:goTest"
dependsOn ":beam-sdks-go-examples:build"
dependsOn ":beam-sdks-go-test:build"
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 cb41298..47f97e1 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -1270,6 +1270,9 @@ class BeamModulePlugin implements Plugin<Project> {
/**
***********************************************************************************************/
project.ext.applyGoNature = {
+ // Define common lifecycle tasks and artifact types
+ project.apply plugin: 'base'
+
project.apply plugin: "com.github.blindpirate.gogradle"
project.golang { goVersion = '1.10' }
@@ -1283,6 +1286,9 @@ class BeamModulePlugin implements Plugin<Project> {
root 'github.com/apache/thrift'
emptyDir()
}
+ project.clean.dependsOn project.goClean
+ project.check.dependsOn project.goCheck
+ project.assemble.dependsOn project.goBuild
}
project.idea {
diff --git a/sdks/go/build.gradle b/sdks/go/build.gradle
index fe117bb..5bc2e73 100644
--- a/sdks/go/build.gradle
+++ b/sdks/go/build.gradle
@@ -24,7 +24,7 @@ description = "Apache Beam :: SDKs :: Go"
golang {
packagePath = 'github.com/apache/beam/sdks/go'
- build {
+ goBuild {
// The symlinks makes it hard (impossible?) to do a wildcard build
// of pkg. Go build refuses to follow symlinks. Drop for now. The files
// are built when tested anyway.
@@ -37,7 +37,7 @@ golang {
}
// Ignore spurious vet errors during check for [BEAM-4831].
- vet {
+ goVet {
continueOnFailure = true
}
}
diff --git a/sdks/go/container/build.gradle b/sdks/go/container/build.gradle
index 24e7a99..276bde2 100644
--- a/sdks/go/container/build.gradle
+++ b/sdks/go/container/build.gradle
@@ -25,7 +25,7 @@ description = "Apache Beam :: SDKs :: Go :: Container"
// Figure out why the golang plugin does not add a build dependency between
projects.
// Without the line below, we get spurious errors about not being able to
resolve
// "./github.com/apache/beam/sdks/go"
-resolveBuildDependencies.dependsOn ":beam-sdks-go:build"
+resolveBuildDependencies.dependsOn ":beam-sdks-go:goBuild"
dependencies {
golang {
@@ -38,7 +38,7 @@ dependencies {
golang {
packagePath = 'github.com/apache/beam/sdks/go/boot'
- build {
+ goBuild {
// TODO(herohde): build local platform + linux-amd64, if possible.
targetPlatform = ['linux-amd64']
outputLocation = './build/target/${GOOS}_${GOARCH}/boot'
@@ -50,4 +50,4 @@ docker {
files "./build/"
}
// Ensure that making the docker image builds any required artifacts
-dockerPrepare.dependsOn build
+dockerPrepare.dependsOn goBuild
diff --git a/sdks/go/examples/build.gradle b/sdks/go/examples/build.gradle
index 05a9245..23f8fd7 100644
--- a/sdks/go/examples/build.gradle
+++ b/sdks/go/examples/build.gradle
@@ -30,7 +30,7 @@ def getLocalPlatform = {
// Figure out why the golang plugin does not add a build dependency between
projects.
// Without the line below, we get spurious errors about not being able to
resolve
// "./github.com/apache/beam/sdks/go"
-resolveBuildDependencies.dependsOn ":beam-sdks-go:build"
+resolveBuildDependencies.dependsOn ":beam-sdks-go:goBuild"
dependencies {
golang {
@@ -43,7 +43,7 @@ dependencies {
golang {
packagePath = 'github.com/apache/beam/sdks/go/examples'
- build {
+ goBuild {
// We always want to build linux-amd64 in addition to the user host
platform
// so we can submit this as the remote binary used within the Go container.
//
diff --git a/sdks/go/test/build.gradle b/sdks/go/test/build.gradle
index 9370ae3..0504a8b 100644
--- a/sdks/go/test/build.gradle
+++ b/sdks/go/test/build.gradle
@@ -24,7 +24,7 @@ description = "Apache Beam :: SDKs :: Go :: Test"
// Figure out why the golang plugin does not add a build dependency between
projects.
// Without the line below, we get spurious errors about not being able to
resolve
// "./github.com/apache/beam/sdks/go"
-resolveBuildDependencies.dependsOn ":beam-sdks-go:build"
+resolveBuildDependencies.dependsOn ":beam-sdks-go:goBuild"
dependencies {
golang {
@@ -37,7 +37,7 @@ dependencies {
golang {
packagePath = 'github.com/apache/beam/sdks/go/test'
- build {
+ goBuild {
// Build the linux-amd64 worker. The native version is built in the parent
to
// have a fixed name, which is not possible with multiple target
platforms. The
// script would otherwise have to figure out which arch/platform binary to
invoke.
diff --git a/sdks/java/container/build.gradle b/sdks/java/container/build.gradle
index 1a4f611..c89fd39 100644
--- a/sdks/java/container/build.gradle
+++ b/sdks/java/container/build.gradle
@@ -25,7 +25,7 @@ description = "Apache Beam :: SDKs :: Java :: Container"
// Figure out why the golang plugin does not add a build dependency between
projects.
// Without the line below, we get spurious errors about not being able to
resolve
// "./github.com/apache/beam/sdks/go"
-resolveBuildDependencies.dependsOn ":beam-sdks-go:build"
+resolveBuildDependencies.dependsOn ":beam-sdks-go:goBuild"
configurations {
dockerDependency
@@ -53,7 +53,7 @@ task copyDockerfileDependencies(type: Copy) {
golang {
packagePath = 'github.com/apache/beam/sdks/java/boot'
- build {
+ goBuild {
// TODO(herohde): build local platform + linux-amd64, if possible.
targetPlatform = ['linux-amd64']
outputLocation = './build/target/${GOOS}_${GOARCH}/boot'
@@ -65,5 +65,5 @@ docker {
files "./build/"
}
// Ensure that we build the required resources and copy and file dependencies
from related projects
-dockerPrepare.dependsOn build
+dockerPrepare.dependsOn goBuild
dockerPrepare.dependsOn copyDockerfileDependencies
diff --git a/sdks/python/container/build.gradle
b/sdks/python/container/build.gradle
index 41ae655..2a56abd 100644
--- a/sdks/python/container/build.gradle
+++ b/sdks/python/container/build.gradle
@@ -25,7 +25,7 @@ description = "Apache Beam :: SDKs :: Python :: Container"
// Figure out why the golang plugin does not add a build dependency between
projects.
// Without the line below, we get spurious errors about not being able to
resolve
// "./github.com/apache/beam/sdks/go"
-resolveBuildDependencies.dependsOn ":beam-sdks-go:build"
+resolveBuildDependencies.dependsOn ":beam-sdks-go:goBuild"
configurations {
sdkSourceTarball
@@ -42,7 +42,7 @@ dependencies {
sdkSourceTarball project(path: ":beam-sdks-python", configuration:
"distConfig")
}
-task copyDockerfileDependencies(type: Copy, dependsOn: build) {
+task copyDockerfileDependencies(type: Copy, dependsOn: goBuild) {
from configurations.sdkSourceTarball
from file("./base_image_requirements.txt")
into "build/target"
@@ -53,7 +53,7 @@ task copyDockerfileDependencies(type: Copy, dependsOn: build)
{
golang {
packagePath = 'github.com/apache/beam/sdks/python/boot'
- build {
+ goBuild {
// Build for linux and mac.
targetPlatform = ['linux-amd64', 'darwin-amd64']
outputLocation = './build/target/launcher/${GOOS}_${GOARCH}/boot'
@@ -66,9 +66,9 @@ docker {
}
artifacts {
- sdkHarnessLauncher file: file('./build/target/launcher'), builtBy: build
+ sdkHarnessLauncher file: file('./build/target/launcher'), builtBy: goBuild
}
// Ensure that making the docker image builds any required artifacts
-dockerPrepare.dependsOn build
+dockerPrepare.dependsOn goBuild
dockerPrepare.dependsOn copyDockerfileDependencies