Skip to content

Commit

Permalink
Merge pull request apache#12776: [BEAM-9456] Upgrade Gradle to 6.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mxm authored Sep 10, 2020
2 parents 5705526 + f1ce459 commit 1db383c
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 52 deletions.
27 changes: 4 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,22 @@

plugins {
id 'base'
// Enable publishing build scans
id 'com.gradle.build-scan' version '2.3' apply false
// This plugin provides a task to determine which dependencies have updates.
// Additionally, the plugin checks for updates to Gradle itself.
//
// See https://github.com/ben-manes/gradle-versions-plugin for further details.
id 'com.github.ben-manes.versions' version '0.20.0'
id 'com.github.ben-manes.versions' version '0.29.0'
// Apply one top level rat plugin to perform any required license enforcement analysis
id 'org.nosphere.apache.rat' version '0.4.0'
id 'org.nosphere.apache.rat' version '0.7.0'
// Enable gradle-based release management
id 'net.researchgate.release' version '2.6.0'
id 'net.researchgate.release' version '2.8.1'
id 'org.apache.beam.module'
id "org.sonarqube" version "2.7"
id "org.sonarqube" version "3.0"
}

/*************************************************************************************************/
// Configure the root project

// Plugins which require online access should not be enabled when running in offline mode.
if (!gradle.startParameter.isOffline()) {
apply plugin: "com.gradle.build-scan"
}

// JENKINS_HOME and BUILD_ID set automatically during Jenkins execution
def isCIBuild = ['JENKINS_HOME', 'BUILD_ID'].every System.&getenv
if (isCIBuild) {
buildScan {
// Build Scan enabled and TOS accepted for Jenkins lab build. This does not apply to builds on
// non-Jenkins machines. Developers need to separately enable and accept TOS to use build scans.
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
publishAlways()
}
}

rat {
// Set input directory to that of the root project instead of the CWD. This
// makes .gitignore rules (added below) work properly.
Expand Down
24 changes: 12 additions & 12 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
plugins {
id 'java-gradle-plugin'
id 'groovy'
id "com.diffplug.gradle.spotless" version "3.24.0"
id "com.diffplug.spotless" version "5.1.1"
}

// Define the set of repositories required to fetch and enable plugins.
Expand All @@ -38,26 +38,26 @@ dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
compile 'com.github.spotbugs:spotbugs-gradle-plugin:3.0.0' // Enable spotbugs
compile "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.0"

runtime "net.ltgt.gradle:gradle-apt-plugin:0.20" // Enable a Java annotation processor
runtime "com.google.protobuf:protobuf-gradle-plugin:0.8.5" // Enable proto code generation
runtime "net.ltgt.gradle:gradle-apt-plugin:0.21" // Enable a Java annotation processor
runtime "com.google.protobuf:protobuf-gradle-plugin:0.8.8" // Enable proto code generation
runtime "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE" // Enable provided and optional configurations
runtime "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0" // Enable Avro code generation
runtime "com.diffplug.spotless:spotless-plugin-gradle:3.24.0" // Enable a code formatting plugin
runtime "com.diffplug.spotless:spotless-plugin-gradle:5.1.1" // Enable a code formatting plugin
runtime "gradle.plugin.com.github.blindpirate:gogradle:0.11.4" // Enable Go code compilation
runtime "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.20.1" // Enable building Docker containers
runtime "gradle.plugin.com.dorongold.plugins:task-tree:1.3.1" // Adds a 'taskTree' task to print task dependency tree
runtime "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.22.0" // Enable building Docker containers
runtime "gradle.plugin.com.dorongold.plugins:task-tree:1.5" // Adds a 'taskTree' task to print task dependency tree
runtime "com.github.jengelman.gradle.plugins:shadow:4.0.3" // Enable shading Java dependencies
runtime "ca.coglinc:javacc-gradle-plugin:2.4.0" // Enable the JavaCC parser generator
runtime "net.linguica.gradle:maven-settings-plugin:0.5"
runtime "gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.5.0" // Enable creating an offline repository
runtime "net.ltgt.gradle:gradle-errorprone-plugin:1.1.1" // Enable errorprone Java static analysis
runtime "org.ajoberstar.grgit:grgit-gradle:3.0.0" // Enable website git publish to asf-site branch
runtime "com.avast.gradle:gradle-docker-compose-plugin:0.8.8" // Enable docker compose tasks
runtime "ca.cutterslade.gradle:gradle-dependency-analyze:1.3.1" // Enable dep analysis
runtime "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1" // Enable errorprone Java static analysis
runtime "org.ajoberstar.grgit:grgit-gradle:4.0.2" // Enable website git publish to asf-site branch
runtime "com.avast.gradle:gradle-docker-compose-plugin:0.13.2" // Enable docker compose tasks
runtime "ca.cutterslade.gradle:gradle-dependency-analyze:1.4.2" // Enable dep analysis
runtime "gradle.plugin.net.ossindex:ossindex-gradle-plugin:0.4.11" // Enable dep vulnerability analysis
runtime "org.checkerframework:checkerframework-gradle-plugin:0.5.5" // Enable enhanced static checking plugin
runtime "org.checkerframework:checkerframework-gradle-plugin:0.5.10" // Enable enhanced static checking plugin
}

