From b4496d283654222d47fe919d4c6dd80d5b3dab46 Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Wed, 12 Jul 2023 10:59:07 +0200 Subject: [PATCH 1/3] Add contributors to Gradle 8.3 --- subprojects/docs/src/docs/release/notes.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subprojects/docs/src/docs/release/notes.md b/subprojects/docs/src/docs/release/notes.md index 540686b3bafd..11f4266cfd12 100644 --- a/subprojects/docs/src/docs/release/notes.md +++ b/subprojects/docs/src/docs/release/notes.md @@ -9,6 +9,19 @@ Include only their name, impactful features should be called out separately belo THiS LIST SHOULD BE ALPHABETIZED BY [PERSON NAME] - the docs:updateContributorsInReleaseNotes task will enforce this ordering, which is case-insensitive. --> We would like to thank the following community members for their contributions to this release of Gradle: +[Adam](https://github.com/aSemy), +[Ahmed Ehab](https://github.com/ahmedehabb), +[Aurimas](https://github.com/liutikas), +[Baptiste Decroix](https://github.com/bdecroix-spiria), +[Björn Kautler](https://github.com/Vampire), +[Borewit](https://github.com/Borewit), +[Korov](https://github.com/Korov), +[Mohammed Thavaf](https://github.com/mthavaf), +[Patrick Brückner](https://github.com/madmuffin1), +[Philip Wedemann](https://github.com/hfhbd), +[Róbert Papp](https://github.com/TWiStErRob), +[Shi Chen](https://github.com/CsCherrYY), +[Tony Robalik](https://github.com/autonomousapps) ## Upgrade instructions From ab2029dc0d5a6904084460efe895005791de663f Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Thu, 13 Jul 2023 10:40:06 +0200 Subject: [PATCH 2/3] Finalize release notes for 8.3 RC1 --- .../AllDistributionIntegrationSpec.groovy | 2 +- subprojects/docs/src/docs/release/notes.md | 211 ++++++++++-------- 2 files changed, 124 insertions(+), 89 deletions(-) diff --git a/subprojects/distributions-integ-tests/src/integTest/groovy/org/gradle/AllDistributionIntegrationSpec.groovy b/subprojects/distributions-integ-tests/src/integTest/groovy/org/gradle/AllDistributionIntegrationSpec.groovy index 8013f596451c..c686455bb912 100644 --- a/subprojects/distributions-integ-tests/src/integTest/groovy/org/gradle/AllDistributionIntegrationSpec.groovy +++ b/subprojects/distributions-integ-tests/src/integTest/groovy/org/gradle/AllDistributionIntegrationSpec.groovy @@ -36,7 +36,7 @@ class AllDistributionIntegrationSpec extends DistributionIntegrationSpec { @Override int getMaxDistributionSizeBytes() { - return 192 * 1024 * 1024 + return 193 * 1024 * 1024 } @Requires(UnitTestPreconditions.StableGroovy) // cannot link to public javadocs of Groovy snapshots like https://docs.groovy-lang.org/docs/groovy-4.0.5-SNAPSHOT/html/gapi/ diff --git a/subprojects/docs/src/docs/release/notes.md b/subprojects/docs/src/docs/release/notes.md index 11f4266cfd12..4f82936a4ee7 100644 --- a/subprojects/docs/src/docs/release/notes.md +++ b/subprojects/docs/src/docs/release/notes.md @@ -1,6 +1,16 @@ The Gradle team is excited to announce Gradle @version@. -This release features [1](), [2](), ... [n](), and more. +This release features the support for [persistent Java compiler daemons](#faster-java-compilation) to speed up Java compilation. +Gradle will also use [less memory for dependency resolution](#reduced-memory-consumption). +The effect is significant, particularly for large builds such as Android builds. + +Gradle now supports running on Java 20. + +For Kotlin DSL, build authors can [try out the Kotlin K2 compiler](#kotlin_k2) for build logic with some limitations. +See the [Kotlin DSL](#kotlin-dsl-improvements) dedicated section for more information. + +This release also brings several usability improvements, including better [CodeNarc output](#improved-codenarc-output), a [dry run mode](#dry-run-mode-for-test-execution) for test execution, +improved [output for task options](#group-opposite-boolean-build-and-task-options-together), and upgraded [SSL support](#ssl). - - - ### Faster Java compilation -When compiling Java code, Gradle uses worker processes to run the Java compiler as a compiler daemon. -Compiler daemons are reused within a single build invocation. -This allows the Java compiler to "warm-up" and compile faster after a few uses. +When compiling Java code, Gradle uses worker processes to run the Java compiler as a compiler daemon. +This allows the Java compiler to "warm up" and compile faster after a few uses. +Reusing compiler daemons within a single build invocation speeds up overall build performance as every compile task can potentially execute more quickly. In previous Gradle releases, the compiler daemons were shut down at the end of the build. This caused every build to incur the cost of starting the compiler daemon and warming up the compiler. These start-up costs contributed to a large portion of overall build time when incrementally compiling a few source files. -Starting in this release, Gradle attempts to keep Java compiler daemons alive after the end of the build, so that subsequent builds are faster. -Gradle will stop compiler daemons when too many workers are running. -Compiler daemons may also stop during a build if other worker processes are started and Gradle needs to free up resources. +Starting with this release, Gradle attempts to keep Java compiler daemons alive after the end of the build, so that subsequent builds are faster. +Gradle will stop compiler daemons only when Gradle needs to free up resources. -No configuration changes are required to enable this feature. +The performance benefit these persistent compiler daemons introduce can vary depending on a wide range of factors. +However, Gradle's internal performance tests show up to a 30% build time improvement for builds that are dominated by compiling Java sources. + +No configuration changes are required to enable this feature. -Persistent compiler daemons for other languages will be evaluated in the future. +### Full Support for Java 20 - -### SSL improvements +Gradle 8.1 supported compiling and testing with Java 20 using Java toolchains, but running Gradle itself on Java 20 was not yet supported. -Gradle had multiple issues when non-standard keystores and truststores were used. -This affected users on Linux systems with FIPS enabled and also Windows users who were storing certificates in the Trusted Root Certification Authorities store. -SSL context creation has been improved to be more aligned with the default implementation and to support these cases. -Also, error messages related to SSL have been improved, and they should be more visible. +With this release, Gradle now fully supports compiling, testing and running on Java 20. + +See the full [compatibility documentation](userguide/compatibility.html#java) for details. ### Reduced memory consumption -TODO - dependency resolution uses less heap +Gradle is now using less memory during dependency resolution. +This will benefit all builds including the IDE sync process. +The improvement will be particularly significant for builds doing lots of dependency resolution. + + +Performance results measured with syncing a large Android [project](https://github.com/gradle/perf-android-large-2) with the latest stable Android Studio. + +memory consumption graph ### Kotlin DSL improvements Gradle's [Kotlin DSL](userguide/kotlin_dsl.html) provides an enhanced editing experience in supported IDEs compared to the traditional Groovy DSL — auto-completion, smart content assist, quick access to documentation, navigation to source, and context-aware refactoring. -Kotlin DSL has received substantial improvements in the recent releases, leading to the announcement that [Kotlin DSL is Now the Default for New Gradle Builds](https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds). +Kotlin DSL has received substantial improvements in recent releases, leading to the announcement that [Kotlin DSL is Now the Default for New Gradle Builds](https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds). This release brings another series of improvements. -#### The embedded Kotlin has been upgraded to 1.9.0 +#### Simplified plugin request when needing the embedded Kotlin version -The embedded Kotlin has been updated from 1.8.20 to [Kotlin 1.9.0](https://github.com/JetBrains/kotlin/releases/tag/v1.9.0). -The Kotlin language and API levels for the Kotlin DSL are still set to 1.8 for backwards compatibility. -See the release notes for [Kotlin 1.8.22](https://github.com/JetBrains/kotlin/releases/tag/v1.8.22) and [Kotlin 1.8.21](https://github.com/JetBrains/kotlin/releases/tag/v1.8.21). +Gradle allowed to use the [`kotlin(String)`](kotlin-dsl/gradle/org.gradle.kotlin.dsl/kotlin.html) as a shortcut to apply plugins in the [`org.jetbrains` namespace](https://plugins.gradle.org/search?term=org.jetbrains.kotlin). +However this requires specifying the version of the plugin to apply. -#### Request plugin with the embedded Kotlin version - -It is now easier to request a plugin with the embedded Kotlin version in the builds of your Gradle plugins implemented in Kotlin. - -Instead of using [kotlin()](kotlin-dsl/gradle/org.gradle.kotlin.dsl/kotlin.html) that requires a version declaration you can now use [embeddedKotlin()](kotlin-dsl/gradle/org.gradle.kotlin.dsl/embedded-kotlin.html) instead: +Starting with this Gradle version, you can use [embeddedKotlin()](kotlin-dsl/gradle/org.gradle.kotlin.dsl/embedded-kotlin.html) instead: ```kotlin plugins { @@ -120,11 +104,15 @@ plugins { } ``` +This will result in applying the plugin with a version matching the Kotlin version embedded in Gradle. + + #### Build scripts now accept dependencies compiled with Kotlin K2 compiler -The Kotlin team continues to stabilize the [K2 compiler](https://blog.jetbrains.com/kotlin/2023/02/k2-kotlin-2-0/). -Starting with Kotlin 1.9.0-RC and until the release of Kotlin 2.0, you can easily test the K2 compiler in your projects. -Add `-Pkotlin.experimental.tryK2=true` to your command line invocations or add it to your `gradle.properties` file: +As announced by the Kotlin team, the [K2 compiler is going stable Kotlin 2.0](https://blog.jetbrains.com/kotlin/2023/02/k2-kotlin-2-0/). + +Starting with Kotlin 1.9.0-RC and until the release of Kotlin 2.0, you can easily test the K2 compiler in your Gradle projects. +In order to do so, add `-Pkotlin.experimental.tryK2=true` to your command line invocations or add it to your `gradle.properties` file: ```properties kotlin.experimental.tryK2=true @@ -135,27 +123,28 @@ Setting this Gradle property also sets the language version to 2.0. Starting with this version of Gradle, the compilation of `.gradle.kts` build scripts accepts dependencies compiled with Kotlin K2 compiler. This makes it possible to try out K2 in builds that use Kotlin 1.9 and have Kotlin code in `buildSrc` or in included builds for build logic. -Note that if you use the [`kotlin-dsl` plugin](userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin) in your build logic, you will also need to explicitly set the Kotlin language version to 2.0: +Note that if you use the [`kotlin-dsl` plugin](userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin) in your build logic, you will need to explicitly set the Kotlin language version to 2.0: ```kotlin tasks.withType().configureEach { - compilerOptions { + compilerOptions { apiVersion = KotlinVersion.KOTLIN_2_0 - languageVersion = KotlinVersion.KOTLIN_2_0 + languageVersion = KotlinVersion.KOTLIN_2_0 } } ``` -Moreover, at this stage, K2 doesn't support scripting, so it will not work with [precompiled script plugins](userguide/custom_plugins.html#sec:precompiled_plugins). +Note that at this stage, K2 doesn't support scripting, so it will not work with [precompiled script plugins](userguide/custom_plugins.html#sec:precompiled_plugins). -#### Specify file permissions conveniently, even from Kotlin +#### Specify file permissions conveniently + +Setting file permissions as UNIX mode values is inconvenient since Kotlin doesn’t support octal numeric literals: instead of `mode = 0755` one has to write `mode = "755".toInt(radix = 8)`. -Since Kotlin doesn't support octal numeric literals, setting file permissions as UNIX mode values has been awkward. There is now a [better API](userguide/working_with_files.html#sec:setting_file_permissions) for setting file permissions and extra convenience methods for UNIX-style values. ```kotlin -tasks.register("copy") { - // details omitted +tasks.register("copy") { + // details omitted filePermissions { user { read = true @@ -169,21 +158,75 @@ tasks.register("copy") { } ``` + +#### The embedded Kotlin has been upgraded to 1.9.0 + +The embedded Kotlin has been updated from 1.8.20 to [Kotlin 1.9.0](https://github.com/JetBrains/kotlin/releases/tag/v1.9.0), unblocking the support for running on Java 20. + +The Kotlin language and API levels for the Kotlin DSL are still set to 1.8 for backward compatibility. +See the release notes for [Kotlin 1.8.22](https://github.com/JetBrains/kotlin/releases/tag/v1.8.22) and [Kotlin 1.8.21](https://github.com/JetBrains/kotlin/releases/tag/v1.8.21). + +### Configuration cache + +The [configuration cache](userguide/configuration_cache.html) improves build time by caching the result of the configuration phase and reusing it for subsequent builds. This feature can significantly improve build performance. + +#### Temporarily opting out of stricter configuration inputs detection + +To ensure correctness, the configuration cache detects undeclared inputs when plugins or build logic perform file system checks such as `File.exists()` or `File.isFile()`. +However, not all plugins might be updated yet to properly declare all the inputs, leading to cache misses and suboptimal performance. + +Configuration cache now has an opt-out option for temporarily ignoring such undeclared inputs. + +This option mitigates undesired configuration cache misses until the plugins are properly updated. + +See [the corresponding section](userguide/configuration_cache.html#config_cache:adoption:changes_in_behavior) in the user guide for details. + +#### The configuration cache summary is no longer produced if no problems are encountered + +When the configuration cache feature is enabled, a configuration cache report is produced at `path-to-project/build/reports/configuration-cache//configuration-cache-report.html` if any configuration cache-related problems are found, or if any configuration inputs are detected. + +In previous releases, when a report was produced (because problems were found, or inputs were detected), the build output always included a summary conveying the number of problems found, and a link to the configuration cache report: + +``` +0 problems were found storing the configuration cache. + +See the complete report at file:///path-to-project/build/reports/configuration-cache//configuration-cache-report.html +``` + +Starting with this release, the summary will only be produced if the report includes any problems. The summary will be omitted if the report only contains information on the configuration inputs. + +Note the report is still generated if any problems are found or inputs detected; only the summary is omitted from the console output. + +It is possible to force the summary to be produced even if no configuration cache-related problems are found by specifying the `--info` option. + ### Improved CodeNarc output The `CodeNarc` plugin produces IDE-clickable links when reporting failures to the console. - The `CodeNarc` task also produces clickable links in failure messages to human-readable reports when multiple reports are enabled. -The HTML report generated by `CodeNarc` has been updated to produce violation reports with sortable columns. +codenarc error in console with link + +The HTML report generated by `CodeNarc` has been updated to produce violation reports with sortable columns. + +codenarc html report + +### Dry run mode for test execution + +When testing your project, it may be useful to check which of the tests that you selected would run without actually executing them, especially when using [test filtering](userguide/java_testing.html#test_filtering). + +This release introduces a test dry run mode, which can be enabled by either the `--test-dry-run` command-line option or via the [dryRun](dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:dryRun) property. + +This mode is compatible with the JUnit and TestNG frameworks. ### Group opposite boolean build and task options together -The console output of the `help` task renders options in alphabetical order. +In previous Gradle releases, the console output of the `help` task rendered options in alphabetical order. +This made it harder to see boolean options that have opposing settings. For better readability, this has been changed to group opposite boolean options together. -Disable options are now sorted after their enable option, for example the options `--daemon`, `--no-daemon`, `--no-parallel`, `--parallel` are now rendered in the following order: +Disable options are now sorted after their enable options. +For example, the options `--daemon`, `--no-daemon`, `--no-parallel`, `--parallel` are now rendered in the following order: ```console --daemon @@ -194,31 +237,23 @@ Disable options are now sorted after their enable option, for example the option See the [task options](userguide/custom_tasks.html#sec:listing_task_options) user manual section for more information. -### Dry run mode for test execution +### Maven toolchain declarations with environment variables are now supported -It is now possible to run a test without actual test execution. +Using [toolchains](userguide/toolchains.html) is the recommended way of specifying Java versions for JVM projects. +By default, Gradle automatically detects local JRE/JDK installations so no further configuration is required by the user. +One of the auto-detection formats that Gradle supports is Maven Toolchain specification. -This can be useful for quickly verifying which tests will run when [filtering a test suite](userguide/java_testing.html#test_filtering). +With this Gradle release, if you rely on the integration with Maven toolchain definitions, Gradle now supports the use of environment variables placeholders inside `toolchain.xml` files. +The placeholder will be resolved by looking at environment variables known to the Gradle build. -Dry run mode can be enabled by either the `--test-dry-run` command-line option or via the [dryRun](dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:dryRun) property. + +### SSL improvements for non-standard keystores and truststores -This mode is compatible with the JUnit and TestNG frameworks. - - - -## Promoted features -Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility. -See the User Manual section on the “[Feature Lifecycle](userguide/feature_lifecycle.html)” for more information. +Previously, Gradle exhibited limitations when interfacing with non-standard keystores and truststores. +This affected users on Linux systems with FIPS enabled and also Windows users who were storing certificates in the Trusted Root Certification Authorities store. -The following are the features that have been promoted in this Gradle release. +SSL context creation has been improved to be more aligned with the default implementation and to support these cases. - ## Fixed issues From 3adcfad36275e82b4fba3225a8a917f5b19245b3 Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Mon, 17 Jul 2023 16:42:22 +0200 Subject: [PATCH 3/3] Add release features for Gradle 8.3 --- subprojects/launcher/src/main/resources/release-features.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/launcher/src/main/resources/release-features.txt b/subprojects/launcher/src/main/resources/release-features.txt index e69de29bb2d1..672b52dfaaed 100644 --- a/subprojects/launcher/src/main/resources/release-features.txt +++ b/subprojects/launcher/src/main/resources/release-features.txt @@ -0,0 +1,3 @@ + - Faster Java compilation + - Reduced memory usage + - Support for running on Java 20