Commit Graph

17 Commits

Author SHA1 Message Date
Ismael Juma b8a9201280
MINOR: Update to Gradle 6.8.1 (#9953)
A number of regressions were fixed (see "Fixed issues" section):

https://docs.gradle.org/6.8.1/release-notes.html

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-23 15:54:06 -08:00
Ismael Juma 1ca497a7fd
MINOR: Upgrade gradle to 6.8 and test retry plugin to 1.2.0 (#9849)
Also fix generation of `gradlew` when `APP_HOME` contains a directory with spaces
in its name.

Release notes:
* https://docs.gradle.org/6.8/release-notes.html
* https://github.com/gradle/test-retry-gradle-plugin/releases/tag/v1.2.0

In addition to existing tests, verified that `./gradlewAll jar` succeeds.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-18 09:04:20 -08:00
Gwen Shapira 8ac5ef90a0 MINOR: gradle wrapper should handle directories with spaces
If attempting to build the project from a directory with spaces in its name and gradle-wrapper.jar is missing, the script will fail to download a new one because the "if" condition will break because $APP_HOME will resolve to multiple strings. Protecting $APP_HOME with quotes fixes the issue. Tested by deleting gradle.wrapper and trying to build.

Author: Gwen Shapira <cshapi@gmail.com>

Reviewers: Chia-Ping Tsai

Closes #9813 from gwenshap/fix_gradlew
2021-01-03 21:44:05 -08:00
Ismael Juma a5986bd32d
MINOR: Update build and test dependencies (#9645)
The spotbugs upgrade means we can re-enable
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE and RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE.
These uncovered one bug, one unnecessary null check and one
false positive. Addressed them all, including a test for the bug.

* gradle (6.7.0 -> 6.7.1): minor fixes.
* gradle versions plugin (0.29.0 -> 0.36.0): minor fixes.
* grgit (4.0.2 -> 4.1.0): a few small fixes and dependency bumps.
* owasp dependency checker plugin (5.3.2.1 -> 6.0.3): improved db
schema, data and several fixes. 
* scoverage plugin (4.0.2 -> 5.0.0): support Scala 2.13.
* shadow plugin (6.0.0 -> 6.1.0): require Java 8, support for Java 16.
* spotbugs plugin (4.4.4 -> 4.6.0): support SARIF reporting standard.
* spotbugs (4.0.6 -> 4.1.4): support for Java 16 and various fixes including
try with resources false positive.
* spotless plugin (5.1.0 -> 5.8.2): minor fixes.
* test retry plugin (1.1.6 -> 1.1.9): newer gradle and java version compatibility
fixes.
* mockito (3.5.7 -> 3.6.0): minor fixes.
* powermock (2.0.7 -> 2.0.9): minor fixes.

Release notes links:
* https://docs.gradle.org/6.7.1/release-notes.html
* https://github.com/spotbugs/spotbugs/blob/4.1.4/CHANGELOG.md
* https://github.com/scoverage/gradle-scoverage/releases/tag/5.0.0
* https://github.com/johnrengelman/shadow/releases/tag/6.1.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.5.0
* https://github.com/ben-manes/gradle-versions-plugin/releases
* https://github.com/ajoberstar/grgit/releases/tag/4.1.0
* https://github.com/jeremylong/DependencyCheck/blob/main/RELEASE_NOTES.md#version-603-2020-11-03
* https://github.com/powermock/powermock/releases/tag/powermock-2.0.8
* https://github.com/powermock/powermock/releases/tag/powermock-2.0.9
* https://github.com/mockito/mockito/blob/v3.6.0/doc/release-notes/official.md
* https://github.com/gradle/test-retry-gradle-plugin/releases
* https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-11-24 06:20:05 -08:00
Ismael Juma ebe6595c3d
MINOR: Upgrade to gradle 6.7 (#9440)
This release includes a key fix:
* Zinc leaks its dependencies to user classpath (https://github.com/gradle/gradle/issues/14168)

Release notes:
https://docs.gradle.org/6.7/release-notes.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-10-15 07:54:43 -07:00
Ismael Juma 26d620ec55
MINOR: Upgrade Gradle to 6.6 (#9160)
A couple of important bug fixes affecting Scala compilation are the main driver:
* https://github.com/gradle/gradle/issues/13224
* https://github.com/gradle/gradle/issues/13392

Full release notes for the other improvements:
* https://docs.gradle.org/6.6/release-notes.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-08-11 09:22:19 -07:00
Ismael Juma 3af3ab9bf9
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.

I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.

I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.

On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon 
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.

Gradle 6.4 with no cached daemon:

```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.15s user 0.12s system 0% cpu 2:08.06 total
```

Gradle 6.4 with cached daemon:

```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  0.95s user 0.10s system 0% cpu 2:01.42 total
```

Gradle 6.5 with no cached daemon:

```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.27s user 0.12s system 1% cpu 1:47.71 total
```

Gradle 6.5 with cached daemon:

```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.02s user 0.10s system 1% cpu 1:38.31 total
```

This PR with no cached Gradle daemon:

```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.27s user 0.10s system 1% cpu 1:38.70 total
```

This PR with cached Gradle daemon:

```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.02s user 0.10s system 1% cpu 1:29.35 total
```

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-03 13:18:50 -07:00
Ismael Juma 2d37c8c844
Update Gradle to 6.4.1 (#8678)
This fixes critical bugs in Gradle 6.4:

* Regression: Different daemons are used between IDE and CLI builds for the same project
* Regression: Main-Class attribute always added to jar manifest when using application plugin
* Fix potential NPE if code is executed concurrently

More details: https://github.com/gradle/gradle/releases/tag/v6.4.1

Reviewers: Manikumar Reddy <manikumar@confluent.io>
2020-05-17 11:02:53 -07:00
Ismael Juma d6da0452b6
MINOR: Update to Gradle 6.3 (#7677)
* Introduce `gradlewAll` script to replace `*All` tasks since the approach
used by the latter doesn't work since Gradle 6.0 and it's unclear when,
if ever, it will work again ( see https://github.com/gradle/gradle/issues/11301).
* Update release script and README given the above.
* Update zinc to 1.3.5.
* Update gradle-versions-plugin to 0.28.0.

The major improvements in Gradle 6.0 to 6.3 are:
- Improved incremental compilation for Scala
- Support for Java 14 (although some Gradle plugins
like spotBugs may need to be updated or disabled,
will do that separately)
- Improved scalac reporting, warnings are clearly
marked as such, which is very helpful.

Tested `gradlewAll` manually for the commands listed in the README
and release script. For `uploadArchive`, I tested it with a local Maven
repository.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-04-19 19:24:21 -07:00
Ismael Juma 45842a3962
MINOR: Remove unnecessary license generation code in wrapper.gradle (#7742)
Newer versions of Gradle handle this automatically. Tested with Gradle 5.6.

Credit to @granthenke for the tip.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-11-24 10:51:49 -08:00
Grant Henke 09f700ab3e KAFKA-1714: Fix gradle wrapper bootstrapping (#6031)
Given we need to follow the Apache rule of not checking
any binaries into the source code, Kafka has always had
a bit of a tricky Gradle bootstrap.
Using ./gradlew as users expect doesn’t work and a
local and compatible version of Gradle was required to
generate the wrapper first.

This patch changes the behavior of the wrapper task to
instead generate a gradlew script that can bootstrap the
jar itself. Additionally it adds a license, removes the bat
script, and handles retries.

The documentation in the readme was also updated.

Going forward patches that upgrade gradle should run
`gradle wrapper` before checking in the change.

With this change users using ./gradlew can be sure they
are always building with the correct version of Gradle.

Reviewers: Viktor Somogyi <viktorsomogyi@gmail.com>, Ismael Juma <ismael@juma.me.uk
2019-11-21 08:06:06 -08:00
Kamil Szymanski 135860225e MINOR: Remove incomplete gradle wrapper infrastructure
Since jar files (including gradle-wrapper.jar) have to
be excluded from source releases, current gradle wrapper
infrastructure is incomplete rendering it unusable and
confusing (I expected gradlew script to work without
having to run default gradle task to download
gradle-wrapper.jar).

Author: Kamil Szymanski <kamil.szymanski.dev@gmail.com>

Reviewers: Gwen Shapira <cshapi@gmail.com>, Grant Henke <granthenke@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #1722 from kamilszymanski/gradlew-cleanup
2016-12-20 10:49:19 +00:00
Ismael Juma 7a877895a1 KAFKA-4082; Upgrade to Gradle 3.0
Also upgrade scoverage (required for compatibility) and remove usage of
`useAnt` which doesn't exist in Gradle 3.0

It turns out that one cannot even run `gradle` to download the project Gradle version if `useAnt` is used in the build. This is unfortunate (the SBT launcher has much saner behaviour).

Release notes: https://docs.gradle.org/3.0/release-notes

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Grant Henke <granthenke@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>, Sriharsha Chintalapani <harsha@hortonworks.com>

Closes #1774 from ijuma/kafka-4082-support-gradle-3.0
2016-08-23 23:56:36 +01:00
Ismael Juma cd427c9b90 MINOR: Upgrade to Gradle 2.13
There are a few improvements in 2.12 and 2.13. I am particularly interested in the performance improvements:
* 2.12: "This release brings support for compile only dependencies, improved build script compilation speed and even better IDE support."
* 2.13: "We've achieved performance improvements during Gradle's configuration and execution phase, where we have measured up to 25% improvements to build time in our performance tests. No changes to your build script are necessary to start taking advantage of these improvements."

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Gwen Shapira

Closes #1271 from ijuma/gradle-2.13
2016-04-26 15:14:33 -07:00
Ismael Juma d6e900a185 MINOR: Update to Gradle 2.9 and update generated `gradlew` file
More performance improvements:

"In many cases, Gradle 2.9 is much faster than Gradle 2.8 when performing incremental builds.

Very large builds (many thousands of source files) could see incremental build speeds up to 80% faster than 2.7 and up to 40% faster than 2.8.

Gradle now uses a more efficient mechanism to scan the filesystem, making up-to-date checks significantly faster. This improvement is only available when running Gradle with Java 7 or newer.

Other improvements have been made to speed-up include and exclude pattern evaluation; these improvements apply to all supported Java versions.

Gradle now uses much less memory than previous releases when performing incremental builds. By de-duplicating Strings used as file paths in internal caches, and by reducing the overhead of listing classes under test for Java projects, some builds use 30-70% less memory that Gradle 2.8."

https://docs.gradle.org/current/release-notes

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Grant Henke, Guozhang Wang

Closes #549 from ijuma/gradle-2.9
2015-11-18 12:44:02 -08:00
Jun Rao 27bc37289c trivial change to README to make the gradle wrapper download clearer 2014-09-23 14:39:10 -07:00
Jun Rao 52614ad65e kafka-1171; Gradle build for Kafka; patched by David Arthur, Joe Stein, Chris Freeman and Jun Rao; reviewed by Guozhang Wang, Joel Koshy and Neha Narkhede 2014-02-07 13:48:04 -08:00