// Because buildSrc is built and tested automatically _before_ gradle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class BeamModulePlugin implements Plugin<Project> {
// * checkstyle
// * spotbugs
// * shadow (conditional on shadowClosure being specified)
// * com.diffplug.gradle.spotless (code style plugin)
// * com.diffplug.spotless (code style plugin)
//
// Dependency Management for Java Projects
// ---------------------------------------
Expand Down Expand Up @@ -887,7 +887,7 @@ class BeamModulePlugin implements Plugin<Project> {
project.apply plugin: "net.ltgt.apt-eclipse"

// Enables a plugin which can apply code formatting to source.
project.apply plugin: "com.diffplug.gradle.spotless"
project.apply plugin: "com.diffplug.spotless"
// scan CVE
project.apply plugin: "net.ossindex.audit"
project.audit { rateLimitAsError = false }
Expand All @@ -907,6 +907,11 @@ class BeamModulePlugin implements Plugin<Project> {
// Enables a plugin which performs code analysis for common bugs.
// This plugin is configured to only analyze the "main" source set.
if (configuration.enableSpotbugs) {
project.tasks.whenTaskAdded {task ->
if(task.name.contains("spotbugsTest")) {
task.enabled = false
}
}
project.apply plugin: 'com.github.spotbugs'
project.dependencies {
spotbugs "com.github.spotbugs:spotbugs:$spotbugs_version"
Expand All @@ -915,9 +920,8 @@ class BeamModulePlugin implements Plugin<Project> {
}
project.spotbugs {
excludeFilter = project.rootProject.file('sdks/java/build-tools/src/main/resources/beam/spotbugs-filter.xml')
sourceSets = [sourceSets.main]
}
project.tasks.withType(com.github.spotbugs.SpotBugsTask) {
project.tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
html.enabled = !project.jenkins.isCIBuild
xml.enabled = project.jenkins.isCIBuild
Expand Down Expand Up @@ -1519,7 +1523,7 @@ class BeamModulePlugin implements Plugin<Project> {
project.ext.applyGroovyNature = {
project.apply plugin: "groovy"

project.apply plugin: "com.diffplug.gradle.spotless"
project.apply plugin: "com.diffplug.spotless"
def disableSpotlessCheck = project.hasProperty('disableSpotlessCheck') &&
project.disableSpotlessCheck == 'true'
project.spotless {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
################################################################################
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
32 changes: 32 additions & 0 deletions runners/flink/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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.
*/

apply plugin: 'com.diffplug.spotless'

/*
* This build.gradle file is empty except to configure the spotless task on the java sources.
* These java sources are included in the subproject's sources in order to compile against the different versions.
* We configure spotless here once in order to only check these java sources once.
*/
spotless {
java {
licenseHeader org.apache.beam.gradle.BeamModulePlugin.javaLicenseHeader
googleJavaFormat('1.7')
target project.fileTree(project.projectDir) { include 'src/*/java/**/*.java' }
}
}
11 changes: 0 additions & 11 deletions runners/flink/flink_runner.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ sourceSets {
}
}

/*
* By default, Spotless operates on the project files only.
* BeamModulePlugin sets a custom configuration which we override here in order
* for the Flink Runner's multiple source directories to be all scanned.
*/
spotless {
java {
target target + project.fileTree(project.projectDir.parentFile) { include 'src/*/java/**/*.java' }
}
}

test {
systemProperty "log4j.configuration", "log4j-test.properties"
// Change log level to debug:
Expand Down
25 changes: 25 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@
* limitations under the License.
*/


plugins {
id "com.gradle.enterprise" version "3.4" apply false
}


// Plugins which require online access should not be enabled when running in offline mode.
if (!gradle.startParameter.isOffline()) {
apply plugin: "com.gradle.enterprise"
}

// JENKINS_HOME and BUILD_ID set automatically during Jenkins execution
def isCIBuild = ['JENKINS_HOME', 'BUILD_ID'].every System.&getenv
if (isCIBuild) {
gradleEnterprise {
buildScan {
// Build Scan enabled and TOS accepted for Jenkins lab build. This does not apply to builds on
// non-Jenkins machines. Developers need to separately enable and accept TOS to use build scans.
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
publishAlways()
}
}
}

rootProject.name = "beam"

include ":release"
Expand Down

0 comments on commit 1db383c

Please sign in to comment.